BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Holder for information to calculate per entry histograms. More...
#include <PerEntryHistogram.hh>
Public Member Functions | |
PerEntryHistogram () | |
Public constructor only for compatibility with ROOT - not intended for use. | |
PerEntryHistogram (const HistogramDef *definition, TChain *chain) | |
Constructor with a histogram definition and the chain to operate on. | |
virtual void | AccumulateCurrentEntry (long int entryNumber) |
virtual void | Terminate () |
Terminate the accumulator and save the result to the result member variable. | |
virtual void | Write (TDirectory *dir=nullptr) |
void | AddNEmptyEntries (unsigned long i) |
double | Integral () const |
Get the Integral() from the result member histogram if it exists, otherwise 0. | |
Protected Member Functions | |
ClassDef (PerEntryHistogram, 1) | |
Protected Attributes | |
HistogramAccumulator * | accumulator |
TChain * | chain |
Cache of chain pointer that provides data. | |
std::string | selection |
Selection command. | |
TH1 * | temp |
Histogram for temporary 1 event data. | |
TH1 * | result |
Final result with errors as the error on the mean. | |
std::string | command |
Draw command. | |
Holder for information to calculate per entry histograms.
This creates a histogram per event and accumulates the mean and variance for every bin in a cloned histogram. In the case of 1 event, the bin error is 0.
This uses a HistogramAccumulator object rather than inheritance as this class has to prepare the base histogram in the constructor first.
Definition at line 46 of file PerEntryHistogram.hh.
PerEntryHistogram::PerEntryHistogram | ( | const HistogramDef * | definition, |
TChain * | chain | ||
) |
Constructor with a histogram definition and the chain to operate on.
Definition at line 50 of file PerEntryHistogram.cc.
References command, HistogramFactory::CreateHistogram1D(), HistogramFactory::CreateHistogram2D(), HistogramFactory::CreateHistogram3D(), HistogramFactory::CreateHistogram4D(), and temp.
|
virtual |
Definition at line 110 of file PerEntryHistogram.cc.
|
virtual |
Create a histogram of the appropriate dimensions for the currently loaded event then add it to the online (ie running) means and variances.
Reimplemented in PerEntryHistogramSet.
Definition at line 116 of file PerEntryHistogram.cc.
References HistogramAccumulator::Accumulate(), chain, command, selection, and temp.
Referenced by PerEntryHistogramSet::AccumulateCurrentEntry().
|
inline |
Permit the number of recorded entries to be incremented with zero values, ie just increment n.
Definition at line 70 of file PerEntryHistogram.hh.
References HistogramAccumulator::AddNEmptyEntries().
double PerEntryHistogram::Integral | ( | ) | const |
Get the Integral() from the result member histogram if it exists, otherwise 0.
Definition at line 142 of file PerEntryHistogram.cc.
References result.
|
virtual |
Terminate the accumulator and save the result to the result member variable.
Reimplemented in PerEntryHistogramSet.
Definition at line 127 of file PerEntryHistogram.cc.
References result, and HistogramAccumulator::Terminate().
Referenced by PerEntryHistogramSet::Terminate().
|
virtual |
Forwarding function - call Write on result histograms on the currently open file. Optional directory to specify where the histogram should be moved to.
Reimplemented in PerEntryHistogramSet.
Definition at line 132 of file PerEntryHistogram.cc.
References result.
Referenced by PerEntryHistogramSet::Write().
|
protected |
Definition at line 76 of file PerEntryHistogram.hh.
|
protected |
Cache of chain pointer that provides data.
Definition at line 77 of file PerEntryHistogram.hh.
Referenced by AccumulateCurrentEntry().
|
protected |
Draw command.
Definition at line 81 of file PerEntryHistogram.hh.
Referenced by AccumulateCurrentEntry(), and PerEntryHistogram().
|
protected |
Final result with errors as the error on the mean.
Definition at line 80 of file PerEntryHistogram.hh.
Referenced by Integral(), Terminate(), and Write().
|
protected |
Selection command.
Definition at line 78 of file PerEntryHistogram.hh.
Referenced by AccumulateCurrentEntry().
|
protected |
Histogram for temporary 1 event data.
Definition at line 79 of file PerEntryHistogram.hh.
Referenced by AccumulateCurrentEntry(), and PerEntryHistogram().