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
42struct TrigInfo{
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;
60 bool isolated{};
61};
62
63
65
66 public:
67
68
69 TrigEgammaMonitorBaseAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
70
72
73 virtual StatusCode initialize() override;
74
75 virtual StatusCode fillHistograms(const EventContext& /*ctx*/) const override {return StatusCode::SUCCESS;};
76
77
78 std::vector<ChainNameParser::LegInfo>
79 getProbeTriggerLeg(const std::string& triggerName) const;
80
81 std::string getProbeInformation(const std::vector<ChainNameParser::LegInfo>& LegParts, const std::string& signature) const;
82
83 private:
84
86 ToolHandle<Trig::TrigDecisionTool> m_trigdec;
88 std::map<std::string,TrigInfo> m_trigInfo;
89 std::map<std::string,TrigInfo> m_trigInfoR3;
90
91
92 protected:
93
94 /* Trigger e/g matching tool */
95 ToolHandle<TrigEgammaMatchingToolMT> m_matchTool;
96 ToolHandle<Trig::IMatchingTool> m_matchTool_R3;
97
98 /* Trigger e/g emulation tool */
99 ToolHandle<Trig::TrigEgammaEmulationToolMT> m_emulatorTool;
101 ToolHandleArray<IAsgElectronIsEMSelector> m_electronIsEMTool{this,"ElectronIsEMSelector",{}};
103 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronLHTool{this,"ElectronLikelihoodTool",{}};
105 ToolHandleArray<IAsgElectronLikelihoodTool> m_electronDNNTool{ this, "ElectronDNNSelectorTool", {},"DNN tools" };
107 ToolHandleArray<IAsgPhotonIsEMSelector> m_photonIsEMTool{this,"PhotonIsEMSelector",{}};
108
109
111 Gaudi::Property<bool> m_doEmulation{this, "DoEmulation", false };
112
113 Gaudi::Property<bool> m_doEffwithLH{this, "ComputeEffLH", false};
114 Gaudi::Property<bool> m_doEffwithDNN{this, "ComputeEffDNN", false};
115
117 Gaudi::Property<bool> m_tp{this, "TPTrigger", false };
119 Gaudi::Property<std::string> m_defaultProbePidElectron{this, "DefaultProbeSelectionElectron", "lhloose"};
121 Gaudi::Property<std::string> m_defaultProbePidPhoton{this, "DefaultProbeSelectionPhoton", "loose"};
123 Gaudi::Property<std::vector<std::string>> m_isemname{this, "isEMResultNames", {} };
125 Gaudi::Property<std::vector<std::string>> m_lhname{this, "LHResultNames", {} };
127 Gaudi::Property<std::vector<std::string>> m_dnnname {this, "DNNResultNames", {}, };
129 Gaudi::Property<bool> m_detailedHists{this, "DetailedHistograms", false};
130
131
133
135
137 const std::map<std::string,TrigInfo>& getTrigInfoMap() const { return m_trigInfo; }
138 const std::map<std::string,TrigInfo>& getTrigInfoMapR3() const { return m_trigInfoR3; }
140 bool ApplyElectronPid(const EventContext& ctx, const xAOD::Electron *eg,const std::string&) const;
142 bool ApplyPhotonPid(const EventContext& ctx, const xAOD::Photon *eg,const std::string&) const;
144 const ToolHandle<Trig::TrigDecisionTool>& tdt() const {return m_trigdec;};
145
147 const ToolHandle<TrigEgammaMatchingToolMT>& match() const {return m_matchTool;}
148 const ToolHandle<Trig::IMatchingTool>& matchR3() const {return m_matchTool_R3;}
149
150
151
153 asg::AcceptData setAccept(const EventContext& ctx, const TrigCompositeUtils::Decision*, const TrigInfo&, const bool) const;
155 TrigInfo getTrigInfo(const std::string&) const;
156 TrigInfo getTrigInfoR3(const std::string&) const;
158 float dR(const float, const float, const float, const float) const;
160 std::string getL1Item(const std::string& trigger) const;
162 bool isIsolated(const xAOD::Electron*, const std::string&) const;
164 bool isPrescaled(const std::string&) const;
166 void setTrigInfo(const std::string&);
167 void setTrigInfoR3(const std::string&);
169 bool isHLTTruncated() const;
170
171
173
174
175
177 float getEta2(const xAOD::Egamma* eg) const;
178 float getEt(const xAOD::Electron* eg) const ;
179 float getEtCluster37(const xAOD::Egamma* eg) const;
180 float getDEmaxs1(const xAOD::Egamma *eg) const;
181 float rTRT (const xAOD::Electron* eg) const;
182 float getSigmaD0(const xAOD::Electron *eg) const;
183 float getD0sig(const xAOD::Electron *eg) const;
184 float getEnergyBE0(const xAOD::Egamma *eg) const;
185 float getEnergyBE1(const xAOD::Egamma *eg) const;
186 float getEnergyBE2(const xAOD::Egamma *eg) const;
187 float getEnergyBE3(const xAOD::Egamma *eg) const;
188 float getEaccordion(const xAOD::Egamma *eg) const;
189 float getE0Eaccordion(const xAOD::Egamma *eg) const;
190
191
192
193
194
195
196
197
198
200#define GETTER(_name_) float getShowerShape_##_name_(const xAOD::Egamma* eg) const;
201 GETTER(e011)
202 GETTER(e132)
203 GETTER(e237)
204 GETTER(e277)
205 GETTER(ethad)
206 GETTER(ethad1)
207 GETTER(weta1)
208 GETTER(weta2)
209 GETTER(f1)
210 GETTER(e2tsts1)
211 GETTER(emins1)
212 GETTER(emaxs1)
213 GETTER(wtots1)
214 GETTER(fracs1)
215 GETTER(Reta)
216 GETTER(Rphi)
217 GETTER(f3)
218 GETTER(f3core)
219 GETTER(Eratio)
220 GETTER(Rhad)
221 GETTER(Rhad1)
222 GETTER(DeltaE)
223#undef GETTER
224
225
226 // GETTER for Isolation monitoring
227#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Electron* eg) const;
228 GETTER(ptcone20)
229 GETTER(ptcone30)
230 GETTER(ptcone40)
231 GETTER(ptvarcone20)
232 GETTER(ptvarcone30)
233 GETTER(ptvarcone40)
234#undef GETTER
235#define GETTER(_name_) float getIsolation_##_name_(const xAOD::Egamma* eg) const;
236 GETTER(ptcone20)
237 GETTER(etcone20)
238 GETTER(etcone30)
239 GETTER(etcone40)
240 GETTER(topoetcone20)
241 GETTER(topoetcone30)
242 GETTER(topoetcone40)
243#undef GETTER
244 // GETTERs for CaloCluster monitoring
245#define GETTER(_name_) float getCluster_##_name_(const xAOD::Egamma* eg) const;
246 GETTER(et)
247 GETTER(phi)
248 GETTER(eta)
249#undef GETTER
250
251 // GETTERs for Track monitoring
252#define GETTER(_name_) float getTrack_##_name_(const xAOD::Electron* eg) const;
253 GETTER(pt)
254 GETTER(phi)
255 GETTER(eta)
256 GETTER(d0)
257 GETTER(z0)
258#undef GETTER
259
260
261 // GETTERs for Track details monitoring
262#define GETTER(_name_) float getTrackSummary_##_name_(const xAOD::Electron* eg) const;
263 GETTER(numberOfInnermostPixelLayerHits)
264 GETTER(numberOfInnermostPixelLayerOutliers)
265 GETTER(numberOfPixelHits)
266 GETTER(numberOfPixelOutliers)
267 GETTER(numberOfSCTHits)
268 GETTER(numberOfSCTOutliers)
269 GETTER(numberOfTRTHits)
270 GETTER(numberOfTRTHighThresholdHits)
271 GETTER(numberOfTRTHighThresholdOutliers)
272 GETTER(numberOfTRTOutliers)
273 GETTER(expectInnermostPixelLayerHit)
274 GETTER(numberOfPixelDeadSensors)
275 GETTER(numberOfSCTDeadSensors)
276 GETTER(numberOfTRTXenonHits)
277#undef GETTER
278
279#define GETTER(_name_) float getTrackSummaryFloat_##_name_(const xAOD::Electron* eg) const;
280 GETTER(eProbabilityComb)
281 GETTER(eProbabilityHT)
282 GETTER(pixeldEdx)
283#undef GETTER
284
285 // GETTERs for Calo-Track monitoring
286#define GETTER(_name_) float getCaloTrackMatch_##_name_(const xAOD::Electron* eg) const;
287 GETTER(deltaEta0)
288 GETTER(deltaPhi0)
289 GETTER(deltaPhiRescaled0)
290 GETTER(deltaEta1)
291 GETTER(deltaPhi1)
292 GETTER(deltaPhiRescaled1)
293 GETTER(deltaEta2)
294 GETTER(deltaPhi2)
295 GETTER(deltaPhiRescaled2)
296 GETTER(deltaEta3)
297 GETTER(deltaPhi3)
298 GETTER(deltaPhiRescaled3)
299#undef GETTER
300
301};
302
303
304
305namespace Gaudi
306{
307 namespace Parsers
308 {
309 typedef std::map<std::string, std::string> Dict_t;
310
311 // A typedef may save a lot of mistakes
312 typedef std::vector<Dict_t> VecDict_t;
313
314 // Parse function... nothing special, but it must be done explicitly.
315 StatusCode parse( VecDict_t & result, const std::string& input );
316 }
317}
318
319
320#endif
321
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.
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
asg::AcceptData setAccept(const EventContext &ctx, const TrigCompositeUtils::Decision *, const TrigInfo &, const bool) const
Set the accept object for all trigger levels.
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.
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.