hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
HistoManager Class Reference

description More...

#include <HistoManager.h>

Inheritance diagram for HistoManager:
BlFitHistos ClusterHistos MCAnaHistos RawSvtHitHistos RecoHitAnaHistos Svt2DBlHistos ThreeProngHistos TrackEfficHistos TrackHistos TridentHistos ZBiHistos

Public Member Functions

 HistoManager ()
 default constructor
 HistoManager (const std::string &inputName)
 Constructor.
virtual ~HistoManager ()
TH3 * get3dHisto (const std::string &str)
 description
TH2 * get2dHisto (const std::string &str)
 description
TH1 * get1dHisto (const std::string &str)
 description
TH1F * plot1D (const std::string &name, const std::string &xtitle, int nbinsX, float xmin, float xmax)
 description
TH1F * plot1D (const std::string &name, const std::string &xtitle, int nbinsX, double *axisX)
 description
TH2F * plot2D (std::string name, std::string xtitle, int nbinsX, float xmin, float xmax, std::string ytitle, int nbinsY, float ymin, float ymax)
 description
TH2F * plot2D (std::string name, std::string xtitle, int nbinsX, double *axisX, std::string ytitle, int nbinsY, double *axisY)
 description
TH2F * plot2D (std::string name, std::string xtitle, int nbinsX, const double *axisX, std::string ytitle, int nbinsY, const double *axisY)
 description
TH2F * plot2D (std::string name, std::string xtitle, int nbinsX, double *axisX, std::string ytitle, int nbinsY, float ymin, float ymax)
 description
TH3F * plot3D (std::string name, std::string xtitle, int nbinsX, float xmin, float xmax, std::string ytitle, int nbinsY, float ymin, float ymax, std::string ztitle, int nbinsZ, float zmin, float zmax)
 description
TH3F * plot3D (std::string name, std::string xtitle, int nbinsX, double *axisX, std::string ytitle, int nbinsY, double *axisY, std::string ztitle, int nbinsZ, double *axisZ)
 description
virtual void Define3DHistos ()
 define additional 3D histo by hand
virtual void Define2DHistos ()
 define additional 2D histo by hand
virtual void Define1DHistos ()
 define additional 1D histo by hand
virtual void DefineHistos ()
 Definition of histograms from json config.
virtual void DefineHistos (std::vector< std::string > histoCopyNames, std::string makeCopyJsonTag="default=single_copy")
 Definition of histograms from json config.
void Fill1DHisto (const std::string &histoName, float value, float weight=1.)
 description
void Fill2DHisto (const std::string &histoName, float valuex, float valuey, float weight=1.)
 description
void Fill3DHisto (const std::string &histoName, float valuex, float valuey, float valuez, float weight=1.)
 description
virtual void GetHistosFromFile (TFile *inFile, const std::string &name, const std::string &folder="")
 Get histograms from input file.
virtual void saveHistos (TFile *outF=nullptr, std::string folder="")
 save histograms
virtual void loadHistoConfig (const std::string histoConfigFile)
 load histogram config
virtual void sumw2 ()
 description
virtual void Clear ()
 description
virtual std::string getName ()
 get name
void debugMode (bool debug)
 set debug

Public Attributes

std::vector< std::string > histos1dNamesfromTFile
 description
std::vector< std::string > histos2dNamesfromTFile
 description
std::vector< std::string > histos1dNamesfromJson
 description

Protected Types

typedef std::map< std::string, TH1 * >::iterator it1d
 description
typedef std::map< std::string, TH2 * >::iterator it2d
 description
typedef std::map< std::string, TH3 * >::iterator it3d
 description

Protected Attributes

std::string m_name
 description
std::map< std::string, std::vector< double > > Axes
 description
std::map< std::string, TH1 * > histos1d
 description
std::map< std::string, TH2 * > histos2d
 description
std::map< std::string, TH3 * > histos3d
 description
bool debug_ {false}
 description
json _h_configs
 description
int maxWarnings_ {10}
 description
int printWarnings_ {0}
 description
bool doPrintWarnings_ {true}
 description

Detailed Description

description

details

Definition at line 23 of file HistoManager.h.

Member Typedef Documentation

◆ it1d

typedef std::map<std::string,TH1*>::iterator it1d
protected

description

Definition at line 313 of file HistoManager.h.

◆ it2d

typedef std::map<std::string,TH2*>::iterator it2d
protected

description

Definition at line 315 of file HistoManager.h.

◆ it3d

typedef std::map<std::string,TH3*>::iterator it3d
protected

description

Definition at line 317 of file HistoManager.h.

Constructor & Destructor Documentation

◆ HistoManager() [1/2]

