ATLAS Offline Software
Loading...
Searching...
No Matches
Monitored::HistogramFillerFactory Class Reference

Factory of the histogram fillers. More...

#include <HistogramFillerFactory.h>

Collaboration diagram for Monitored::HistogramFillerFactory:

Public Member Functions

 HistogramFillerFactory (GenericMonitoringTool *const gmTool, std::string groupName)
 Default constructor.
virtual ~HistogramFillerFactory ()
 Virtual destructor.
HistogramFillercreate (const HistogramDef &def)
 Creates HistogramFiller instance for given definition.

Private Member Functions

std::shared_ptr< IHistogramProvidercreateHistogramProvider (const HistogramDef &def)

Private Attributes

GenericMonitoringToolm_gmTool
std::shared_ptr< HistogramFactorym_factory

Detailed Description

Factory of the histogram fillers.

Definition at line 22 of file HistogramFillerFactory.h.

Constructor & Destructor Documentation

◆ HistogramFillerFactory()

Monitored::HistogramFillerFactory::HistogramFillerFactory ( GenericMonitoringTool *const gmTool,
std::string groupName )
inline

Default constructor.

Parameters
gmToolAn instance of GenericMonitoringTool
groupNameName of the group to which produced histograms will belong

Definition at line 30 of file HistogramFillerFactory.h.

31 : m_gmTool(gmTool),
32 m_factory(new HistogramFactory(gmTool->histogramService(), std::move(groupName))) {}
virtual const ServiceHandle< ITHistSvc > & histogramService() const
std::shared_ptr< HistogramFactory > m_factory

◆ ~HistogramFillerFactory()

virtual Monitored::HistogramFillerFactory::~HistogramFillerFactory ( )
inlinevirtual

Virtual destructor.

Definition at line 37 of file HistogramFillerFactory.h.

37{}

Member Function Documentation

◆ create()

HistogramFiller * HistogramFillerFactory::create ( const HistogramDef & def)

Creates HistogramFiller instance for given definition.

Based on the histogram type and opts, method will return proper kind of the HistogramFiller

Parameters
defHistogram definition
Returns
HistogramFiller handler

Definition at line 25 of file HistogramFillerFactory.cxx.

25 {
26 std::shared_ptr<IHistogramProvider> histogramProvider = createHistogramProvider(def);
27
28 if (def.type.starts_with( "TH1")) {
29 if (def.kCumulative) {
30 return new CumulativeHistogramFiller1D(def, std::move(histogramProvider));
31 } else if (def.kAddBinsDynamically || def.kRebinAxes) {
32 return new HistogramFillerRebinable1D(def, std::move(histogramProvider));
33 } else if (def.kVec || def.kVecUO) {
34 return new VecHistogramFiller1D(def, std::move(histogramProvider));
35 } else {
36 return new HistogramFiller1D(def, std::move(histogramProvider));
37 }
38 } else if (def.type.starts_with( "TH2")) {
39 if (def.kAddBinsDynamically || def.kRebinAxes) {
40 return new HistogramFillerRebinable2D(def, std::move(histogramProvider));
41 } else {
42 return new HistogramFiller2D(def, std::move(histogramProvider));
43 }
44 } else if (def.type == "TProfile") {
45 if (def.kAddBinsDynamically || def.kRebinAxes) {
46 return new HistogramFillerProfileRebinable(def, std::move(histogramProvider));
47 } else {
48 return new HistogramFillerProfile(def, std::move(histogramProvider));
49 }
50 } else if (def.type == "TProfile2D") {
51 if (def.kAddBinsDynamically || def.kRebinAxes) {
52 return new HistogramFiller2DProfileRebinable(def, std::move(histogramProvider));
53 } else {
54 return new HistogramFiller2DProfile(def, std::move(histogramProvider));
55 }
56 } else if (def.type == "TEfficiency") {
57 return new HistogramFillerEfficiency(def, std::move(histogramProvider));
58 } else if (def.type == "TTree") {
59 return new HistogramFillerTree(def, std::move(histogramProvider));
60 }
61
62 return nullptr;
63}
std::shared_ptr< IHistogramProvider > createHistogramProvider(const HistogramDef &def)
HistogramFillerRebinableAxis< HistogramFillerRebinable2DX, Axis::Y > HistogramFillerRebinable2D
Rebinable 2D histogram (both axes)
HistogramFillerRebinableAxis< HistogramFiller2DProfile, Axis::X > HistogramFiller2DProfileRebinable
TProfile2D filler with rebinable x-axis.
HistogramFillerRebinableAxis< HistogramFiller1D, Axis::X > HistogramFillerRebinable1D
Rebinable 1D histogram.
HistogramFiller2DGeneric< TProfile > HistogramFillerProfile
TProfile filler.
HistogramFillerRebinableAxis< HistogramFillerProfile, Axis::X > HistogramFillerProfileRebinable
TProfile filler with rebinable x-axis.
HistogramFiller2DGeneric< TH2 > HistogramFiller2D
std::string type
class name
bool kVec
add content to each bin from each element of a vector
bool kCumulative
fill bin of monitored object's value, and every bin below it
bool kRebinAxes
increase the axis range without adding new bins
bool kAddBinsDynamically
add new bins outside the existing range
bool kVecUO
add content to each bin from vector, including overflow/underflow

◆ createHistogramProvider()

std::shared_ptr< IHistogramProvider > HistogramFillerFactory::createHistogramProvider ( const HistogramDef & def)
private

Definition at line 65 of file HistogramFillerFactory.cxx.

65 {
66 std::shared_ptr<IHistogramProvider> result;
67
69 result.reset(new OfflineHistogramProvider(m_gmTool, m_factory, def));
70 } else if (def.kLBNHistoryDepth) {
71 result.reset(new LumiblockHistogramProvider(m_gmTool, m_factory, def));
72 } else if (def.kLive) {
73 result.reset(new LiveHistogramProvider(m_gmTool, m_factory, def));
74 } else {
75 result.reset(new StaticHistogramProvider(m_factory, def));
76 }
77
78 return result;
79}
@ Offline
monitoring data offline
int kLBNHistoryDepth
length of lb history
int kLive
fill only the last N lumiblocks in y_vs_lb plots
RunMode runmode
online or offline

Member Data Documentation

◆ m_factory

std::shared_ptr<HistogramFactory> Monitored::HistogramFillerFactory::m_factory
private

Definition at line 52 of file HistogramFillerFactory.h.

◆ m_gmTool

GenericMonitoringTool* Monitored::HistogramFillerFactory::m_gmTool
private

Definition at line 51 of file HistogramFillerFactory.h.


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