BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramDef3D.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "BinSpecification.hh"
19#include "HistogramDef3D.hh"
20
21#include <string>
22
23ClassImp(HistogramDef3D)
24
26 zBinning(BinSpecification())
27{;}
28
29HistogramDef3D::HistogramDef3D(const std::string& treeNameIn,
30 const std::string& histNameIn,
31 const BinSpecification& xBinningIn,
32 const BinSpecification& yBinningIn,
33 const BinSpecification& zBinningIn,
34 const std::string& variableIn,
35 const std::string& selectionIn,
36 bool perEntryIn):
37 HistogramDef2D(treeNameIn, histNameIn, xBinningIn, yBinningIn, variableIn, selectionIn, perEntryIn),
38 zBinning(zBinningIn)
39{
40 nDimensions = 3;
41}
42
43HistogramDef3D::~HistogramDef3D()
44{;}
45
47{
48 std::string result = "{" + std::to_string(xBinning.n) + "," + std::to_string(yBinning.n) + "," + std::to_string(zBinning.n) + "} {";
49 result += xBinning.GetBinString() + "," + yBinning.GetBinString() + "," + zBinning.GetBinString() + "}";
50 return result;
51}
52
54{
55 std::string result = perEntry ? "Histogram3D" : "SimpleHistogram3D";
56 if (xBinning.isLogSpaced || yBinning.isLogSpaced || zBinning.isLogSpaced)
57 {result += xBinning.GetLogString() + yBinning.GetLogString() + zBinning.GetLogString();}
58 return result;
59}
Binning specification for a single dimension.
std::string GetLogString() const
Utility function.
std::string GetBinString() const
Return the filename or the binning.
Specification for 2D histogram.
Specification for 3D Histogram.
HistogramDef3D()
Public constructor only for compatibility with ROOT - not intended for use.
virtual std::string GetHistogramString() const
Get the first string that defines the histogram in rebdsim for feedback.
virtual std::string GetBinningString() const
Return n bins and ranges.