BmnRoot
Loading...
Searching...
No Matches
BmnHistManager Class Reference

Histogram manager. More...

#include <BmnHistManager.h>

Inheritance diagram for BmnHistManager:
[legend]
Collaboration diagram for BmnHistManager:
[legend]

Public Member Functions

 BmnHistManager ()
 Constructor.
 
virtual ~BmnHistManager ()
 Destructor.
 
void Add (const TString &name, TNamed *object)
 Add new named object to manager.
 
template<class T >
void Create1 (const TString &name, const TString &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 TString &name, const TString &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 TString &name) const
 Return pointer to TH1 histogram.
 
TH2 * H2 (const TString &name) const
 Return pointer to TH2 histogram.
 
Bool_t Exists (const TString &name) const
 Check existence of histogram in manager.
 
void WriteToFile ()
 Write all histograms to current opened file.
 
void ResetHists ()
 Reset all histograms.
 
void ReadFromFile (TFile *file)
 Read histograms from file.
 
void Clear ()
 Clear memory. Remove all histograms.
 
void ShrinkEmptyBinsH1 (const TString &histName)
 Shrink empty bins in H1.
 
void ShrinkEmptyBinsH2 (const TString &histName)
 Shrink empty bins in H2.
 
void Scale (const TString &histName, Double_t scale)
 Scale histogram.
 
void NormalizeToIntegral (const TString &histName)
 Normalize histogram to integral.
 
void Rebin (const TString &histName, Int_t ngroup)
 Rebin histogram.
 
TString ToString () const
 Return string representation of class.
 
 BmnHistManager ()
 Constructor.
 
virtual ~BmnHistManager ()
 Destructor.
 
void Add (const TString &name, TNamed *object)
 Add new named object to manager.
 
template<class T >
void Create1 (const TString &name, const TString &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 TString &name, const TString &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 TString &name) const
 Return pointer to TH1 histogram.
 
TH2 * H2 (const TString &name) const
 Return pointer to TH2 histogram.
 
Bool_t Exists (const TString &name) const
 Check existence of histogram in manager.
 
void WriteToFile ()
 Write all histograms to current opened file.
 
void ResetHists ()
 Reset all histograms.
 
void ReadFromFile (TFile *file)
 Read histograms from file.
 
void Clear ()
 Clear memory. Remove all histograms.
 
void ShrinkEmptyBinsH1 (const TString &histName)
 Shrink empty bins in H1.
 
void ShrinkEmptyBinsH2 (const TString &histName)
 Shrink empty bins in H2.
 
void Scale (const TString &histName, Double_t scale)
 Scale histogram.
 
void NormalizeToIntegral (const TString &histName)
 Normalize histogram to integral.
 
void Rebin (const TString &histName, Int_t ngroup)
 Rebin histogram.
 
TString ToString () const
 Return string representation of class.
 

Friends

std::ostream & operator<< (std::ostream &strm, const BmnHistManager &histManager)
 Operator << for convenient output to std::ostream.
 
