BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
PerEntryHistogramSetS Class Reference

Histogram over a set of integers not number line. More...

#include <PerEntryHistogramSetS.hh>

Inheritance diagram for PerEntryHistogramSetS:
Inheritance graph
Collaboration diagram for PerEntryHistogramSetS:
Collaboration graph

Public Member Functions

 PerEntryHistogramSetS (const HistogramDefSet *definitionIn, Event *eventIn, TChain *chainIn)
 
virtual void CheckSampler ()
 
- Public Member Functions inherited from PerEntryHistogramSet
 PerEntryHistogramSet (const HistogramDefSet *definitionIn, Event *eventIn, TChain *chainIn)
 
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)
 
- Public Member Functions inherited from PerEntryHistogram
 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.
 
void AddNEmptyEntries (unsigned long i)
 
double Integral () const
 Get the Integral() from the result member histogram if it exists, otherwise 0.
 

Protected Member Functions

virtual void GetPDGIDSetFromSampler (std::set< long long int > &setIn) const
 
- Protected Member Functions inherited from PerEntryHistogramSet
bool IsIon (long long int pdgID) const
 
void CreatePerEntryHistogram (long long int pdgID)
 
std::vector< long long int > TopUtility (const std::set< long long int > &s, size_t n) const
 Utility function to find top N in set s. Sorted in descending order of integral.
 
std::vector< long long int > TopNNonIons (int n) const
 Get top part of set. Sorted in descending order of integral.
 
std::vector< long long int > TopNIons (int n) const
 Get top part of set. Sorted in descending order of integral.
 
std::vector< long long int > TopN (int n) const
 Get top part of set. Sorted in descending order of integral.
 
- Protected Member Functions inherited from PerEntryHistogram
 ClassDef (PerEntryHistogram, 1)
 

Protected Attributes

BDSOutputROOTEventSamplerSsampler
 
- Protected Attributes inherited from PerEntryHistogramSet
HistogramDefbaseDefinition
 
Eventevent
 
TChain * chain
 
std::string branchName
 
bool dynamicallyStoreParticles
 
bool dynamicallyStoreIons
 
long long int nEntries
 
HistogramDefSet::writewhat what
 
int topN
 
BDSOutputROOTEventSampler< double > * sampler
 
BDSOutputROOTEventSampler< float > * sampler
 
std::set< long long int > allPDGIDs
 
std::set< long long int > ions
 
std::set< long long int > nonIons
 
std::map< ParticleSpec, PerEntryHistogram * > histograms
 
std::map< long long int, PerEntryHistogram * > histogramsByPDGID
 
std::vector< PerEntryHistogram * > allPerEntryHistograms
 
- Protected Attributes inherited from PerEntryHistogram
HistogramAccumulatoraccumulator
 
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.
 

Detailed Description

Histogram over a set of integers not number line.

Specialised for a spherical sampler.

Author
L. Nevay

Definition at line 41 of file PerEntryHistogramSetS.hh.

Constructor & Destructor Documentation

◆ PerEntryHistogramSetS()

PerEntryHistogramSetS::PerEntryHistogramSetS ( const HistogramDefSet definitionIn,
Event eventIn,
TChain *  chainIn 
)

Definition at line 30 of file PerEntryHistogramSetS.cc.

◆ ~PerEntryHistogramSetS()

PerEntryHistogramSetS::~PerEntryHistogramSetS ( )
virtual

Definition at line 37 of file PerEntryHistogramSetS.cc.

Member Function Documentation

◆ CheckSampler()

void PerEntryHistogramSetS::CheckSampler ( )
virtual

Ensure sampler is setup even if it wasn't on at the beginning when we inspected the model tree. We need this to build up unique PDG IDs by manually looping over the data. A derived class must implement this for each type of sampler data we have.

Implements PerEntryHistogramSet.

Definition at line 40 of file PerEntryHistogramSetS.cc.

◆ GetPDGIDSetFromSampler()

void PerEntryHistogramSetS::GetPDGIDSetFromSampler ( std::set< long long int > &  setIn) const
protectedvirtual

Derived class should get the partID member and form a set from the specific type of sampler it is.

Implements PerEntryHistogramSet.

Definition at line 50 of file PerEntryHistogramSetS.cc.

Field Documentation

◆ sampler

BDSOutputROOTEventSamplerS* PerEntryHistogramSetS::sampler
protected

Definition at line 60 of file PerEntryHistogramSetS.hh.


The documentation for this class was generated from the following files: