ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaMonitorBaseAlgorithm.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TrigEgammaMonitorBaseAlgorithm_h
6#define TrigEgammaMonitorBaseAlgorithm_h
7
11
13
19
22#include "xAODEgamma/Egamma.h"
34
37#include "PATCore/AcceptInfo.h"
38#include "PATCore/AcceptData.h"
39
40
41// Trigger Information struct
42typedef struct _triginfo
43{
44 // L1 information
45 bool L1Legacy;
46 std::string L1Threshold; //EM22VHI
47 // HLT information
48 std::string trigger; //Trigger Name
49 std::string signature; //Electron or Photon
50 float etthr; // HLT Et threshold
51 // if trigger is etcut OR idperf, pidname should be default (usually lhloose)
52 std::string pidname; // Offline loose, medium, tight, etc...
53 // extra HLT information
54 bool idperf; // Performance chain
55 bool etcut; // Et cut only chain
56 bool nogsf; // GSF chain
57 bool lrt; // LRT chain
58 bool ion; // Heavy Ion chain
59
60 std::string isolation;
63
64
66
67 public:
68
69
70 TrigEgammaMonitorBaseAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
71
73
74 virtual StatusCode initialize() override;
75
76 virtual StatusCode fillHistograms(const EventContext& /*ctx*/) const override {return StatusCode::SUCCESS;};
77
78
79 std::vector<ChainNameParser::LegInfo>
80 getProbeTriggerLeg(const std::string& triggerName) const;
81
82 std::string getProbeInformation(const std::vector<ChainNameParser::LegInfo>& LegParts, const std::string& signature) const;
83
84 private:
85
87 ToolHandle<Trig::TrigDecisionTool> m_trigdec;
89 std::map<std::string,TrigInfo> m_trigInfo;
90 std::map<std::string,TrigInfo> m_trigInfoR3;
91
92
93 protected:
94
95 /* Trigger e/g matching tool */
96 ToolHandle<TrigEgammaMatchingToolMT> m_matchTool;
97 ToolHandle<Trig::IMatchingTool> m_matchTool_R3;
98
99 /* Trigger e/g emulation tool */
100 ToolHandle<Trig::TrigEgammaEmulationToolMT> m_emulatorTool;
102 ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool{this,"ElectronIsEMSelector",{}};
104 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool{this,"ElectronLikelihoodTool",{}};
106 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronDNNTool{ this, "ElectronDNNSelectorTool", {},"DNN tools" };
108 ToolHandleArray<IAsgPhotonIsEMSelector> m_photonIsEMTool{this,"PhotonIsEMSelector",{}};
109
110
112 Gaudi::Property<bool> m_doEmulation{this, "DoEmulation", false };
113
114 Gaudi::Property<bool> m_doEffwithLH{this, "ComputeEffLH", false};
115 Gaudi::Property<bool> m_doEffwithDNN{this, "ComputeEffDNN", false};
116
118 Gaudi::Property<bool> m_tp{this, "TPTrigger", false };
120 Gaudi::Property<std::string> m_defaultProbePidElectron{this, "DefaultProbeSelectionElectron", "lhloose"};
122 Gaudi::Property<std::string> m_defaultProbePidPhoton{this, "DefaultProbeSelectionPhoton", "loose"};
124 Gaudi::Property<std::vector<std::string>> m_isemname{this, "isEMResultNames", {} };
126 Gaudi::Property<std::vector<std::string>> m_lhname{this, "LHResultNames", {} };
128 Gaudi::Property<std::vector<std::string>> m_dnnname {this, "DNNResultNames", {}, };
130 Gaudi::Property<bool> m_detailedHists{this, "DetailedHistograms", false};
131
132
134
136
138 const std::map<std::string,TrigInfo>& getTrigInfoMap() const { return m_trigInfo; }
139 const std::map<std::string,TrigInfo>& getTrigInfoMapR3() const { return m_trigInfoR3; }
141 bool ApplyElectronPid(const EventContext& ctx, const xAOD::Electron *eg,const std::string&) const;
143 bool ApplyPhotonPid(const EventContext& ctx, const xAOD::Photon *eg,const std::string&) const;
145 const ToolHandle<Trig::TrigDecisionTool>& tdt() const {return m_trigdec;};
146
148 const ToolHandle<TrigEgammaMatchingToolMT>& match() const {return m_matchTool;}
149 const ToolHandle<Trig::IMatchingTool>& matchR3() const {return m_matchTool_R3;}
150
151
152
154 asg::AcceptData setAccept(const TrigCompositeUtils::Decision*, const TrigInfo&, const bool) const;
156 TrigInfo getTrigInfo(const std::string&) const;
157 TrigInfo getTrigInfoR3(const std::string&) const;
159 float dR(const float, const float, const float, const float) const;
161 std::string getL1Item(const std::string& trigger) const;
163 bool isIsolated(const xAOD::Electron*, const std::string&) const;
165 bool isPrescaled(const std::string&) const;
167 void setTrigInfo(const std::string&);
168 void setTrigInfoR3(const std::string&);
170 bool isHLTTruncated() const;
171
172
174
175
176
178 float getEta2(const xAOD::Egamma* eg) const;
179 float getEt(const xAOD::Electron* eg) const ;
180 float getEtCluster37(const xAOD::Egamma* eg) const;
181 float getDEmaxs1(const xAOD::Egamma *eg) const;
182 float rTRT (const xAOD::Electron* eg) const;
183 float getSigmaD0(const xAOD::Electron *eg) const;
184 float getD0sig(const xAOD::Electron *eg) const;
185 float getEnergyBE0(const xAOD::Egamma *eg) const;
186 float getEnergyBE1(const xAOD::Egamma *eg) const;
187 float getEnergyBE2(const xAOD::Egamma *eg) const;
188 float getEnergyBE3(const xAOD::Egamma *eg) const;
189 float getEaccordion(const xAOD::Egamma *eg) const;
190 float getE0Eaccordion(const xAOD::Egamma *eg) const;
191
192
193
194
195
196
197
198
199
201#define GETTER(_name_) float getShowerShape_##_name_(const xAOD::Egamma* eg) const;
202 GETTER(e011)
203 GETTER(e132)
204 GETTER(e237)
205 GETTER(e277)
206 GETTER(ethad)
207 GETTER(ethad1)
208 GETTER(weta1)
209 GETTER(weta2)
210 GETTER(f1)
211 GETTER(e2tsts1)
212 GETTER(emins1)
213 GETTER(emaxs1)
214 GETTER(wtots1)
215 GETTER(fracs1)
216 GETTER(Reta)
217 GETTER(Rphi)
218 GETTER(f3)
219 GETTER(f3core)
220 GETTER(Eratio)
221 GETTER(Rhad)
222 GETTER(Rhad1)
223 GETTER(DeltaE)
224#undef GETTER
225
226
227 // GETTER for Isolation monitoring
228#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Electron* eg) const;
229 GETTER(ptcone20)
230 GETTER(ptcone30)
231 GETTER(ptcone40)
232 GETTER(ptvarcone20)
233 GETTER(ptvarcone30)
234 GETTER(ptvarcone40)
235#undef GETTER
236#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Egamma* eg) const;
237 GETTER(ptcone20)
238 GETTER(etcone20)
239 GETTER(etcone30)
240 GETTER(etcone40)
241 GETTER(topoetcone20)
242 GETTER(topoetcone30)
243 GETTER(topoetcone40)
244#undef GETTER
245 // GETTERs for CaloCluster monitoring
246#define GETTER(_name_) float getCluster_##_name_(const xAOD::Egamma* eg) const;
247 GETTER(et)
248 GETTER(phi)
249 GETTER(eta)
250#undef GETTER
251
252 // GETTERs for Track monitoring
253#define GETTER(_name_) float getTrack_##_name_(const xAOD::Electron* eg) const;
254 GETTER(pt)
255 GETTER(phi)
256 GETTER(eta)
257 GETTER(d0)
258 GETTER(z0)
259#undef GETTER
260
261
262 // GETTERs for Track details monitoring
263#define GETTER(_name_) float getTrackSummary_##_name_(const xAOD::Electron* eg) const;
264 GETTER(numberOfInnermostPixelLayerHits)
265 GETTER(numberOfInnermostPixelLayerOutliers)
266 GETTER(numberOfPixelHits)
267 GETTER(numberOfPixelOutliers)
268 GETTER(numberOfSCTHits)
269 GETTER(numberOfSCTOutliers)
270 GETTER(numberOfTRTHits)
271 GETTER(numberOfTRTHighThresholdHits)
272 GETTER(numberOfTRTHighThresholdOutliers)
273 GETTER(numberOfTRTOutliers)
274 GETTER(expectInnermostPixelLayerHit)
275 GETTER(numberOfPixelDeadSensors)
276 GETTER(numberOfSCTDeadSensors)
277 GETTER(numberOfTRTXenonHits)
278#undef GETTER
279
280#define GETTER(_name_) float getTrackSummaryFloat_##_name_(const xAOD::Electron* eg) const;
281 GETTER(eProbabilityComb)
282 GETTER(eProbabilityHT)
283 GETTER(pixeldEdx)
284#undef GETTER
285
286 // GETTERs for Calo-Track monitoring
287#define GETTER(_name_) float getCaloTrackMatch_##_name_(const xAOD::Electron* eg) const;
288 GETTER(deltaEta0)
289 GETTER(deltaPhi0)
290 GETTER(deltaPhiRescaled0)
291 GETTER(deltaEta1)
292 GETTER(deltaPhi1)
293 GETTER(deltaPhiRescaled1)
294 GETTER(deltaEta2)
295 GETTER(deltaPhi2)
296 GETTER(deltaPhiRescaled2)
297 GETTER(deltaEta3)
298 GETTER(deltaPhi3)
299 GETTER(deltaPhiRescaled3)
300#undef GETTER
301
302};
303
304
305
306namespace Gaudi
307{
308 namespace Parsers
309 {
310 typedef std::map<std::string, std::string> Dict_t;
311
312 // A typedef may save a lot of mistakes
313 typedef std::vector<Dict_t> VecDict_t;
314
315 // Parse function... nothing special, but it must be done explicitely.
316 StatusCode parse( VecDict_t & result, const std::string& input );
317 }
318}
319
320
321#endif
322
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.
bool ApplyElectronPid(const EventContext &ctx, const xAOD::Electron *eg, const std::string &) const
Get offline electron decision.
float getEnergyBE2(const xAOD::Egamma *eg) const
ToolHandleArray< IAsgElectronLikelihoodTool > m_electronLHTool
Offline LH Selectors.
float getEnergyBE3(const xAOD::Egamma *eg) const
float getSigmaD0(const xAOD::Electron *eg) const
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.
const std::map< std::string, TrigInfo > & getTrigInfoMapR3() const
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.
const ToolHandle< Trig::IMatchingTool > & matchR3() const
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
ToolHandle< Trig::IMatchingTool > m_matchTool_R3
ToolHandleArray< IAsgElectronIsEMSelector > m_electronIsEMTool
Offline isEM Selectors.
Gaudi::Property< std::vector< std::string > > m_lhname
lh names
const std::map< std::string, TrigInfo > & getTrigInfoMap() const
Helper methods.
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.
std::map< std::string, TrigInfo > m_trigInfoR3
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.
bool ApplyPhotonPid(const EventContext &ctx, const xAOD::Photon *eg, const std::string &) const
Get offline electron decision.
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
std::string getProbeInformation(const std::vector< ChainNameParser::LegInfo > &LegParts, const std::string &signature) const
TrigInfo getTrigInfoR3(const std::string &) const
float getEnergyBE0(const xAOD::Egamma *eg) const
Gaudi::Property< std::vector< std::string > > m_dnnname
dnn names
std::vector< ChainNameParser::LegInfo > getProbeTriggerLeg(const std::string &triggerName) const
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.