ATLAS Offline Software
HistogramDefinitionSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // HistogramDefinitionSvc.h
7 //
8 // Created by sroe on 07/07/2015.
9 //
10 
11 #ifndef HistogramDefinitionSvc_h
12 #define HistogramDefinitionSvc_h
13 
16 #include <map>
18 #include <memory>
19 
20 class IReadHistoDef;
21 class ISvcLocator;
22 class StatusCode;
23 class InterfaceID;
24 
25 
26 class HistogramDefinitionSvc : public extends<AthService, IHistogramDefinitionSvc> {
27 public:
28  HistogramDefinitionSvc(const std::string &name, ISvcLocator * svc);
30  //@name Service methods, reimplemented
32  virtual StatusCode initialize();
33  virtual StatusCode finalize();
35  SingleHistogramDefinition definition(const std::string &name, const std::string & dirName="") const final;
36  std::string histoType(const std::string &name, const std::string & dirName="") const final;
37  std::string title(const std::string &name, const std::string &dirName="") const final;
38  unsigned int nBinsX(const std::string &name, const std::string &dirName="") const final;
39  unsigned int nBinsY(const std::string &name, const std::string &dirName="") const final;
40  unsigned int nBinsZ(const std::string &name, const std::string &dirName="") const final;
41  IHistogramDefinitionSvc::axesLimits_t xLimits(const std::string &name, const std::string &dirName="") const final;
42  IHistogramDefinitionSvc::axesLimits_t yLimits(const std::string &name, const std::string &dirName="") const final;
43  IHistogramDefinitionSvc::axesLimits_t zLimits(const std::string &name, const std::string &dirName="") const final;
44  std::string xTitle(const std::string &name, const std::string &dirName="") const final;
45  std::string yTitle(const std::string &name, const std::string &dirName="") const final;
46  std::string zTitle(const std::string &name, const std::string &dirName="") const final;
47 
48 private:
49  StringProperty m_source;
50  StringProperty m_formatString;
52  std::map<std::string, SingleHistogramDefinition> m_histoDefMap;
53  std::unique_ptr<IReadHistoDef> m_reader;
54  bool sourceExists();
55  bool formatOk();
56 
57 };
58 #endif /* defined(HistogramDefinitionSvc_h) */
HistogramDefinitionSvc::title
std::string title(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:108
SingleHistogramDefinition.h
HistogramDefinitionSvc::xLimits
IHistogramDefinitionSvc::axesLimits_t xLimits(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:152
HistogramDefinitionSvc::formatOk
bool formatOk()
Definition: HistogramDefinitionSvc.cxx:221
IReadHistoDef
Definition: IReadHistoDef.h:16
HistogramDefinitionSvc::zTitle
std::string zTitle(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:206
HistogramDefinitionSvc::finalize
virtual StatusCode finalize()
Definition: HistogramDefinitionSvc.cxx:80
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
HistogramDefinitionSvc::m_histoDefMap
std::map< std::string, SingleHistogramDefinition > m_histoDefMap
Definition: HistogramDefinitionSvc.h:52
HistogramDefinitionSvc::yTitle
std::string yTitle(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:196
HistogramDefinitionSvc::HistogramDefinitionSvc
HistogramDefinitionSvc(const std::string &name, ISvcLocator *svc)
Definition: HistogramDefinitionSvc.cxx:25
HistogramDefinitionSvc::initialize
virtual StatusCode initialize()
Definition: HistogramDefinitionSvc.cxx:34
HistogramDefinitionSvc::nBinsY
unsigned int nBinsY(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:130
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HistogramDefinitionSvc::zLimits
IHistogramDefinitionSvc::axesLimits_t zLimits(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:174
HistogramDefinitionSvc::m_format
IHistogramDefinitionSvc::Formats m_format
Definition: HistogramDefinitionSvc.h:51
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
HistogramDefinitionSvc
Definition: HistogramDefinitionSvc.h:26
SingleHistogramDefinition
Almost-a-struct for holding the single histogram definition.
Definition: SingleHistogramDefinition.h:17
HistogramDefinitionSvc::nBinsZ
unsigned int nBinsZ(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:141
HistogramDefinitionSvc::nBinsX
unsigned int nBinsX(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:119
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
HistogramDefinitionSvc::~HistogramDefinitionSvc
virtual ~HistogramDefinitionSvc()
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HistogramDefinitionSvc::m_formatString
StringProperty m_formatString
Definition: HistogramDefinitionSvc.h:50
HistogramDefinitionSvc::sourceExists
bool sourceExists()
Definition: HistogramDefinitionSvc.cxx:216
IHistogramDefinitionSvc.h
HistogramDefinitionSvc::histoType
std::string histoType(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:97
HistogramDefinitionSvc::definition
SingleHistogramDefinition definition(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:86
AthService.h
HistogramDefinitionSvc::m_source
StringProperty m_source
Definition: HistogramDefinitionSvc.h:49
HistogramDefinitionSvc::xTitle
std::string xTitle(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:185
HistogramDefinitionSvc::yLimits
IHistogramDefinitionSvc::axesLimits_t yLimits(const std::string &name, const std::string &dirName="") const final
Definition: HistogramDefinitionSvc.cxx:163
IHistogramDefinitionSvc
Interface class to get the histogram definition for a named histogram in a given directory.
Definition: IHistogramDefinitionSvc.h:20
HistogramDefinitionSvc::m_reader
std::unique_ptr< IReadHistoDef > m_reader
Definition: HistogramDefinitionSvc.h:53