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) 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 "HistogramDef1D.hh"
20
21#include <string>
22
23ClassImp(HistogramDef1D)
24
26 xBinning(BinSpecification())
27{;}
28
29HistogramDef1D::HistogramDef1D(const std::string& treeNameIn,
30 const std::string& histNameIn,
31 const BinSpecification& xBinningIn,
32 const std::string& variableIn,
33 const std::string& selectionIn,
34 bool perEntryIn):
35 HistogramDef(treeNameIn, histNameIn, 1, variableIn, selectionIn, perEntryIn),
36 xBinning(xBinningIn)
37{;}
38
39HistogramDef1D::~HistogramDef1D()
40{;}
41
43{
44 std::string result = "{" + std::to_string(xBinning.n) + "} {" + xBinning.GetBinString() + "}";
45 return result;
46}
47
49{
50 std::string result = perEntry ? "Histogram1D" : "SimpleHistogram1D";
51 if (xBinning.isLogSpaced)
52 {result += "Log";}
53 return result;
54}
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.