ATLAS Offline Software
HistoDefinitionTool.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef JETMONITORING_HISTODEFINITIONTOOL_H
8 #define JETMONITORING_HISTODEFINITIONTOOL_H
9 
19 #include <vector>
20 #include <string>
21 #include "AsgTools/AsgTool.h"
22 
23 class TH1F;
24 class TH2F;
25 class TProfile;
26 class TProfile2D;
27 
28 // temporary, we should define a proper interface
29 static const InterfaceID IID_HistoDefinitionTool("HistoDefinitionTool", 1, 0);
30 
32 
34 
35  public:
36 
37 
38  HistoDefinitionTool(const std::string & t);
40 
41 
42  virtual StatusCode initialize() ;
43 
44  const std::string& attributeName(){return m_attname;}
45 
46 
48  TH1F* buildTH1F();
49  TH2F* buildTH2F();
50  TProfile* buildTProfile(bool useYLimits=false);
51 
52  // for convenience a templated method doing the same as above:
53  template<typename T>
54  T* build(){return NULL;}
55 
56 
57  static const InterfaceID& interfaceID( ){return IID_HistoDefinitionTool;}
58 
59 protected:
60 
61  std::string m_attname;
62  std::string m_htitle;
63 
64  int m_nbinsx = 10;
65  float m_xlow = 0.0;
66  float m_xup = 1.0;
67 
68  int m_nbinsy = 10;
69  float m_ylow = 0.0;
70  float m_yup = 1.0;
71 
72 };
73 
74 template<> TH1F* HistoDefinitionTool::build<TH1F>();
75 template<> TH2F* HistoDefinitionTool::build<TH2F>();
76 template<> TProfile* HistoDefinitionTool::build<TProfile>();
77 
78 
79 #endif
HistoDefinitionTool::interfaceID
static const InterfaceID & interfaceID()
Definition: HistoDefinitionTool.h:57
HistoDefinitionTool::~HistoDefinitionTool
~HistoDefinitionTool()
Definition: HistoDefinitionTool.h:39
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
HistoDefinitionTool::m_xup
float m_xup
Definition: HistoDefinitionTool.h:66
HistoDefinitionTool::buildTProfile
TProfile * buildTProfile(bool useYLimits=false)
Definition: HistoDefinitionTool.cxx:54
HistoDefinitionTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: HistoDefinitionTool.cxx:32
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HistoDefinitionTool::attributeName
const std::string & attributeName()
Definition: HistoDefinitionTool.h:44
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
HistoDefinitionTool::m_yup
float m_yup
Definition: HistoDefinitionTool.h:70
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
HistoDefinitionTool::m_ylow
float m_ylow
Definition: HistoDefinitionTool.h:69
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HistoDefinitionTool::HistoDefinitionTool
HistoDefinitionTool(const std::string &t)
Definition: HistoDefinitionTool.cxx:11
HistoDefinitionTool::buildTH2F
TH2F * buildTH2F()
Definition: HistoDefinitionTool.cxx:50
HistoDefinitionTool::m_xlow
float m_xlow
Definition: HistoDefinitionTool.h:65
HistoDefinitionTool::m_htitle
std::string m_htitle
Definition: HistoDefinitionTool.h:62
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
HistoDefinitionTool::m_nbinsx
int m_nbinsx
Definition: HistoDefinitionTool.h:64
HistoDefinitionTool::build
T * build()
Definition: HistoDefinitionTool.h:54
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
HistoDefinitionTool::buildTH1F
TH1F * buildTH1F()
Build histos according to properties.
Definition: HistoDefinitionTool.cxx:46
AsgTool.h
HistoDefinitionTool::m_attname
std::string m_attname
Definition: HistoDefinitionTool.h:61
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
HistoDefinitionTool
Definition: HistoDefinitionTool.h:31
HistoDefinitionTool::m_nbinsy
int m_nbinsy
Definition: HistoDefinitionTool.h:68