PandaRoot
BSEmcHistogrammer Class Reference

Simple wrapper around std::map<TString (histname), TH1*> to help with histogram creation and writting to file. More...

#include <BSEmcHistogrammer.h>

Classes

struct  AxisData
 

Public Member Functions

 BSEmcHistogrammer ()
 
 BSEmcHistogrammer (TFile *t_file)
 
virtual ~BSEmcHistogrammer ()
 
void SetOutputFile (TFile *t_file)
 
TFile * GetOutputFile ()
 
TCanvas * CreateCanvas (const TString &t_key, const TString &t_foldername)
 
TH1F * Create1DHist (const TString &t_key, const TString &t_foldername, AxisData t_xdata, AxisData t_ydata=AxisData{})
 
TH2F * Create2DHist (const TString &t_key, const TString &t_foldername, AxisData t_xdata, AxisData t_ydata)
 
TH3F * Create3DHist (const TString &t_key, const TString &t_foldername, AxisData t_xdata, AxisData t_ydata, AxisData t_zdata)
 
void Fill (const TString &t_key, Double_t t_value, Double_t t_weight)
 
void Fill (const TString &t_key, Double_t t_x, Double_t t_y, Double_t t_weight)
 
TH3F * Get3DHist (const TString &t_key)
 
TH2F * Get2DHist (const TString &t_key)
 
TH1F * Get1DHist (const TString &t_key)
 
TH1 * GetHist (const TString &t_key)
 
void AddHist (TH1 *t_hist, const TString &t_key, const TString &t_foldername)
 
void ClearAllHists ()
 
Bool_t DoesHistoExist (const TString &t_key) const
 
void WriteCanvases ()
 

Detailed Description

Simple wrapper around std::map<TString (histname), TH1*> to help with histogram creation and writting to file.

Author
Ben Salisbury salis.nosp@m.bury.nosp@m.@hisk.nosp@m.p.un.nosp@m.i-bon.nosp@m.n.de, HISKP Bonn
Date
2021-02

Definition at line 29 of file BSEmcHistogrammer.h.

Constructor & Destructor Documentation

◆ BSEmcHistogrammer() [1/2]

BSEmcHistogrammer::BSEmcHistogrammer ( )

◆ BSEmcHistogrammer() [2/2]

BSEmcHistogrammer::BSEmcHistogrammer ( TFile *  t_file)

◆ ~BSEmcHistogrammer()

virtual BSEmcHistogrammer::~BSEmcHistogrammer ( )
virtual

Member Function Documentation

◆ AddHist()

void BSEmcHistogrammer::AddHist ( TH1 *  t_hist,
const TString &  t_key,
const TString &  t_foldername 
)

Referenced by Get1DHist().

◆ ClearAllHists()

void BSEmcHistogrammer::ClearAllHists ( )

Referenced by Get1DHist().

◆ Create1DHist()

TH1F* BSEmcHistogrammer::Create1DHist ( const TString &  t_key,
const TString &  t_foldername,
AxisData  t_xdata,
AxisData  t_ydata = AxisData{} 
)

Referenced by GetOutputFile().

◆ Create2DHist()

TH2F* BSEmcHistogrammer::Create2DHist ( const TString &  t_key,
const TString &  t_foldername,
AxisData  t_xdata,
AxisData  t_ydata 
)

Referenced by GetOutputFile().

◆ Create3DHist()

TH3F* BSEmcHistogrammer::Create3DHist ( const TString &  t_key,
const TString &  t_foldername,
AxisData  t_xdata,
AxisData  t_ydata,
AxisData  t_zdata 
)

Referenced by GetOutputFile().

◆ CreateCanvas()

TCanvas* BSEmcHistogrammer::CreateCanvas ( const TString &  t_key,
const TString &  t_foldername 
)

Referenced by GetOutputFile().

◆ DoesHistoExist()

Bool_t BSEmcHistogrammer::DoesHistoExist ( const TString &  t_key) const

Referenced by Get1DHist().

◆ Fill() [1/2]

void BSEmcHistogrammer::Fill ( const TString &  t_key,
Double_t  t_value,
Double_t  t_weight 
)

Referenced by GetOutputFile().

◆ Fill() [2/2]

void BSEmcHistogrammer::Fill ( const TString &  t_key,
Double_t  t_x,
Double_t  t_y,
Double_t  t_weight 
)

◆ Get1DHist()

TH1F* BSEmcHistogrammer::Get1DHist ( const TString &  t_key)
inline

Definition at line 60 of file BSEmcHistogrammer.h.

References AddHist(), ClearAllHists(), DoesHistoExist(), GetHist(), and WriteCanvases().

60 { return dynamic_cast<TH1F *>(GetHist(t_key)); }
TH1 * GetHist(const TString &t_key)

◆ Get2DHist()

TH2F* BSEmcHistogrammer::Get2DHist ( const TString &  t_key)
inline

Definition at line 59 of file BSEmcHistogrammer.h.

References GetHist().

59 { return dynamic_cast<TH2F *>(GetHist(t_key)); }
TH1 * GetHist(const TString &t_key)

◆ Get3DHist()

TH3F* BSEmcHistogrammer::Get3DHist ( const TString &  t_key)
inline

Definition at line 58 of file BSEmcHistogrammer.h.

References GetHist().

58 { return dynamic_cast<TH3F *>(GetHist(t_key)); }
TH1 * GetHist(const TString &t_key)

◆ GetHist()

TH1* BSEmcHistogrammer::GetHist ( const TString &  t_key)

Referenced by Get1DHist(), Get2DHist(), and Get3DHist().

◆ GetOutputFile()

TFile* BSEmcHistogrammer::GetOutputFile ( )
inline

Definition at line 49 of file BSEmcHistogrammer.h.

References Create1DHist(), Create2DHist(), Create3DHist(), CreateCanvas(), and Fill().

49 { return fFile; }

◆ SetOutputFile()

void BSEmcHistogrammer::SetOutputFile ( TFile *  t_file)
inline

Definition at line 48 of file BSEmcHistogrammer.h.

48 { fFile = t_file; }

◆ WriteCanvases()

void BSEmcHistogrammer::WriteCanvases ( )

Referenced by Get1DHist().


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