ATLAS Offline Software
|
Bridge between ROOT framework and monitoring code. More...
#include <HistogramFactory.h>
Public Member Functions | |
HistogramFactory (const ServiceHandle< ITHistSvc > &histSvc, const std::string &groupName) | |
Default constructor. More... | |
virtual | ~HistogramFactory () |
Virtual destructor. More... | |
virtual TNamed * | create (const HistogramDef &def) |
Book and register ROOT object for given definition. More... | |
std::string | getFullName (const HistogramDef &def) const |
Invent path name. More... | |
virtual void | remove (const HistogramDef &def) |
Removes histogram (used online to get rid of old LB tagged histograms) More... | |
Static Public Member Functions | |
static std::mutex & | globalROOTMutex () |
Private Member Functions | |
template<class H , class HBASE , typename... Types> | |
HBASE * | create (const HistogramDef &def, Types &&... hargs) |
Create and register histogram. More... | |
template<class H > | |
TH1 * | create1D (const HistogramDef &def) |
Helper for generic 'create' method for 1D histograms. More... | |
template<class H > | |
TH1 * | create1DProfile (const HistogramDef &def) |
Helper for generic 'create' method for 1DProfile histograms. More... | |
template<class H > | |
TH2 * | create2D (const HistogramDef &def) |
Helper for generic 'create' method for 2D histograms. More... | |
template<class H > | |
TH2 * | create2DProfile (const HistogramDef &def) |
Helper for generic 'create' method for 2DProfile histograms. More... | |
TEfficiency * | createEfficiency (const HistogramDef &def) |
Create and register efficiency graph. More... | |
TTree * | createTree (const HistogramDef &def) |
Create and register tree. More... | |
Static Private Member Functions | |
static void | setOpts (TH1 *hist, const HistogramDef &def) |
Setup various histogram options. More... | |
static void | setLabels (TH1 *hist, const HistogramDef &def) |
Set labels for all axes. More... | |
static void | setLabels (TAxis *axis, const std::vector< std::string > &labels) |
Setup labels for histogram axes. More... | |
Private Attributes | |
ServiceHandle< ITHistSvc > | m_histSvc |
std::string | m_streamName |
defines the stream for THistSvc More... | |
std::string | m_groupName |
defines location of group of histograms More... | |
std::mutex | m_createLock |
Static Private Attributes | |
static std::mutex | s_histDirMutex |
Bridge between ROOT framework and monitoring code.
Main purpose of this class is to properly register and retrieve histograms for specific definitions.
Definition at line 26 of file HistogramFactory.h.
HistogramFactory::HistogramFactory | ( | const ServiceHandle< ITHistSvc > & | histSvc, |
const std::string & | groupName | ||
) |
Default constructor.
histSvc | ROOT framework histogramming service |
groupName | Name of the group to which produced histograms will belong |
Definition at line 18 of file HistogramFactory.cxx.
|
inlinevirtual |
|
virtual |
Book and register ROOT object for given definition.
Based on the histogram type, method will return proper kind of the ROOT object
def | Histogram definition |
Definition at line 49 of file HistogramFactory.cxx.
|
private |
Create and register histogram.
If histogram already exists under that name, re-use it
H | Actual type of histogram to be created |
HBASE | Histogram base class (TH[1,2,3]) |
Types | Types of the remaining arguments for TH constructor (except name, title) |
def | Histogram definition |
hargs | Arguments that defines specific type of the histogram |
Definition at line 200 of file HistogramFactory.cxx.
|
private |
Helper for generic 'create' method for 1D histograms.
H | Actual type of histogram to be created |
def | Histogram definition |
Definition at line 93 of file HistogramFactory.cxx.
|
private |
Helper for generic 'create' method for 1DProfile histograms.
H | Actual type of histogram to be created |
def | Histogram definition |
Definition at line 102 of file HistogramFactory.cxx.
|
private |
Helper for generic 'create' method for 2D histograms.
H | Actual type of histogram to be created |
def | Histogram definition |
Definition at line 113 of file HistogramFactory.cxx.
|
private |
Helper for generic 'create' method for 2DProfile histograms.
H | Actual type of histogram to be created |
def | Histogram definition |
Definition at line 130 of file HistogramFactory.cxx.
|
private |
Create and register efficiency graph.
If graph already exists under that name, re-use it
def | Histogram definition |
Definition at line 147 of file HistogramFactory.cxx.
|
private |
Create and register tree.
If tree already exists under that name, re-use it
def | Histogram definition |
Definition at line 234 of file HistogramFactory.cxx.
std::string HistogramFactory::getFullName | ( | const HistogramDef & | def | ) | const |
Invent path name.
If def path contains any of: EXPERT, SHIFT, DEBUG, RUNSTAT, EXPRESS this is online convention this becomes the first element of the path followed by the group name. Else if the def.path is DEFAULT then only the group name is used if the path yet different is concatenated with the group name.
def | Histogram definition |
Definition at line 287 of file HistogramFactory.cxx.
|
inlinestatic |
Definition at line 68 of file HistogramFactory.h.
|
virtual |
Removes histogram (used online to get rid of old LB tagged histograms)
Definition at line 309 of file HistogramFactory.cxx.
|
staticprivate |
Setup labels for histogram axes.
hist | Histogram handler |
labels | Histogram labels (from histogram definition) |
Definition at line 275 of file HistogramFactory.cxx.
|
staticprivate |
|
staticprivate |
Setup various histogram options.
Available options: kCanRebin, Sumw2
hist | Histogram handler |
opt | Histogram options (from histogram definition) |
Definition at line 260 of file HistogramFactory.cxx.
|
mutableprivate |
Definition at line 170 of file HistogramFactory.h.
|
private |
defines location of group of histograms
Definition at line 168 of file HistogramFactory.h.
|
private |
Definition at line 166 of file HistogramFactory.h.
|
private |
defines the stream for THistSvc
Definition at line 167 of file HistogramFactory.h.
|
inlinestaticprivate |
Definition at line 171 of file HistogramFactory.h.