BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramDef.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 "HistogramDef.hh"
20
21#include <iostream>
22#include <string>
23
24ClassImp(HistogramDef)
25
27 treeName(""),
28 histName(""),
29 nDimensions(0),
30 variable(""),
31 selection(""),
32 perEntry(false)
33{;}
34
35HistogramDef::HistogramDef(const std::string& treeNameIn,
36 const std::string& histNameIn,
37 int nDimensionsIn,
38 const std::string& variableIn,
39 const std::string& selectionIn,
40 bool perEntryIn):
41 treeName(treeNameIn),
42 histName(histNameIn),
43 nDimensions(nDimensionsIn),
44 variable(variableIn),
45 selection(selectionIn),
46 perEntry(perEntryIn)
47{;}
48
49std::ostream& operator<< (std::ostream& out, const HistogramDef& s)
50{
51 std::string hs = s.GetHistogramString();
52 std::string bs = s.GetBinningString();
53 out << hs << " " << s.treeName << " " << s.histName << " " << bs << " " << s.variable << " " << s.selection << "\n";
54 return out;
55}
Common specification for a histogram.
Definition: HistogramDef.hh:34
HistogramDef()
Public constructor only for compatibility with ROOT - not intended for use.
virtual std::string GetHistogramString() const =0
Get the first string that defines the histogram in rebdsim for feedback.
virtual std::string GetBinningString() const =0
Provide the binning string in the original input format for feedback.