BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramDef1D.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 "HistogramDef1D.hh"
21
22#include <string>
23
24ClassImp(HistogramDef1D)
25
27 xBinning(BinSpecification())
28{;}
29
30HistogramDef1D::HistogramDef1D(const std::string& treeNameIn,
31 const std::string& histNameIn,
32 const BinSpecification& xBinningIn,
33 const std::string& variableIn,
34 const std::string& selectionIn,
35 bool perEntryIn):
36 HistogramDef(treeNameIn, histNameIn, 1, variableIn, selectionIn, perEntryIn),
37 xBinning(xBinningIn)
38{;}
39
40HistogramDef1D::~HistogramDef1D()
41{;}
42
44{
45 std::string result = "{" + std::to_string(xBinning.n) + "} {" + xBinning.GetBinString() + "}";
46 return result;
47}
48
50{
51 std::string result = perEntry ? "Histogram1D" : "SimpleHistogram1D";
52 if (xBinning.isLogSpaced)
53 {result += "Log";}
54 return result;
55}
Binning specification for a single dimension.
std::string GetBinString() const
Return the filename or the binning.
Specification for 1D histogram.
HistogramDef1D()
Public constructor only for compatibility with ROOT - not intended for use.
virtual std::string GetBinningString() const
Return n bins and ranges.
virtual std::string GetHistogramString() const
Get the first string that defines the histogram in rebdsim for feedback.
Common specification for a histogram.
Definition: HistogramDef.hh:34