Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFPHistogram Class Reference

A common object containing histograms for all particle species. More...

#include <KFParticle/blob/master/KFParticlePerformance/KFPHistogram/KFPHistogram.h>

+ Collaboration diagram for KFPHistogram:

Public Member Functions

 KFPHistogram ()
 Default Constructor. Creates histograms, allocates memory for them.
 
 ~KFPHistogram ()
 
void SetOutFileName (std::string name)
 Set the name of the output file.
 
void Fill (const KFParticle &particle)
 Fills histograms using parameters of the given particle.
 
void Fill (const KFParticleTopoReconstructor &topoReconstructor)
 Fills histograms for each particle reconstructed by the KFParticleFinder object from the given KFParticleTopoReconstructor.
 
KFPHistogramSet GetHistogramSet (int iSet) const
 Returns set of histograms for the decay with index iSet.
 
KFPHistogram1D GetHistogram (int iSet, int iHistogram) const
 Returns "iHistogram" histogram from the set of histograms for the decay with index "iSet".
 
void Save ()
 Stores all histograms to the file with the name defined in KFPHistogram::fOutFileName.
 
bool FillFromFile (std::string prefix)
 Reads object from the file with the name defined by "prefix".
 
void operator+= (const KFPHistogram &h)
 Adds all histograms from object "h" to the current object.
 

Private Member Functions

 KFPHistogram (const KFPHistogram &)
 Does not allow copying of the objects of this class.
 
KFPHistogramoperator= (const KFPHistogram &)
 Does not allow copying of the objects of this class.
 

Private Attributes

std::map< int, int > fPdgToIndex
 A map between PDG code and index of the decay in the KF Particle Finder scheme. A copy of an object from KFPartEfficiencies.
 
std::string fOutFileName
 The name of the output file, where histograms will be stored.
 
KFPHistogramSet fKFPHistogramSet [KFPartEfficiencies::nParticles]
 A set of histograms for all decays reconstructed by KF Particle Finder.
 
int * fMemory
 A pointer to the memory for all histograms.
 

Friends

std::fstream & operator<< (std::fstream &strm, KFPHistogram &histograms)
 Stores all histograms to the output file.
 

Detailed Description

A common object containing histograms for all particle species.

Author
M.Zyzak, I.Kisel
Date
05.02.2019
Version
1.0

The class is used to collect histograms in the environment, where ROOT is not available, for example at Intel Xeon Phi cards. Contains a set of histograms for each decay reconstructed by the KF Particle Finder package, allocates the memory for all histograms: This allows faster allocation, faster transfer of the memory, easier access from the Intel Xeon Phi, better performance.

Definition at line 47 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 47 of file KFPHistogram.h

Constructor & Destructor Documentation

KFPHistogram::KFPHistogram ( )
inline

Default Constructor. Creates histograms, allocates memory for them.

Definition at line 50 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 50 of file KFPHistogram.h

References KFPHistogramSet::DataSize(), fKFPHistogramSet, fMemory, fPdgToIndex, KFPartEfficiencies::GetPdgToIndexMap(), KFPartEfficiencies::nParticles, and KFPHistogramSet::SetHistogramMemory().

+ Here is the call graph for this function:

KFPHistogram::~KFPHistogram ( )
inline

Definition at line 72 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 72 of file KFPHistogram.h

References fMemory.

KFPHistogram::KFPHistogram ( const KFPHistogram )
private

Does not allow copying of the objects of this class.

Member Function Documentation

void KFPHistogram::Fill ( const KFParticle particle)
inline

Fills histograms using parameters of the given particle.

Definition at line 76 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 76 of file KFPHistogram.h

References KFPHistogramSet::Fill(), fKFPHistogramSet, fPdgToIndex, KFParticleBase::GetPDG(), and it.

Referenced by Fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void KFPHistogram::Fill ( const KFParticleTopoReconstructor topoReconstructor)
inline

Fills histograms for each particle reconstructed by the KFParticleFinder object from the given KFParticleTopoReconstructor.

Definition at line 84 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 84 of file KFPHistogram.h

References Fill(), and KFParticleTopoReconstructor::GetParticles().

+ Here is the call graph for this function:

bool KFPHistogram::FillFromFile ( std::string  prefix)
inline

Reads object from the file with the name defined by "prefix".

Definition at line 120 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 120 of file KFPHistogram.h

References fKFPHistogramSet, KFPHistogramSet::GetNHisto1D(), in, perf_headwind::name, NBins, KFPartEfficiencies::nParticles, and KFPHistogramSet::SetHisto1DBinContent().

+ Here is the call graph for this function:

KFPHistogram1D KFPHistogram::GetHistogram ( int  iSet,
int  iHistogram 
) const
inline

Returns "iHistogram" histogram from the set of histograms for the decay with index "iSet".

Definition at line 92 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 92 of file KFPHistogram.h

References fKFPHistogramSet, and KFPHistogramSet::GetHistogram1D().

+ Here is the call graph for this function:

KFPHistogramSet KFPHistogram::GetHistogramSet ( int  iSet) const
inline

Returns set of histograms for the decay with index iSet.

Definition at line 90 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 90 of file KFPHistogram.h

References fKFPHistogramSet.

void KFPHistogram::operator+= ( const KFPHistogram h)
inline

Adds all histograms from object "h" to the current object.

Definition at line 158 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 158 of file KFPHistogram.h

References fKFPHistogramSet, i, and KFPartEfficiencies::nParticles.

KFPHistogram& KFPHistogram::operator= ( const KFPHistogram )
private

Does not allow copying of the objects of this class.

void KFPHistogram::Save ( )
inline

Stores all histograms to the file with the name defined in KFPHistogram::fOutFileName.

Definition at line 113 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 113 of file KFPHistogram.h

References file, fOutFileName, and out.

void KFPHistogram::SetOutFileName ( std::string  name)
inline

Set the name of the output file.

Definition at line 74 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 74 of file KFPHistogram.h

References fOutFileName, and perf_headwind::name.

Friends And Related Function Documentation

std::fstream& operator<< ( std::fstream &  strm,
KFPHistogram histograms 
)
friend

Stores all histograms to the output file.

Definition at line 94 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 94 of file KFPHistogram.h

Member Data Documentation

KFPHistogramSet KFPHistogram::fKFPHistogramSet[KFPartEfficiencies::nParticles]
private

A set of histograms for all decays reconstructed by KF Particle Finder.

Definition at line 167 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 167 of file KFPHistogram.h

Referenced by Fill(), FillFromFile(), GetHistogram(), GetHistogramSet(), KFPHistogram(), and operator+=().

int* KFPHistogram::fMemory
private

A pointer to the memory for all histograms.

Definition at line 168 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 168 of file KFPHistogram.h

Referenced by KFPHistogram(), and ~KFPHistogram().

std::string KFPHistogram::fOutFileName
private

The name of the output file, where histograms will be stored.

Definition at line 166 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 166 of file KFPHistogram.h

Referenced by Save(), and SetOutFileName().

std::map<int, int> KFPHistogram::fPdgToIndex
private

A map between PDG code and index of the decay in the KF Particle Finder scheme. A copy of an object from KFPartEfficiencies.

Definition at line 165 of file KFPHistogram.h.

View newest version in sPHENIX GitHub at line 165 of file KFPHistogram.h

Referenced by Fill(), and KFPHistogram().


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