ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaMonitorBaseAlgorithm.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#ifndef TrigEgammaMonitorBaseAlgorithm_h
6#define TrigEgammaMonitorBaseAlgorithm_h
7
11
12
18
21#include "xAODEgamma/Egamma.h"
33
36#include "PATCore/AcceptInfo.h"
37#include "PATCore/AcceptData.h"
38
39
40// Trigger Information struct
41typedef struct _triginfo
42{
43 // L1 information
44 bool L1Legacy;
45 std::string L1Threshold; //EM22VHI
46 // HLT information
47 std::string trigger; //Trigger Name
48 std::string signature; //Electron or Photon
49 float etthr; // HLT Et threshold
50 // if trigger is etcut OR idperf, pidname should be default (usually lhloose)
51 std::string pidname; // Offline loose, medium, tight, etc...
52 // extra HLT information
53 bool idperf; // Performance chain
54 bool etcut; // Et cut only chain
55 bool nogsf; // GSF chain
56 bool lrt; // LRT chain
57 bool ion; // Heavy Ion chain
58
59 std::string isolation;
62
63
64
65
67
68 public:
69
70
71 TrigEgammaMonitorBaseAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
72
74
75 virtual StatusCode initialize() override;
76
77 virtual StatusCode fillHistograms(const EventContext& /*ctx*/) const override {return StatusCode::SUCCESS;};
78
79 private:
80
82 ToolHandle<Trig::TrigDecisionTool> m_trigdec;
84 std::map<std::string,TrigInfo> m_trigInfo;
85
86
87 protected:
88
89 /* Trigger e/g matching tool */
90 ToolHandle<TrigEgammaMatchingToolMT> m_matchTool;
91 /* Trigger e/g emulation tool */
92 ToolHandle<Trig::TrigEgammaEmulationToolMT> m_emulatorTool;
94 ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool{this,"ElectronIsEMSelector",{}};
96 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool{this,"ElectronLikelihoodTool",{}};
98 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronDNNTool{ this, "ElectronDNNSelectorTool", {},"DNN tools" };
100 ToolHandleArray<IAsgPhotonIsEMSelector> m_photonIsEMTool{this,"PhotonIsEMSelector",{}};
101
102
104 Gaudi::Property<bool> m_doEmulation{this, "DoEmulation", false };
105
106 Gaudi::Property<bool> m_doEffwithLH{this, "ComputeEffLH", false};
107 Gaudi::Property<bool> m_doEffwithDNN{this, "ComputeEffDNN", false};
108
110 Gaudi::Property<bool> m_tp{this, "TPTrigger", false };
112 Gaudi::Property<std::string> m_defaultProbePidElectron{this, "DefaultProbeSelectionElectron", "lhloose"};
114 Gaudi::Property<std::string> m_defaultProbePidPhoton{this, "DefaultProbeSelectionPhoton", "loose"};
116 Gaudi::Property<std::vector<std::string>> m_isemname{this, "isEMResultNames", {} };
118 Gaudi::Property<std::vector<std::string>> m_lhname{this, "LHResultNames", {} };
120 Gaudi::Property<std::vector<std::string>> m_dnnname {this, "DNNResultNames", {}, };
122 Gaudi::Property<bool> m_detailedHists{this, "DetailedHistograms", false};
123
124
126
128
130 const std::map<std::string,TrigInfo>& getTrigInfoMap() { return m_trigInfo; }
132 bool ApplyElectronPid(const xAOD::Electron *eg,const std::string&) const;
134 bool ApplyPhotonPid(const xAOD::Photon *eg,const std::string&) const;
136 const ToolHandle<Trig::TrigDecisionTool>& tdt() const {return m_trigdec;};
138 const ToolHandle<TrigEgammaMatchingToolMT>& match() const {return m_matchTool;}
140 asg::AcceptData setAccept(const TrigCompositeUtils::Decision*, const TrigInfo&, const bool) const;
142 TrigInfo getTrigInfo(const std::string&) const;
144 float dR(const float, const float, const float, const float) const;
146 std::string getL1Item(const std::string& trigger) const;
148 bool isIsolated(const xAOD::Electron*, const std::string&) const;
150 bool isPrescaled(const std::string&) const;
152 void setTrigInfo(const std::string&);
154 bool isHLTTruncated() const;
155
156
158
159
160
162 float getEta2(const xAOD::Egamma* eg) const;
163 float getEt(const xAOD::Electron* eg) const ;
164 float getEtCluster37(const xAOD::Egamma* eg) const;
165 float getDEmaxs1(const xAOD::Egamma *eg) const;
166 float rTRT (const xAOD::Electron* eg) const;
167 float getSigmaD0(const xAOD::Electron *eg) const;
168 float getD0sig(const xAOD::Electron *eg) const;
169 float getEnergyBE0(const xAOD::Egamma *eg) const;
170 float getEnergyBE1(const xAOD::Egamma *eg) const;
171 float getEnergyBE2(const xAOD::Egamma *eg) const;
172 float getEnergyBE3(const xAOD::Egamma *eg) const;
173 float getEaccordion(const xAOD::Egamma *eg) const;
174 float getE0Eaccordion(const xAOD::Egamma *eg) const;
175
176
177
178
179
180
181
182
183
185#define GETTER(_name_) float getShowerShape_##_name_(const xAOD::Egamma* eg) const;
186 GETTER(e011)
187 GETTER(e132)
188 GETTER(e237)
189 GETTER(e277)
190 GETTER(ethad)
191 GETTER(ethad1)
192 GETTER(weta1)
193 GETTER(weta2)
194 GETTER(f1)
195 GETTER(e2tsts1)
196 GETTER(emins1)
197 GETTER(emaxs1)
198 GETTER(wtots1)
199 GETTER(fracs1)
200 GETTER(Reta)
201 GETTER(Rphi)
202 GETTER(f3)
203 GETTER(f3core)
204 GETTER(Eratio)
205 GETTER(Rhad)
206 GETTER(Rhad1)
207 GETTER(DeltaE)
208#undef GETTER
209
210
211 // GETTER for Isolation monitoring
212#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Electron* eg) const;
213 GETTER(ptcone20)
214 GETTER(ptcone30)
215 GETTER(ptcone40)
216 GETTER(ptvarcone20)
217 GETTER(ptvarcone30)
218 GETTER(ptvarcone40)
219#undef GETTER
220#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Egamma* eg) const;
221 GETTER(ptcone20)
222 GETTER(etcone20)
223 GETTER(etcone30)
224 GETTER(etcone40)
225 GETTER(topoetcone20)
226 GETTER(topoetcone30)
227 GETTER(topoetcone40)
228#undef GETTER
229 // GETTERs for CaloCluster monitoring
230#define GETTER(_name_) float getCluster_##_name_(const xAOD::Egamma* eg) const;
231 GETTER(et)
232 GETTER(phi)
233 GETTER(eta)
234#undef GETTER
235
236 // GETTERs for Track monitoring
237#define GETTER(_name_) float getTrack_##_name_(const xAOD::Electron* eg) const;
238 GETTER(pt)
239 GETTER(phi)
240 GETTER(eta)
241 GETTER(d0)
242 GETTER(z0)
243#undef GETTER
244
245
246 // GETTERs for Track details monitoring
247#define GETTER(_name_) float getTrackSummary_##_name_(const xAOD::Electron* eg) const;
248 GETTER(numberOfInnermostPixelLayerHits)
249 GETTER(numberOfInnermostPixelLayerOutliers)
250 GETTER(numberOfPixelHits)
251 GETTER(numberOfPixelOutliers)
252 GETTER(numberOfSCTHits)
253 GETTER(numberOfSCTOutliers)
254 GETTER(numberOfTRTHits)
255 GETTER(numberOfTRTHighThresholdHits)
256 GETTER(numberOfTRTHighThresholdOutliers)
257 GETTER(numberOfTRTOutliers)
258 GETTER(expectInnermostPixelLayerHit)
259 GETTER(numberOfPixelDeadSensors)
260 GETTER(numberOfSCTDeadSensors)
261 GETTER(numberOfTRTXenonHits)
262#undef GETTER
263
264#define GETTER(_name_) float getTrackSummaryFloat_##_name_(const xAOD::Electron* eg) const;
265 GETTER(eProbabilityComb)
266 GETTER(eProbabilityHT)
267 GETTER(pixeldEdx)
268#undef GETTER
269
270 // GETTERs for Calo-Track monitoring
271#define GETTER(_name_) float getCaloTrackMatch_##_name_(const xAOD::Electron* eg) const;
272 GETTER(deltaEta0)
273 GETTER(deltaPhi0)
274 GETTER(deltaPhiRescaled0)
275 GETTER(deltaEta1)
276 GETTER(deltaPhi1)
277 GETTER(deltaPhiRescaled1)
278 GETTER(deltaEta2)
279 GETTER(deltaPhi2)
280 GETTER(deltaPhiRescaled2)
281 GETTER(deltaEta3)
282 GETTER(deltaPhi3)
283 GETTER(deltaPhiRescaled3)
284#undef GETTER
285
286};
287
288
289
290namespace Gaudi
291{
292 namespace Parsers
293 {
294 typedef std::map<std::string, std::string> Dict_t;
295
296 // A typedef may save a lot of mistakes
297 typedef std::vector<Dict_t> VecDict_t;
298
299 // Parse function... nothing special, but it must be done explicitely.
300 StatusCode parse( VecDict_t & result, const std::string& input );
301 }
302}
303
304
305#endif
306
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Property holding a SG store/key/clid from which a ReadHandle is made.
#define GETTER(_name_)
C Macros for plotting.
struct _triginfo TrigInfo
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
float getEnergyBE2(const xAOD::Egamma *eg) const
bool ApplyPhotonPid(const xAOD::Photon *eg, const std::string &) const
Get offline electron decision.
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronLHTool
Offline LH Selectors.
float getEnergyBE3(const xAOD::Egamma *eg) const
float getSigmaD0(const xAOD::Electron *eg) const
const std::map< std::string, TrigInfo > & getTrigInfoMap()
Helper methods.
std::map< std::string, TrigInfo > m_trigInfo
creates map of trigger name and TrigInfo struct
Gaudi::Property< std::vector< std::string > > m_isemname
isem names
float getEtCluster37(const xAOD::Egamma *eg) const
TrigEgammaMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
const ToolHandle< TrigEgammaMatchingToolMT > & match() const
Get the e/g match tool.
Gaudi::Property< std::string > m_defaultProbePidPhoton
default probe pid for photon trigitems that don't have pid in their name
float dR(const float, const float, const float, const float) const
Get delta R.
float getEnergyBE1(const xAOD::Egamma *eg) const
float getDEmaxs1(const xAOD::Egamma *eg) const
float rTRT(const xAOD::Electron *eg) const
Gaudi::Property< bool > m_detailedHists
Include more detailed histograms.
ToolHandle< TrigEgammaMatchingToolMT > m_matchTool
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Get the TDT.
float getE0Eaccordion(const xAOD::Egamma *eg) const
Gaudi::Property< std::string > m_defaultProbePidElectron
default probe pid for electron trigitems that don't have pid in their name
ToolHandleArray< IAsgPhotonIsEMSelector > m_photonIsEMTool
Offline isEM Photon Selectors.
ToolHandle< Trig::TrigDecisionTool > m_trigdec
Trigger decision tool.
Gaudi::Property< bool > m_doEmulation
Do emulation.
float getEt(const xAOD::Electron *eg) const
ToolHandleArray< IAsgElectronIsEMSelector > m_electronIsEMTool
Offline isEM Selectors.
Gaudi::Property< std::vector< std::string > > m_lhname
lh names
bool ApplyElectronPid(const xAOD::Electron *eg, const std::string &) const
Get offline electron decision.
asg::AcceptData setAccept(const TrigCompositeUtils::Decision *, const TrigInfo &, const bool) const
Set the accept object for all trigger levels.
bool isPrescaled(const std::string &) const
Check if the event is prescaled.
Gaudi::Property< bool > m_tp
TP Trigger Analysis.
virtual StatusCode initialize() override
initialize
TrigInfo getTrigInfo(const std::string &) const
Get the trigger info parsed from the chain name (only single lepton triggers)
virtual StatusCode fillHistograms(const EventContext &) const override
adds event to the monitoring histograms
bool isIsolated(const xAOD::Electron *, const std::string &) const
Check if electron fulfils isolation criteria.
void setTrigInfo(const std::string &)
Set the trigger info parsed from the chain name.
float getD0sig(const xAOD::Electron *eg) const
float getEta2(const xAOD::Egamma *eg) const
Features helper.
float getEaccordion(const xAOD::Egamma *eg) const
std::string getL1Item(const std::string &trigger) const
Creates static map to return L1 item from trigger name.
ToolHandle< Trig::TrigEgammaEmulationToolMT > m_emulatorTool
float getEnergyBE0(const xAOD::Egamma *eg) const
Gaudi::Property< std::vector< std::string > > m_dnnname
dnn names
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronDNNTool
Offline DNN Selectors.
std::map< std::string, std::string > Dict_t
std::vector< Dict_t > VecDict_t
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
=============================================================================
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".
Extra patterns decribing particle interation process.