EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbmHistManager Class Reference

Histogram manager. More...

#include <EicRoot/blob/master/cbmbase/CbmHistManager.h>

+ Inheritance diagram for CbmHistManager:
+ Collaboration diagram for CbmHistManager:

Public Member Functions

 CbmHistManager ()
 Constructor.
 
virtual ~CbmHistManager ()
 Destructor.
 
void Add (const string &name, TNamed *object)
 Add new named object to manager.
 
template<class T >
void Create1 (const string &name, const string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
 Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real object type that has to be created, for example, Create1<TH1F>("name", "title", 100, 0, 100);.
 
template<class T >
void Create2 (const string &name, const string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
 Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real object type that has to be created, for example, Create2<TH2F>("name", "title", 100, 0, 100, 200, 0, 200);.
 
TH1 * H1 (const string &name) const
 Return pointer to TH1 histogram.
 
vector< TH1 * > H1Vector (const string &pattern) const
 Return vector of pointers to TH1 histogram.
 
TH2 * H2 (const string &name) const
 Return pointer to TH2 histogram.
 
vector< TH2 * > H2Vector (const string &pattern) const
 Return vector of pointers to TH2 histogram.
 
TGraph * G1 (const string &name) const
 Return pointer to TGraph.
 
vector< TGraph * > G1Vector (const string &pattern) const
 Return vector of pointers to TGraph.
 
TGraph2D * G2 (const string &name) const
 Return pointer to TGraph2D.
 
vector< TGraph2D * > G2Vector (const string &pattern) const
 Return vector of pointers to TGraph2D.
 
TProfile * P1 (const string &name) const
 Return pointer to TProfile.
 
vector< TProfile * > P1Vector (const string &pattern) const
 Return vector of pointers to TProfile.
 
TProfile2D * P2 (const string &name) const
 Return pointer to TH2 histogram.
 
vector< TProfile2D * > P2Vector (const string &pattern) const
 Return vector of pointers to TProfile2D.
 
Bool_t Exists (const string &name) const
 Check existence of histogram in manager.
 
void WriteToFile ()
 Write all histograms to current opened file.
 
void ReadFromFile (TFile *file)
 Read histograms from file.
 
void Clear ()
 Clear memory. Remove all histograms.
 
void ShrinkEmptyBins (const string &histName)
 Shrink empty bins in histogram for Xaxis from right side.
 
void ShrinkEmptyBinsByPattern (const string &pattern)
 Shrink empty bins in histograms for Xaxis from right side.
 
void Scale (const string &histName, Double_t scale)
 Scale histogram.
 
void ScaleByPattern (const string &pattern, Double_t scale)
 Scale histograms which name matches specified pattern.
 
void Rebin (const string &histName, Int_t ngroup)
 Rebin histogram.
 
void RebinByPattern (const string &pattern, Int_t ngroup)
 Rebin histograms which name matches specified pattern.
 
string ToString () const
 Return string representation of class.
 

Private Member Functions

template<class T >
vector< TObjectVector (const string &pattern) const
 

Private Attributes

map< string, TNamed * > fMap
 

Friends

std::ostream & operator<< (std::ostream &strm, const CbmHistManager &histManager)
 Operator << for convenient output to std::ostream.
 

Detailed Description

Histogram manager.

Author
Semen Lebedev s.leb.nosp@m.edev.nosp@m.@gsi..nosp@m.de
Date
2011

Definition at line 38 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 38 of file CbmHistManager.h

Constructor & Destructor Documentation

CbmHistManager::CbmHistManager ( )

Constructor.

virtual CbmHistManager::~CbmHistManager ( )
virtual

Destructor.

Member Function Documentation

void CbmHistManager::Add ( const string &  name,
TNamed *  object 
)
inline

Add new named object to manager.

Parameters
[in]nameName of the object.
[in]objectPointer to object.

Definition at line 57 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 57 of file CbmHistManager.h

Referenced by Create1(), and Create2().

+ Here is the caller graph for this function:

void CbmHistManager::Clear ( )

Clear memory. Remove all histograms.

template<class T >
void CbmHistManager::Create1 ( const string &  name,
const string &  title,
Int_t  nofBins,
Double_t  minBin,
Double_t  maxBin 
)
inline

Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real object type that has to be created, for example, Create1<TH1F>("name", "title", 100, 0, 100);.

Parameters
[in]nameObject name.
[in]titleObject title.
[in]nofBinsNumber of bins.
[in]minBinLow axis limit.
[in]maxBinUpper axis limit.

Definition at line 73 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 73 of file CbmHistManager.h

References Add(), Acts::UnitConstants::h, and T.

+ Here is the call graph for this function:

template<class T >
void CbmHistManager::Create2 ( const string &  name,
const string &  title,
Int_t  nofBinsX,
Double_t  minBinX,
Double_t  maxBinX,
Int_t  nofBinsY,
Double_t  minBinY,
Double_t  maxBinY 
)
inline

Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real object type that has to be created, for example, Create2<TH2F>("name", "title", 100, 0, 100, 200, 0, 200);.

Parameters
[in]nameObject name.
[in]titleObject title.
[in]nofBinsXNumber of bins for X axis.
[in]minBinXLow X axis limit.
[in]maxBinXUpper X axis limit.
[in]nofBinsYNumber of bins for Y axis.
[in]minBinYLow Y axis limit.
[in]maxBinYUpper Y axis limit.

Definition at line 96 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 96 of file CbmHistManager.h

References Add(), Acts::UnitConstants::h, and T.

+ Here is the call graph for this function:

Bool_t CbmHistManager::Exists ( const string &  name) const
inline

Check existence of histogram in manager.

Parameters
[in]nameName of histogram.
Returns
True if histogram exists in manager.

Definition at line 246 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 246 of file CbmHistManager.h

References fMap.

TGraph* CbmHistManager::G1 ( const string &  name) const
inline

Return pointer to TGraph.

Parameters
[in]nameName of graph.
Returns
pointer to TGraph.

Definition at line 158 of file CbmHistManager.h.

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

References fMap.

vector<TGraph*> CbmHistManager::G1Vector ( const string &  pattern) const

Return vector of pointers to TGraph.

Parameters
[in]patternRegex for object name.
Returns
Vector of pointers to TGraph.
TGraph2D* CbmHistManager::G2 ( const string &  name) const
inline

Return pointer to TGraph2D.

Parameters
[in]nameName of graph.
Returns
pointer to TGraph.

Definition at line 180 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 180 of file CbmHistManager.h

References fMap.

vector<TGraph2D*> CbmHistManager::G2Vector ( const string &  pattern) const

Return vector of pointers to TGraph2D.

Parameters
[in]patternRegex for object name.
Returns
Vector of pointers to TGraph2D.
TH1* CbmHistManager::H1 ( const string &  name) const
inline

Return pointer to TH1 histogram.

Parameters
[in]nameName of histogram.
Returns
pointer to TH1 histogram.

Definition at line 114 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 114 of file CbmHistManager.h

References fMap.

vector<TH1*> CbmHistManager::H1Vector ( const string &  pattern) const

Return vector of pointers to TH1 histogram.

Parameters
[in]patternRegex for histogram name.
Returns
Vector of pointers to TH1 histogram.
TH2* CbmHistManager::H2 ( const string &  name) const
inline

Return pointer to TH2 histogram.

Parameters
[in]nameName of histogram.
Returns
pointer to TH1 histogram.

Definition at line 136 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 136 of file CbmHistManager.h

References fMap.

vector<TH2*> CbmHistManager::H2Vector ( const string &  pattern) const

Return vector of pointers to TH2 histogram.

Parameters
[in]patternRegex for histogram name.
Returns
Vector of pointers to TH2 histogram.
template<class T >
vector<T> CbmHistManager::ObjectVector ( const string &  pattern) const
private
TProfile* CbmHistManager::P1 ( const string &  name) const
inline

Return pointer to TProfile.

Parameters
[in]nameName of profile.
Returns
pointer to TProfile.

Definition at line 202 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 202 of file CbmHistManager.h

References fMap.

vector<TProfile*> CbmHistManager::P1Vector ( const string &  pattern) const

Return vector of pointers to TProfile.

Parameters
[in]patternRegex for profile name.
Returns
Vector of pointers to TProfile.
TProfile2D* CbmHistManager::P2 ( const string &  name) const
inline

Return pointer to TH2 histogram.

Parameters
[in]nameName of histogram.
Returns
pointer to TH1 histogram.

Definition at line 224 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 224 of file CbmHistManager.h

References fMap.

vector<TProfile2D*> CbmHistManager::P2Vector ( const string &  pattern) const

Return vector of pointers to TProfile2D.

Parameters
[in]patternRegex for profile name.
Returns
Vector of pointers to TProfile2D.
void CbmHistManager::ReadFromFile ( TFile *  file)

Read histograms from file.

Parameters
[in]filePointer to file with histograms.
void CbmHistManager::Rebin ( const string &  histName,
Int_t  ngroup 
)

Rebin histogram.

Parameters
[in]histNameName of histogram.
[in]ngroupRebining factor.
void CbmHistManager::RebinByPattern ( const string &  pattern,
Int_t  ngroup 
)

Rebin histograms which name matches specified pattern.

Parameters
[in]histPatternNameRegular expression for histogram name.
[in]ngroupRebining factor.
void CbmHistManager::Scale ( const string &  histName,
Double_t  scale 
)

Scale histogram.

Parameters
[in]histNameName of histogram.
[in]scaleScaling factor.
void CbmHistManager::ScaleByPattern ( const string &  pattern,
Double_t  scale 
)

Scale histograms which name matches specified pattern.

Parameters
[in]histPatternNameRegular expression for histogram name.
[in]scaleScaling factor.
void CbmHistManager::ShrinkEmptyBins ( const string &  histName)

Shrink empty bins in histogram for Xaxis from right side.

Parameters
[in]histNameName of histogram.
void CbmHistManager::ShrinkEmptyBinsByPattern ( const string &  pattern)

Shrink empty bins in histograms for Xaxis from right side.

Parameters
[in]histPatternNameRegular expression for histogram name.
string CbmHistManager::ToString ( ) const

Return string representation of class.

Returns
string representation of class.
void CbmHistManager::WriteToFile ( )

Write all histograms to current opened file.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  strm,
const CbmHistManager histManager 
)
friend

Operator << for convenient output to std::ostream.

Returns
Insertion stream in order to be able to call a succession of insertion operations.

Definition at line 328 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 328 of file CbmHistManager.h

Member Data Documentation

map<string, TNamed*> CbmHistManager::fMap
private

Definition at line 338 of file CbmHistManager.h.

View newest version in sPHENIX GitHub at line 338 of file CbmHistManager.h

Referenced by Exists(), G1(), G2(), H1(), H2(), P1(), and P2().


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