ATLAS Offline Software
egammaMonToolBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 //
7 // 2014-06-28 Author: Remi Lafaye (Annecy)
8 //
10 
11 #ifndef egammaMonToolBase_H
12 #define egammaMonToolBase_H
13 
14 #include <vector>
15 #include "TProfile.h"
18 #include "TString.h"
19 
20 class TH1;
21 class TH2;
22 class TString;
23 class TProfile;
24 class StoreGateSvc;
25 
27  std::string m_nameOfEgammaType {};
28 
29  // Global panel histograms
30  TH1 *m_hN {}; // Histogram for number of egammas
31  TH1 *m_hEt {}; // Histogram for egamma transverse energies
32  TH1 *m_hEta {}; // Histogram for egamma eta
33  TH1 *m_hPhi {}; // Histogram for egamma phi
34  TH2 *m_hEtaPhi {}; // Histogram for egamma eta,phi
35  TH2 *m_hEtaPhi4GeV {}; // Histogram for egamma eta,phi (only candidates with a pt greater than 4 GeV)
36  TH2 *m_hEtaPhi20GeV {}; // Histogram for egamma eta,phi (only candidates with a pt greater than 20 GeV)
37  TH1 *m_hTopoEtCone40 {}; // Histogram for egamma isolation energy TopoEtcone40
38  TH1 *m_hPtCone20 {}; // Histogram for egamma isolation energy PtCone20
39  TH1 *m_hTime {}; // Histogram for egamma cluster time
40 
41  // egamma ID per region histograms
42  std::vector<TH1*> m_hvEhad1 {};
43  std::vector<TH1*> m_hvCoreEM {};
44  std::vector<TH1*> m_hvF0 {};
45  std::vector<TH1*> m_hvF1 {};
46  std::vector<TH1*> m_hvF2 {};
47  std::vector<TH1*> m_hvF3 {};
48  std::vector<TH1*> m_hvRe233e237 {};
49  std::vector<TH1*> m_hvRe237e277 {};
50 
51  // egamma per region histograms
52  std::vector<TH1*> m_hvN {}; // Histograms for number of egammas
53  std::vector<TH1*> m_hvEt {}; // Histograms for egamma transverse energies
54  std::vector<TH1*> m_hvEta {}; // Histograms for egamma transverse eta
55  std::vector<TH1*> m_hvPhi {}; // Histograms for egamma transverse phi
56  std::vector<TH1*> m_hvTopoEtCone40 {}; // Histograms for egamma calo-based isolation transverse energies
57  std::vector<TH1*> m_hvPtCone20 {}; // Histograms for egamma track-based isolation transverse energies
58  std::vector<TH1*> m_hvTime {}; // Histograms for egamma times
59 
60  // Monitoring per lumiblock
61  unsigned int m_lumiBlockNumber {};
62 
63  TH1 *m_hLB_N {}; // Histogram for number of egamma vs LB
64 
65  egammaBaseHist(std::string name)
66  : m_nameOfEgammaType (std::move(name))
67  {
68  }
69 };
70 
72 {
73  public:
74 
75  egammaMonToolBase(const std::string& type, const std::string& name, const IInterface* parent);
76 
77  virtual ~egammaMonToolBase();
78 
79  virtual StatusCode initialize() override;
80  virtual StatusCode bookHistograms() override;
81  virtual StatusCode fillHistograms() override;
82  virtual StatusCode procHistograms() override;
83 
84  protected:
85 
86  enum { BARREL=0, CRACK, ENDCAP, FORWARD, NREGION };
87 
88  bool hasBadLar();
89  static int GetRegion(float eta);
90  static int GetForwardRegion(float eta);
91  void bookTH1F(TH1* &h, MonGroup& mygroup, const std::string& hname, const std::string& htitle, int nbins, float low, float high);
92  void bookTH1F(TH1* &h, MonGroup& mygroup, const std::string& hname_prefix, const std::string& htitle_prefix, int nbins, float low, float high, std::string &nameOfEgammaType);
93  void bookTH2F(TH2* &h, MonGroup& mygroup, const std::string& hname, const std::string& htitle, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh);
94  void bookTH2F(TH2* &h, MonGroup& mygroup, const std::string& hname_prefix, const std::string& htitle_prefix, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, std::string &nameOfEgammaType);
95  void bookTProfile(TProfile* &h, MonGroup& mygroup, const std::string& hname, const std::string& htitle, int nbins, float xlow, float xhigh, float ylow, float yhigh);
96  void bookTH1FperRegion(std::vector<TH1*> &vhist, MonGroup& mygroup, const std::string& hname, const std::string& htitle, int nbins, float low, float high, unsigned int min_region, unsigned int max_region);
97  void bookTH1FperRegion(std::vector<TH1*> &vhist, MonGroup& mygroup, const std::string& hname_prefix, const std::string& htitle, int nbins, float low, float high, unsigned int min_region, unsigned int max_region, std::string &nameOfEgammaType);
98  void bookTH2FperRegion(std::vector<TH2*> &vhist, MonGroup& mygroup, const std::string& hname, const std::string& htitle, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, unsigned int min_region, unsigned int max_region);
99  void bookTH2FperRegion(std::vector<TH2*> &vhist, MonGroup& mygroup, const std::string& hname_prefix, const std::string& htitle_prefix, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, unsigned int min_region, unsigned int max_region, std::string &nameOfEgammaType);
100  static void fillTH1FperRegion(std::vector<TH1*> &vhist, unsigned int ir, float x);
101  static void fillTH2FperRegion(std::vector<TH2*> &vhist, unsigned int ir, float x, float y);
102  void fillEfficiencies(TH1* h, TH1* href);
103  bool hasGoodTrigger(const std::string& comment);
104  unsigned int getCurrentLB();
105 
106  std::vector<std::string> m_Trigger; // generic Trigger Name
107  ToolHandle<Trig::TrigDecisionTool> m_trigdec; // Trigger Decision Tool Handle
108  bool m_UseTrigger; // Use Trigger ?
109 
110  std::string m_GroupExtension;
111 
112  unsigned int m_currentLB;
113  SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"};
114 
115  private:
116  std::vector<std::string> m_region;
117 };
118 
119 #endif
egammaBaseHist::m_hvN
std::vector< TH1 * > m_hvN
Definition: egammaMonToolBase.h:52
egammaBaseHist::m_hvF1
std::vector< TH1 * > m_hvF1
Definition: egammaMonToolBase.h:45
egammaMonToolBase::procHistograms
virtual StatusCode procHistograms() override
An inheriting class should either override this function or finalHists().
Definition: egammaMonToolBase.cxx:249
egammaMonToolBase::~egammaMonToolBase
virtual ~egammaMonToolBase()
Definition: egammaMonToolBase.cxx:55
egammaMonToolBase::bookTProfile
void bookTProfile(TProfile *&h, MonGroup &mygroup, const std::string &hname, const std::string &htitle, int nbins, float xlow, float xhigh, float ylow, float yhigh)
Definition: egammaMonToolBase.cxx:126
egammaMonToolBase::m_Trigger
std::vector< std::string > m_Trigger
Definition: egammaMonToolBase.h:106
egammaMonToolBase::fillEfficiencies
void fillEfficiencies(TH1 *h, TH1 *href)
Definition: egammaMonToolBase.cxx:258
egammaMonToolBase::initialize
virtual StatusCode initialize() override
Definition: egammaMonToolBase.cxx:60
egammaBaseHist::m_hvRe233e237
std::vector< TH1 * > m_hvRe233e237
Definition: egammaMonToolBase.h:48
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:73
dqt_zlumi_pandas.hname
string hname
Definition: dqt_zlumi_pandas.py:279
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
egammaBaseHist::m_hN
TH1 * m_hN
Definition: egammaMonToolBase.h:30
egammaBaseHist::m_hEt
TH1 * m_hEt
Definition: egammaMonToolBase.h:31
egammaBaseHist::m_hEtaPhi
TH2 * m_hEtaPhi
Definition: egammaMonToolBase.h:34
egammaMonToolBase::NREGION
@ NREGION
Definition: egammaMonToolBase.h:86
TrigDecisionTool.h
egammaBaseHist::m_hEta
TH1 * m_hEta
Definition: egammaMonToolBase.h:32
egammaMonToolBase::bookTH2FperRegion
void bookTH2FperRegion(std::vector< TH2 * > &vhist, MonGroup &mygroup, const std::string &hname, const std::string &htitle, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh, unsigned int min_region, unsigned int max_region)
Definition: egammaMonToolBase.cxx:155
egammaMonToolBase::bookTH1F
void bookTH1F(TH1 *&h, MonGroup &mygroup, const std::string &hname, const std::string &htitle, int nbins, float low, float high)
Definition: egammaMonToolBase.cxx:100
egammaMonToolBase::fillTH1FperRegion
static void fillTH1FperRegion(std::vector< TH1 * > &vhist, unsigned int ir, float x)
Definition: egammaMonToolBase.cxx:178
egammaMonToolBase::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: egammaMonToolBase.h:113
SG::ReadHandleKey< xAOD::EventInfo >
x
#define x
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
egammaMonToolBase::bookTH1FperRegion
void bookTH1FperRegion(std::vector< TH1 * > &vhist, MonGroup &mygroup, const std::string &hname, const std::string &htitle, int nbins, float low, float high, unsigned int min_region, unsigned int max_region)
Definition: egammaMonToolBase.cxx:132
egammaBaseHist::m_hvEhad1
std::vector< TH1 * > m_hvEhad1
Definition: egammaMonToolBase.h:42
egammaMonToolBase::fillTH2FperRegion
static void fillTH2FperRegion(std::vector< TH2 * > &vhist, unsigned int ir, float x, float y)
Definition: egammaMonToolBase.cxx:186
ManagedMonitorToolBase.h
egammaMonToolBase
Definition: egammaMonToolBase.h:72
egammaMonToolBase::bookHistograms
virtual StatusCode bookHistograms() override
An inheriting class should either override this function or bookHists().
Definition: egammaMonToolBase.cxx:93
egammaMonToolBase::ENDCAP
@ ENDCAP
Definition: egammaMonToolBase.h:86
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
egammaMonToolBase::GetRegion
static int GetRegion(float eta)
Definition: egammaMonToolBase.cxx:201
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
egammaBaseHist::m_hPtCone20
TH1 * m_hPtCone20
Definition: egammaMonToolBase.h:38
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
egammaBaseHist::m_hTime
TH1 * m_hTime
Definition: egammaMonToolBase.h:39
egammaBaseHist::m_hPhi
TH1 * m_hPhi
Definition: egammaMonToolBase.h:33
egammaBaseHist::m_hvF2
std::vector< TH1 * > m_hvF2
Definition: egammaMonToolBase.h:46
egammaMonToolBase::m_GroupExtension
std::string m_GroupExtension
Definition: egammaMonToolBase.h:110
test_pyathena.parent
parent
Definition: test_pyathena.py:15
egammaBaseHist::m_hvEta
std::vector< TH1 * > m_hvEta
Definition: egammaMonToolBase.h:54
egammaBaseHist::m_hvEt
std::vector< TH1 * > m_hvEt
Definition: egammaMonToolBase.h:53
egammaBaseHist::m_hLB_N
TH1 * m_hLB_N
Definition: egammaMonToolBase.h:63
egammaBaseHist::egammaBaseHist
egammaBaseHist(std::string name)
Definition: egammaMonToolBase.h:65
egammaBaseHist::m_hEtaPhi20GeV
TH2 * m_hEtaPhi20GeV
Definition: egammaMonToolBase.h:36
egammaBaseHist::m_hvF3
std::vector< TH1 * > m_hvF3
Definition: egammaMonToolBase.h:47
CaloCondBlobAlgs_fillNoiseFromASCII.comment
string comment
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:27
egammaBaseHist::m_hvTime
std::vector< TH1 * > m_hvTime
Definition: egammaMonToolBase.h:58
egammaBaseHist::m_hvRe237e277
std::vector< TH1 * > m_hvRe237e277
Definition: egammaMonToolBase.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
egammaMonToolBase::m_trigdec
ToolHandle< Trig::TrigDecisionTool > m_trigdec
Definition: egammaMonToolBase.h:107
egammaMonToolBase::FORWARD
@ FORWARD
Definition: egammaMonToolBase.h:86
egammaBaseHist::m_hvPhi
std::vector< TH1 * > m_hvPhi
Definition: egammaMonToolBase.h:55
egammaBaseHist::m_lumiBlockNumber
unsigned int m_lumiBlockNumber
Definition: egammaMonToolBase.h:61
egammaMonToolBase::fillHistograms
virtual StatusCode fillHistograms() override
An inheriting class should either override this function or fillHists().
Definition: egammaMonToolBase.cxx:214
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
egammaMonToolBase::CRACK
@ CRACK
Definition: egammaMonToolBase.h:86
y
#define y
h
egammaMonToolBase::egammaMonToolBase
egammaMonToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: egammaMonToolBase.cxx:29
egammaMonToolBase::m_UseTrigger
bool m_UseTrigger
Definition: egammaMonToolBase.h:108
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
egammaBaseHist::m_hEtaPhi4GeV
TH2 * m_hEtaPhi4GeV
Definition: egammaMonToolBase.h:35
egammaBaseHist::m_hvTopoEtCone40
std::vector< TH1 * > m_hvTopoEtCone40
Definition: egammaMonToolBase.h:56
egammaMonToolBase::m_currentLB
unsigned int m_currentLB
Definition: egammaMonToolBase.h:112
egammaMonToolBase::BARREL
@ BARREL
Definition: egammaMonToolBase.h:86
egammaBaseHist::m_hvPtCone20
std::vector< TH1 * > m_hvPtCone20
Definition: egammaMonToolBase.h:57
egammaMonToolBase::m_region
std::vector< std::string > m_region
Definition: egammaMonToolBase.h:116
egammaMonToolBase::getCurrentLB
unsigned int getCurrentLB()
Definition: egammaMonToolBase.cxx:82
egammaMonToolBase::hasBadLar
bool hasBadLar()
Definition: egammaMonToolBase.cxx:222
egammaMonToolBase::bookTH2F
void bookTH2F(TH2 *&h, MonGroup &mygroup, const std::string &hname, const std::string &htitle, int nbinsx, float xlow, float xhigh, int nbinsy, float ylow, float yhigh)
Definition: egammaMonToolBase.cxx:113
egammaBaseHist::m_hTopoEtCone40
TH1 * m_hTopoEtCone40
Definition: egammaMonToolBase.h:37
egammaMonToolBase::hasGoodTrigger
bool hasGoodTrigger(const std::string &comment)
Definition: egammaMonToolBase.cxx:288
egammaBaseHist
Definition: egammaMonToolBase.h:26
egammaBaseHist::m_hvCoreEM
std::vector< TH1 * > m_hvCoreEM
Definition: egammaMonToolBase.h:43
egammaBaseHist::m_hvF0
std::vector< TH1 * > m_hvF0
Definition: egammaMonToolBase.h:44
egammaMonToolBase::GetForwardRegion
static int GetForwardRegion(float eta)
Definition: egammaMonToolBase.cxx:194
egammaBaseHist::m_nameOfEgammaType
std::string m_nameOfEgammaType
Definition: egammaMonToolBase.h:27