default constructor

Definition at line 9 of file HistoManager.cxx.

◆ HistoManager() [2/2]

HistoManager ( const std::string & inputName)

Constructor.

Parameters
inputName

Definition at line 14 of file HistoManager.cxx.

◆ ~HistoManager()

~HistoManager ( )
virtual

desfault destructor

Definition at line 49 of file HistoManager.cxx.

Member Function Documentation

◆ Clear()

void Clear ( )
virtual

description

Definition at line 18 of file HistoManager.cxx.

◆ debugMode()

void debugMode ( bool debug)
inline

set debug

Parameters
debug

Definition at line 303 of file HistoManager.h.

◆ Define1DHistos()

virtual void Define1DHistos ( )
inlinevirtual

define additional 1D histo by hand

Reimplemented in ClusterHistos, MCAnaHistos, and RecoHitAnaHistos.

Definition at line 207 of file HistoManager.h.

◆ Define2DHistos()

virtual void Define2DHistos ( )
inlinevirtual

define additional 2D histo by hand

Reimplemented in ClusterHistos, MCAnaHistos, RecoHitAnaHistos, ThreeProngHistos, TrackEfficHistos, TrackHistos, TridentHistos, and ZBiHistos.

Definition at line 201 of file HistoManager.h.

◆ Define3DHistos()

virtual void Define3DHistos ( )
inlinevirtual

define additional 3D histo by hand

Reimplemented in ClusterHistos, MCAnaHistos, RecoHitAnaHistos, ThreeProngHistos, TrackEfficHistos, TrackHistos, TridentHistos, and ZBiHistos.

Definition at line 195 of file HistoManager.h.

◆ DefineHistos() [1/2]

void DefineHistos ( )
virtual

Definition of histograms from json config.

Reimplemented in RawSvtHitHistos, Svt2DBlHistos, and TridentHistos.

Definition at line 51 of file HistoManager.cxx.

◆ DefineHistos() [2/2]

void DefineHistos ( std::vector< std::string > histoCopyNames,
std::string makeCopyJsonTag = "default=single_copy" )
virtual

Definition of histograms from json config.

Parameters
histoCopyNames
makeCopyJsonTag

Definition at line 111 of file HistoManager.cxx.

◆ Fill1DHisto()

void Fill1DHisto ( const std::string & histoName,
float value,
float weight = 1. )

description

Parameters
histoName
value
weight

Definition at line 363 of file HistoManager.cxx.

◆ Fill2DHisto()

void Fill2DHisto ( const std::string & histoName,
float valuex,
float valuey,
float weight = 1. )

description

Parameters
histoName
valuex
valuey
weight

Definition at line 328 of file HistoManager.cxx.

◆ Fill3DHisto()

void Fill3DHisto ( const std::string & histoName,
float valuex,
float valuey,
float valuez,
float weight = 1. )

description

Parameters
histoName
valuex
valuey
valuez
weight

Definition at line 344 of file HistoManager.cxx.

◆ get1dHisto()

TH1 * get1dHisto ( const std::string & str)
inline

description

Parameters
str
Returns
TH1F*

Definition at line 63 of file HistoManager.h.

◆ get2dHisto()

TH2 * get2dHisto ( const std::string & str)
inline

description

Parameters
str
Returns
TH2F*

Definition at line 55 of file HistoManager.h.

◆ get3dHisto()

TH3 * get3dHisto ( const std::string & str)
inline

description

Parameters
str
Returns
TH3F*

Definition at line 47 of file HistoManager.h.

◆ GetHistosFromFile()

void GetHistosFromFile ( TFile * inFile,
const std::string & name,
const std::string & folder = "" )
virtual

Get histograms from input file.

Parameters
inFile
name
folder

Definition at line 171 of file HistoManager.cxx.

◆ getName()

virtual std::string getName ( )
inlinevirtual

get name

Returns
std::string

Definition at line 296 of file HistoManager.h.

◆ loadHistoConfig()

void loadHistoConfig ( const std::string histoConfigFile)
virtual

load histogram config

Parameters
histoConfigFile

Definition at line 380 of file HistoManager.cxx.

◆ plot1D() [1/2]

TH1F * plot1D ( const std::string & name,
const std::string & xtitle,
int nbinsX,
double * axisX )

description

Parameters
name
xtitle
nbinsX
axisX
Returns
TH1F*

Definition at line 196 of file HistoManager.cxx.

◆ plot1D() [2/2]

TH1F * plot1D ( const std::string & name,
const std::string & xtitle,
int nbinsX,
float xmin,
float xmax )

description

Parameters
name
xtitle
nbinsX
xmin
xmax
Returns
TH1F*