std::ostream & operator<< (std::ostream &strm, const BmnHistManager &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 40 of file BmnHistManager.h.

Constructor & Destructor Documentation

◆ BmnHistManager() [1/2]

BmnHistManager::BmnHistManager ( )

Constructor.

Definition at line 31 of file BmnHistManager.cxx.

◆ ~BmnHistManager() [1/2]

BmnHistManager::~BmnHistManager ( )
virtual

Destructor.

Definition at line 33 of file BmnHistManager.cxx.

◆ BmnHistManager() [2/2]

BmnHistManager::BmnHistManager ( )

Constructor.

◆ ~BmnHistManager() [2/2]

virtual BmnHistManager::~BmnHistManager ( )
virtual

Destructor.

Member Function Documentation

◆ Add() [1/2]

void BmnHistManager::Add ( const TString &  name,
TNamed *  object 
)
inline

Add new named object to manager.

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

Definition at line 59 of file BmnHistManager.h.

Referenced by Create1(), Create2(), BmnQaBase::CreateH1(), BmnQaBase::CreateH2(), and ReadFromFile().

◆ Add() [2/2]

void BmnHistManager::Add ( const TString &  name,
TNamed *  object 
)
inline

Add new named object to manager.

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

Definition at line 59 of file BmnHistManager.h.

◆ Clear() [1/2]

void BmnHistManager::Clear ( )

Clear memory. Remove all histograms.

Definition at line 68 of file BmnHistManager.cxx.

◆ Clear() [2/2]

void BmnHistManager::Clear ( )

Clear memory. Remove all histograms.

◆ Create1() [1/2]

template<class T >
void BmnHistManager::Create1 ( const TString &  name,
const TString &  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 74 of file BmnHistManager.h.

References Add().

Referenced by BmnTof400Qa::Init().

◆ Create1() [2/2]

template<class T >
void BmnHistManager::Create1 ( const TString &  name,
const TString &  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 74 of file BmnHistManager.h.

References Add().

◆ Create2() [1/2]

template<class T >
void BmnHistManager::Create2 ( const TString &  name,
const TString &  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 97 of file BmnHistManager.h.

References Add().

Referenced by BmnTof400Qa::Init().

◆ Create2() [2/2]

template<class T >
void BmnHistManager::Create2 ( const TString &  name,
const TString &  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 97 of file BmnHistManager.h.

References Add().

◆ Exists() [1/2]

Bool_t BmnHistManager::Exists ( const TString &  name) const
inline

Check existence of histogram in manager.

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

Definition at line 141 of file BmnHistManager.h.

◆ Exists() [2/2]

Bool_t BmnHistManager::Exists ( const TString &  name) const
inline

Check existence of histogram in manager.

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

Definition at line 141 of file BmnHistManager.h.

◆ H1() [1/2]

◆ H1() [2/2]

TH1 * BmnHistManager::H1 ( const TString &  name) const
inline

Return pointer to TH1 histogram.

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

Definition at line 115 of file BmnHistManager.h.

◆ H2() [1/2]

TH2 * BmnHistManager::H2 ( const TString &  name) const
inline

◆ H2() [2/2]

TH2 * BmnHistManager::H2 ( const TString &  name) const
inline

Return pointer to TH2 histogram.

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

Definition at line 128 of file BmnHistManager.h.

◆ NormalizeToIntegral() [1/2]

void BmnHistManager::NormalizeToIntegral ( const TString &  histName)

Normalize histogram to integral.

Parameters
[in]histNameName of histogram.

Definition at line 128 of file BmnHistManager.cxx.

References H1().

◆ NormalizeToIntegral() [2/2]

void BmnHistManager::NormalizeToIntegral ( const TString &  histName)

Normalize histogram to integral.

Parameters
[in]histNameName of histogram.

◆ ReadFromFile() [1/2]

void BmnHistManager::ReadFromFile ( TFile *  file)

Read histograms from file.

Parameters
[in]filePointer to file with histograms.

Definition at line 50 of file BmnHistManager.cxx.

References Add().

Referenced by BmnSimulationReport::Create().

◆ ReadFromFile() [2/2]

void BmnHistManager::ReadFromFile ( TFile *  file)

Read histograms from file.

Parameters
[in]filePointer to file with histograms.

◆ Rebin() [1/2]

void BmnHistManager::Rebin ( const TString &  histName,
Int_t  ngroup 
)

Rebin histogram.

Parameters
[in]histNameName of histogram.
[in]ngroupRebining factor.

Definition at line 133 of file BmnHistManager.cxx.

References H1().

◆ Rebin() [2/2]

void BmnHistManager::Rebin ( const TString &  histName,
Int_t  ngroup 
)

Rebin histogram.

Parameters
[in]histNameName of histogram.
[in]ngroupRebining factor.

◆ ResetHists() [1/2]

void BmnHistManager::ResetHists ( )

Reset all histograms.

Definition at line 42 of file BmnHistManager.cxx.

Referenced by BmnProfQa::ResetProf().

◆ ResetHists() [2/2]

void BmnHistManager::ResetHists ( )

Reset all histograms.

◆ Scale() [1/2]

void BmnHistManager::Scale ( const TString &  histName,
Double_t  scale 
)

Scale histogram.

Parameters
[in]histNameName of histogram.
[in]scaleScaling factor.

Definition at line 124 of file BmnHistManager.cxx.

References H1().

◆ Scale() [2/2]

void BmnHistManager::Scale ( const TString &  histName,
Double_t  scale 
)

Scale histogram.

Parameters
[in]histNameName of histogram.
[in]scaleScaling factor.

◆ ShrinkEmptyBinsH1() [1/2]

void BmnHistManager::ShrinkEmptyBinsH1 ( const TString &  histName)

Shrink empty bins in H1.

Parameters
[in]histNameName of histogram.

Definition at line 76 of file BmnHistManager.cxx.

References H1().

◆ ShrinkEmptyBinsH1() [2/2]

void BmnHistManager::ShrinkEmptyBinsH1 ( const TString &  histName)

Shrink empty bins in H1.

Parameters
[in]histNameName of histogram.

◆ ShrinkEmptyBinsH2() [1/2]

void BmnHistManager::ShrinkEmptyBinsH2 ( const TString &  histName)

Shrink empty bins in H2.

Parameters
[in]histNameName of histogram.

Definition at line 97 of file BmnHistManager.cxx.

References H2().

◆ ShrinkEmptyBinsH2() [2/2]

void BmnHistManager::ShrinkEmptyBinsH2 ( const TString &  histName)

Shrink empty bins in H2.

Parameters
[in]histNameName of histogram.

◆ ToString() [1/2]

TString BmnHistManager::ToString ( ) const

Return string representation of class.

Returns
string representation of class.

Definition at line 141 of file BmnHistManager.cxx.

Referenced by BmnQaHistoManager::GetListOfHistos().

◆ ToString() [2/2]

TString BmnHistManager::ToString ( ) const

Return string representation of class.

Returns
string representation of class.

◆ WriteToFile() [1/2]

void BmnHistManager::WriteToFile ( )

◆ WriteToFile() [2/2]

void BmnHistManager::WriteToFile ( )

Write all histograms to current opened file.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  strm,
const BmnHistManager 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 211 of file BmnHistManager.h.

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  strm,
const BmnHistManager 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 211 of file BmnHistManager.h.


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