ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
virtual ~HistogramFillerFactory ()
 Virtual destructor. More...
 
HistogramFillercreate (const HistogramDef &def)
 Creates HistogramFiller instance for given definition. More...
 

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(std::move(gmTool)),
32  m_factory(new HistogramFactory(gmTool->histogramService(), std::move(groupName))) {}

◆ ~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 26 of file HistogramFillerFactory.cxx.

26  {
27  std::shared_ptr<IHistogramProvider> histogramProvider = createHistogramProvider(def);
28 
29  if (CxxUtils::starts_with(def.type, "TH1")) {
30  if (def.kCumulative) {
31  return new CumulativeHistogramFiller1D(def, histogramProvider);
32  } else if (def.kAddBinsDynamically || def.kRebinAxes) {
33  return new HistogramFillerRebinable1D(def, histogramProvider);
34  } else if (def.kVec || def.kVecUO) {
35  return new VecHistogramFiller1D(def, histogramProvider);
36  } else {
37  return new HistogramFiller1D(def, histogramProvider);
38  }
39  } else if (CxxUtils::starts_with(def.type, "TH2")) {
40  if (def.kAddBinsDynamically || def.kRebinAxes) {
41  return new HistogramFillerRebinable2D(def, histogramProvider);
42  } else {
43  return new HistogramFiller2D(def, histogramProvider);
44  }
45  } else if (def.type == "TProfile") {
46  if (def.kAddBinsDynamically || def.kRebinAxes) {
47  return new HistogramFillerProfileRebinable(def, histogramProvider);
48  } else {
49  return new HistogramFillerProfile(def, histogramProvider);
50  }
51  } else if (def.type == "TProfile2D") {
52  if (def.kAddBinsDynamically || def.kRebinAxes) {
53  return new HistogramFiller2DProfileRebinable(def, histogramProvider);
54  } else {
55  return new HistogramFiller2DProfile(def, histogramProvider);
56  }
57  } else if (def.type == "TEfficiency") {
58  return new HistogramFillerEfficiency(def, histogramProvider);
59  } else if (def.type == "TTree") {
60  return new HistogramFillerTree(def, histogramProvider);
61  }
62 
63  return nullptr;
64 }

◆ createHistogramProvider()

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

Definition at line 66 of file HistogramFillerFactory.cxx.

66  {
67  std::shared_ptr<IHistogramProvider> result;
68 
71  } else if (def.kLBNHistoryDepth) {
73  } else if (def.kLive) {
75  } else {
76  result.reset(new StaticHistogramProvider(m_factory, def));
77  }
78 
79  return result;
80 }

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:
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
get_generator_info.result
result
Definition: get_generator_info.py:21
Monitored::HistogramDef::kAddBinsDynamically
bool kAddBinsDynamically
add new bins outside the existing range
Definition: HistogramDef.h:45
Monitored::VecHistogramFiller1D
Definition: VecHistogramFiller1D.h:11
Monitored::LumiblockHistogramProvider
Implementation of IHistogramProvider for lumi block based histograms.
Definition: LumiblockHistogramProvider.h:25
RunTileMonitoring.groupName
groupName
Definition: RunTileMonitoring.py:158
Monitored::HistogramFillerProfile
HistogramFiller2DGeneric< TProfile > HistogramFillerProfile
TProfile filler.
Definition: HistogramFillerProfile.h:17
Monitored::HistogramFiller1D
Filler for plain 1D histograms.
Definition: HistogramFiller1D.h:21
Monitored::HistogramFillerTree
Filler for TTrees.
Definition: HistogramFillerTree.h:22
Monitored::LiveHistogramProvider
Provides latest-N-lumiblock histograms to be filled.
Definition: LiveHistogramProvider.h:24
Monitored::HistogramFiller2DProfile
Filler for profile 2D histogram.
Definition: HistogramFiller2DProfile.h:17
Monitored::HistogramFillerEfficiency
Filler for TEfficiency graphs.
Definition: HistogramFillerEfficiency.h:17
Monitored::CumulativeHistogramFiller1D
Filler for 1D histograms filled in cummulative mode.
Definition: CumulativeHistogramFiller1D.h:14
Monitored::HistogramDef::kVec
bool kVec
add content to each bin from each element of a vector
Definition: HistogramDef.h:48
Monitored::StaticHistogramProvider
Default implementation of IHistogramProvider interface.
Definition: StaticHistogramProvider.h:23
Monitored::HistogramFillerProfileRebinable
HistogramFillerRebinableAxis< HistogramFillerProfile, Axis::X > HistogramFillerProfileRebinable
TProfile filler with rebinable x-axis.
Definition: HistogramFillerProfile.h:19
Monitored::HistogramFillerFactory::createHistogramProvider
std::shared_ptr< IHistogramProvider > createHistogramProvider(const HistogramDef &def)
Definition: HistogramFillerFactory.cxx:66
Monitored::HistogramFillerFactory::m_gmTool
GenericMonitoringTool * m_gmTool
Definition: HistogramFillerFactory.h:51
Monitored::HistogramDef::kRebinAxes
bool kRebinAxes
increase the axis range without adding new bins
Definition: HistogramDef.h:46
Monitored::HistogramFiller2D
HistogramFiller2DGeneric< TH2 > HistogramFiller2D
Definition: HistogramFiller2D.h:80
Monitored::HistogramDef::runmode
RunMode runmode
online or offline
Definition: HistogramDef.h:40
Monitored::HistogramDef::kVecUO
bool kVecUO
add content to each bin from vector, including overflow/underflow
Definition: HistogramDef.h:49
GenericMonitoringTool::histogramService
virtual const ServiceHandle< ITHistSvc > & histogramService() const
Definition: GenericMonitoringTool.h:72
Monitored::HistogramDef::type
std::string type
class name
Definition: HistogramDef.h:18
Monitored::OfflineHistogramProvider
Implementation of IHistogramProvider for offline histograms.
Definition: OfflineHistogramProvider.h:29
Monitored::HistogramFillerFactory::m_factory
std::shared_ptr< HistogramFactory > m_factory
Definition: HistogramFillerFactory.h:52
Monitored::HistogramDef::RunMode::Offline
@ Offline
monitoring data offline
Monitored::HistogramDef::kLive
int kLive
fill only the last N lumiblocks in y_vs_lb plots
Definition: HistogramDef.h:51
Monitored::HistogramDef::kCumulative
bool kCumulative
fill bin of monitored object's value, and every bin below it
Definition: HistogramDef.h:50
Monitored::HistogramFillerRebinable2D
HistogramFillerRebinableAxis< HistogramFillerRebinable2DX, Axis::Y > HistogramFillerRebinable2D
Rebinable 2D histogram (both axes)
Definition: HistogramFillerRebinable.h:78
Monitored::HistogramFiller2DProfileRebinable
HistogramFillerRebinableAxis< HistogramFiller2DProfile, Axis::X > HistogramFiller2DProfileRebinable
TProfile2D filler with rebinable x-axis.
Definition: HistogramFiller2DProfile.h:58
Monitored::HistogramDef::kLBNHistoryDepth
int kLBNHistoryDepth
length of lb history
Definition: HistogramDef.h:44
Monitored::HistogramFillerRebinable1D
HistogramFillerRebinableAxis< HistogramFiller1D, Axis::X > HistogramFillerRebinable1D
Rebinable 1D histogram.
Definition: HistogramFillerRebinable.h:72