Definition at line 189 of file HistoManager.cxx.

◆ plot2D() [1/4]

TH2F * plot2D ( std::string name,
std::string xtitle,
int nbinsX,
const double * axisX,
std::string ytitle,
int nbinsY,
const double * axisY )

description

Parameters
name
xtitle
nbinsX
axisX
ytitle
nbinsY
axisY
Returns
TH2F*

Definition at line 229 of file HistoManager.cxx.

◆ plot2D() [2/4]

TH2F * plot2D ( std::string name,
std::string xtitle,
int nbinsX,
double * axisX,
std::string ytitle,
int nbinsY,
double * axisY )

description

Parameters
name
xtitle
nbinsX
axisX
ytitle
nbinsY
axisY
Returns
TH2F*

Definition at line 216 of file HistoManager.cxx.

◆ plot2D() [3/4]

TH2F * plot2D ( std::string name,
std::string xtitle,
int nbinsX,
double * axisX,
std::string ytitle,
int nbinsY,
float ymin,
float ymax )

description

Parameters
name
xtitle
nbinsX
axisX
ytitle
nbinsY
ymin
ymax
Returns
TH2F*

Definition at line 244 of file HistoManager.cxx.

◆ plot2D() [4/4]

TH2F * plot2D ( std::string name,
std::string xtitle,
int nbinsX,
float xmin,
float xmax,
std::string ytitle,
int nbinsY,
float ymin,
float ymax )

description

Parameters
name
xtitle
nbinsX
xmin
xmax
ytitle
nbinsY
ymin
ymax
Returns
TH2F*

Definition at line 203 of file HistoManager.cxx.

◆ plot3D() [1/2]

TH3F * plot3D ( std::string name,
std::string xtitle,
int nbinsX,
double * axisX,
std::string ytitle,
int nbinsY,
double * axisY,
std::string ztitle,
int nbinsZ,
double * axisZ )

description

Parameters
name
xtitle
nbinsX
axisX
ytitle
nbinsY
axisY
ztitle
nbinsZ
axisZ
Returns
TH3F*

Definition at line 258 of file HistoManager.cxx.

◆ plot3D() [2/2]

TH3F * plot3D ( std::string name,
std::string xtitle,
int nbinsX,
float xmin,
float xmax,
std::string ytitle,
int nbinsY,
float ymin,
float ymax,
std::string ztitle,
int nbinsZ,
float zmin,
float zmax )

description

Parameters
name
xtitle
nbinsX
xmin
xmax
ytitle
nbinsY
ymin
ymax
ztitle
nbinsZ
zmin
zmax
Returns
TH3F*

Definition at line 280 of file HistoManager.cxx.

◆ saveHistos()

void saveHistos ( TFile * outF = nullptr,
std::string folder = "" )
virtual

save histograms

Parameters
outF
folder

Reimplemented in TridentHistos.

Definition at line 395 of file HistoManager.cxx.

◆ sumw2()

void sumw2 ( )
virtual

description

Definition at line 300 of file HistoManager.cxx.

Member Data Documentation

◆ _h_configs

json _h_configs
protected

description

Definition at line 320 of file HistoManager.h.

◆ Axes

std::map<std::string, std::vector<double> > Axes
protected

description

Definition at line 311 of file HistoManager.h.

◆ debug_

bool debug_ {false}
protected

description

Definition at line 319 of file HistoManager.h.

◆ doPrintWarnings_

bool doPrintWarnings_ {true}
protected

description

Definition at line 323 of file HistoManager.h.

◆ histos1d

std::map<std::string, TH1*> histos1d
protected

description

Definition at line 312 of file HistoManager.h.

◆ histos1dNamesfromJson

std::vector<std::string> histos1dNamesfromJson

description

Definition at line 307 of file HistoManager.h.

◆ histos1dNamesfromTFile

std::vector<std::string> histos1dNamesfromTFile

description

Definition at line 305 of file HistoManager.h.

◆ histos2d

std::map<std::string, TH2*> histos2d
protected

description

Definition at line 314 of file HistoManager.h.

◆ histos2dNamesfromTFile

std::vector<std::string> histos2dNamesfromTFile

description

Definition at line 306 of file HistoManager.h.

◆ histos3d

std::map<std::string, TH3*> histos3d
protected

description

Definition at line 316 of file HistoManager.h.

◆ m_name

std::string m_name
protected

description

Definition at line 310 of file HistoManager.h.

◆ maxWarnings_

int maxWarnings_ {10}
protected

description

Definition at line 321 of file HistoManager.h.

◆ printWarnings_

int printWarnings_ {0}
protected

description

Definition at line 322 of file HistoManager.h.


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