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) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BinSpecification.hh"
20#include "HistogramDef3D.hh"
21
22#include <string>
23
24ClassImp(HistogramDef3D)
25
27 zBinning(BinSpecification())
28{;}
29
30HistogramDef3D::HistogramDef3D(const std::string& treeNameIn,
31 const std::string& histNameIn,
32 const BinSpecification& xBinningIn,
33 const BinSpecification& yBinningIn,
34 const BinSpecification& zBinningIn,
35 const std::string& variableIn,
36 const std::string& selectionIn,
37 bool perEntryIn):
38 HistogramDef2D(treeNameIn, histNameIn, xBinningIn, yBinningIn, variableIn, selectionIn, perEntryIn),
39 zBinning(zBinningIn)
40{
41 nDimensions = 3;
42}
43
44HistogramDef3D::~HistogramDef3D()
45{;}
46
48{
49 std::string result = "{" + std::to_string(xBinning.n) + "," + std::to_string(yBinning.n) + "," + std::to_string(zBinning.n) + "} {";
50 result += xBinning.GetBinString() + "," + yBinning.GetBinString() + "," + zBinning.GetBinString() + "}";
51 return result;
52}
53
55{
56 std::string result = perEntry ? "Histogram3D" : "SimpleHistogram3D";
57 if (xBinning.isLogSpaced || yBinning.isLogSpaced || zBinning.isLogSpaced)
58 {result += xBinning.GetLogString() + yBinning.GetLogString() + zBinning.GetLogString();}
59 return result;
60}
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.