BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramDef4D.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 "HistogramDef4D.hh"
21
22#include <string>
23
24ClassImp(HistogramDef4D)
25
27 eBinning(BinSpecification())
28{;}
29
30HistogramDef4D::HistogramDef4D(const std::string& treeNameIn,
31 const std::string& histNameIn,
32 const BinSpecification& xBinningIn,
33 const BinSpecification& yBinningIn,
34 const BinSpecification& zBinningIn,
35 const BinSpecification& eBinningIn,
36 const std::string& variableIn,
37 const std::string& eScaleIn,
38 const std::string& selectionIn,
39 bool perEntryIn):
40 HistogramDef3D(treeNameIn, histNameIn, xBinningIn, yBinningIn, zBinningIn, variableIn, selectionIn, perEntryIn),
41 eBinning(eBinningIn),
42 eScale(eScaleIn)
43{
44 nDimensions = 4;
45}
46
47HistogramDef4D::~HistogramDef4D()
48{;}
49
51{
52 std::string result = "{" + std::to_string(xBinning.n) + "," + std::to_string(yBinning.n) + ",";
53 result += std::to_string(zBinning.n) + "," + std::to_string(eBinning.n) + "} {";
54 result += xBinning.GetBinString() + "," + yBinning.GetBinString() + "," + zBinning.GetBinString() + "," + eBinning.GetBinString() +"}";
55 return result;
56}
57
59{
60 std::string result = perEntry ? "Histogram3D" : "SimpleHistogram3D";
61 if (xBinning.isLogSpaced || yBinning.isLogSpaced || zBinning.isLogSpaced || eBinning.isLogSpaced)
62 {result += xBinning.GetLogString() + yBinning.GetLogString() + zBinning.GetLogString() + eBinning.GetLogString();}
63 return result;
64}
Binning specification for a single dimension.
std::string GetLogString() const
Utility function.
std::string GetBinString() const
Return the filename or the binning.
Specification for 3D Histogram.
Specification for 4D Histogram.
HistogramDef4D()
Public constructor only for compatibility with ROOT - not indended 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.