ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaFastElectronHypoTool Class Reference

#include <TrigEgammaFastElectronHypoTool.h>

Inheritance diagram for TrigEgammaFastElectronHypoTool:
Collaboration diagram for TrigEgammaFastElectronHypoTool:

Public Member Functions

 TrigEgammaFastElectronHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual StatusCode decide (std::vector< ITrigEgammaFastElectronHypoTool::ElectronInfo > &input) const override
virtual bool decide (const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const override

Private Member Functions

bool decide_cb (const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
bool decide_ringer (const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const

Private Attributes

HLT::Identifier m_decisionId
Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
Gaudi::Property< bool > m_doLRT { this, "DoLRT", false, "apply d0 cut for LRT triggers" }
Gaudi::Property< bool > m_doRinger { this, "DoRinger", false, "apply NN ringer selection" }
Gaudi::Property< float > m_trackPt { this, "TrackPt", 5.0*Gaudi::Units::GeV, "Track pT requirement ( separate threshold for each electron )" }
Gaudi::Property< float > m_caloTrackDEta { this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }
Gaudi::Property< float > m_caloTrackDPhi { this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }
Gaudi::Property< float > m_caloTrackdEoverPLow { this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "}
Gaudi::Property< float > m_caloTrackdEoverPHigh { this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" }
Gaudi::Property< float > m_trtRatio { this, "TRTRatio", 0, "TRT HT ratio" }
Gaudi::Property< float > m_d0 { this, "d0Cut", 0, "d0 cut" }
Gaudi::Property< std::string > m_pidName {this,"PidName", "", "Pid name"}
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }

Detailed Description

Definition at line 23 of file TrigEgammaFastElectronHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEgammaFastElectronHypoTool()

TrigEgammaFastElectronHypoTool::TrigEgammaFastElectronHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 14 of file TrigEgammaFastElectronHypoTool.cxx.

17 : base_class( type, name, parent ),
19{}
static HLT::Identifier fromToolName(const std::string &tname)

Member Function Documentation

◆ decide() [1/2]

bool TrigEgammaFastElectronHypoTool::decide ( const ITrigEgammaFastElectronHypoTool::ElectronInfo & i) const
overridevirtual

Definition at line 61 of file TrigEgammaFastElectronHypoTool.cxx.

62{
63 return m_doRinger ? decide_ringer(input) : decide_cb(input);
64}
bool decide_cb(const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
bool decide_ringer(const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const

◆ decide() [2/2]

StatusCode TrigEgammaFastElectronHypoTool::decide ( std::vector< ITrigEgammaFastElectronHypoTool::ElectronInfo > & input) const
overridevirtual

Definition at line 48 of file TrigEgammaFastElectronHypoTool.cxx.

48 {
49 for ( auto& i: input ) {
50 if ( TCU::passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
51 if ( decide( i ) ) {
53 }
54 }
55 }
56 return StatusCode::SUCCESS;
57}
virtual StatusCode decide(std::vector< ITrigEgammaFastElectronHypoTool::ElectronInfo > &input) const override
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.

◆ decide_cb()

bool TrigEgammaFastElectronHypoTool::decide_cb ( const ITrigEgammaFastElectronHypoTool::ElectronInfo & i) const
private

Definition at line 68 of file TrigEgammaFastElectronHypoTool.cxx.

70{
71
72 if ( m_acceptAll ) {
73 ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
74 return true;
75 } else {
76 ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
77 }
78
79 auto cutCounter = Monitored::Scalar<int>( "CutCounter", -1 );
80 auto mon_ptCalo = Monitored::Scalar( "PtCalo", -999. );
81 auto mon_ptTrack = Monitored::Scalar( "PtTrack", -999. );
82 auto mon_dEtaCalo = Monitored::Scalar( "CaloTrackdEta", -1. );
83 auto mon_dPhiCalo = Monitored::Scalar( "CaloTrackdPhi", -1. );
84 auto mon_eToverPt = Monitored::Scalar( "CaloTrackEoverP", -1. );
85 auto mon_caloEta = Monitored::Scalar( "CaloEta", -100. );
86 auto mon_caloPhi = Monitored::Scalar( "CaloPhi", -100. );
87 auto mon_trk_d0 = Monitored::Scalar( "d0Value", -1. );
88 auto monitorIt = Monitored::Group( m_monTool,
89 cutCounter,
90 mon_ptCalo, mon_ptTrack,
91 mon_dEtaCalo, mon_dPhiCalo,
92 mon_eToverPt,
93 mon_caloEta, mon_caloPhi, mon_trk_d0);
94
95 auto electron = input.electron;
96
97 if(!electron){
98 ATH_MSG_DEBUG("disconsider candidates without electron");
99 return false;
100 }
101
102 float ptCalo(0), dEtaCalo(0), dPhiCalo(0), eToverPt(0), caloEta(0), caloPhi(0), trk_d0(0);
103
104 const xAOD::TrackParticle* trkIter = electron->trackParticle();
105
106 if ( !trkIter ){ // disconsider candidates without track
107 ATH_MSG_DEBUG("disconsider candidates without track");
108 return false;
109 }
110 cutCounter++;
111
112 // Retrieve all quantities
113 dPhiCalo = electron->trkClusDphi();
114 dEtaCalo = electron->trkClusDeta();
115 ptCalo = electron->pt();
116 eToverPt = electron->etOverPt();
117 caloEta = electron->caloEta();
118 caloPhi = electron->caloPhi();
119 trk_d0 = std::abs(trkIter->d0());
120
121 float NTRHits = static_cast<float>( electron->nTRTHits() );
122 float NStrawHits = static_cast<float>( electron->nTRTHiThresholdHits() );
123 float TRTHitRatio = NStrawHits == 0 ? 1e10 : NTRHits/NStrawHits;
124
125 if ( ptCalo < m_trackPt ){
126 ATH_MSG_DEBUG( "Fails pt cut" << ptCalo << " < " << m_trackPt );
127 return false;
128 }
129 mon_ptCalo = ptCalo;
130 mon_ptTrack = m_trackPt;
131 cutCounter++;
132
133 if ( dEtaCalo > m_caloTrackDEta ) {
134 ATH_MSG_DEBUG( "Fails dEta cut " << dEtaCalo << " < " << m_caloTrackDEta );
135 return false;
136 }
137 mon_dEtaCalo = dEtaCalo;
138 mon_caloEta = caloEta;
139
140 cutCounter++;
141 if ( dPhiCalo > m_caloTrackDPhi ) {
142 ATH_MSG_DEBUG( "Fails dPhi cut " << dPhiCalo << " < " << m_caloTrackDPhi );
143 return false;
144 }
145
146 mon_dPhiCalo = dPhiCalo;
147 mon_caloPhi = caloPhi;
148 cutCounter++;
149 if( eToverPt < m_caloTrackdEoverPLow ) {
150 ATH_MSG_DEBUG( "Fails eoverp low cut " << eToverPt << " < " << m_caloTrackdEoverPLow );
151 return false;
152 }
153
154
155 cutCounter++;
156 if ( eToverPt > m_caloTrackdEoverPHigh ) {
157 ATH_MSG_DEBUG( "Fails eoverp high cut " << eToverPt << " < " << m_caloTrackdEoverPHigh );
158 return false;
159 }
160 mon_eToverPt = eToverPt;
161
162 cutCounter++;
163 if ( TRTHitRatio < m_trtRatio ){
164 ATH_MSG_DEBUG( "Fails TRT cut " << TRTHitRatio << " < " << m_trtRatio );
165 return false;
166 }
167
168
169 cutCounter++;
170 if(m_doLRT){
171 ATH_MSG_DEBUG( "doLRT: " <<m_doLRT);
172 ATH_MSG_DEBUG( "Track d0: " <<trk_d0);
173
174 if(trk_d0 < m_d0){
175 ATH_MSG_DEBUG( "Fails d0 cut " <<trk_d0<< " < " <<m_d0 );
176 return false;
177 }
178 }
179 mon_trk_d0 = trk_d0;
180
181 ATH_MSG_DEBUG( "Passed selection" );
182 return true;
183
184}
#define ATH_MSG_DEBUG(x)
ToolHandle< GenericMonitoringTool > m_monTool
float d0() const
Returns the parameter.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
setRcore setEtHad setFside setPt caloPhi

◆ decide_ringer()

bool TrigEgammaFastElectronHypoTool::decide_ringer ( const ITrigEgammaFastElectronHypoTool::ElectronInfo & i) const
private

Definition at line 190 of file TrigEgammaFastElectronHypoTool.cxx.

191{
192
193 if ( m_acceptAll ) {
194 ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
195 return true;
196 } else {
197 ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
198 }
199 auto cutCounter = Monitored::Scalar<int>( "CutCounter", -1 );
200 auto mon_ptCalo = Monitored::Scalar( "PtCalo", -999. );
201 auto mon_ptTrack = Monitored::Scalar( "PtTrack", -999. );
202 auto mon_dEtaCalo = Monitored::Scalar( "CaloTrackdEta", -1. );
203 auto mon_dPhiCalo = Monitored::Scalar( "CaloTrackdPhi", -1. );
204 auto mon_eToverPt = Monitored::Scalar( "CaloTrackEoverP", -1. );
205 auto mon_caloEta = Monitored::Scalar( "CaloEta", -100. );
206 auto mon_caloPhi = Monitored::Scalar( "CaloPhi", -100. );
207 auto mon_trk_d0 = Monitored::Scalar( "d0Value", -1. );
208 auto mon_nnOutput = Monitored::Scalar("NNOutput",-100);
209
210 auto mon = Monitored::Group( m_monTool,
211 cutCounter,
212 mon_ptCalo,
213 mon_ptTrack,
214 mon_dEtaCalo,
215 mon_dPhiCalo,
216 mon_eToverPt,
217 mon_caloEta,
218 mon_caloPhi,
219 mon_trk_d0,
220 mon_nnOutput);
221
222 auto el = input.electron;
223
224 if(!el){
225 return false;
226 }
227
228 float ptCalo(0), dEtaCalo(0), dPhiCalo(0), eToverPt(0), caloEta(0), caloPhi(0), trk_d0(0), nnOutput(0);
229
230 cutCounter++;
231
232 const xAOD::TrackParticle* trk = el->trackParticle();
233 if ( !trk ){
234 ATH_MSG_DEBUG("disconsider candidates without track");
235 return false;
236 }
237 cutCounter++;
238
239 // Retrieve all quantities
240 dPhiCalo = el->trkClusDphi();
241 dEtaCalo = el->trkClusDeta();
242 ptCalo = el->pt();
243 eToverPt = el->etOverPt();
244 caloEta = el->caloEta();
245 caloPhi = el->caloPhi();
246 trk_d0 = std::abs(trk->d0());
247
248
249 if ( ptCalo < m_trackPt ){
250 ATH_MSG_DEBUG( "Fails pt cut" << ptCalo << " < " << m_trackPt );
251 return false;
252 }
253 mon_ptCalo = ptCalo;
254 cutCounter++;
255
256 auto rings = input.rings;
257 if(!rings){
258 ATH_MSG_DEBUG("disconsider candidates without rings");
259 return false;
260 }
261 cutCounter++;
262
263 auto clus = input.cluster;
264 if(!clus){
265 ATH_MSG_DEBUG("disconsider candidates without cluster");
266 return false;
267 }
268 cutCounter++;
269
270 ATH_MSG_DEBUG("Ringer executed in FastElectron");
271
272 bool pass = false;
273 if( input.pidDecorator.count(m_pidName)){
274 nnOutput = input.valueDecorator.at(m_pidName+"NNOutput");
275 pass = input.pidDecorator.at(m_pidName);
276 ATH_MSG_DEBUG( "Get the decision for " << m_pidName << ": " << (pass?"Yes":"No") );
277 }
278
279
280 mon_ptTrack = m_trackPt;
281 mon_dEtaCalo = dEtaCalo;
282 mon_dPhiCalo = dPhiCalo;
283 mon_eToverPt = eToverPt;
284 mon_caloEta = caloEta;
285 mon_caloPhi = caloPhi;
286 mon_trk_d0 = trk_d0;
287 mon_nnOutput = nnOutput;
288
289
290 return pass;
291}
Gaudi::Property< std::string > m_pidName

◆ initialize()

StatusCode TrigEgammaFastElectronHypoTool::initialize ( )
overridevirtual

Definition at line 24 of file TrigEgammaFastElectronHypoTool.cxx.

24 {
25
26 if ( !m_monTool.empty() ) ATH_CHECK( m_monTool.retrieve() );
27
28
29 ATH_MSG_DEBUG( "AcceptAll = " << ( m_acceptAll? "True" : "False" ) );
30 ATH_MSG_DEBUG( "Do_Ringer = " << ( m_doRinger ? "True" : "False" ) );
31 ATH_MSG_DEBUG( "TrackPt = " << m_trackPt );
32 ATH_MSG_DEBUG( "CaloTrackdETA = " << m_caloTrackDEta );
33 ATH_MSG_DEBUG( "CaloTrackdPHI = " << m_caloTrackDPhi );
34 ATH_MSG_DEBUG( "CaloTrackdEoverPLow = " << m_caloTrackdEoverPLow );
35 ATH_MSG_DEBUG( "CaloTrackdEoverPHigh = " << m_caloTrackdEoverPHigh );
36 ATH_MSG_DEBUG( "TRTRatio = " << m_trtRatio );
37 ATH_MSG_DEBUG( "Do_LRT = " << m_doLRT );
38 ATH_MSG_DEBUG( "d0Cut = " << m_d0 );
39
40 ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
41
42 ATH_MSG_DEBUG( "Initialization completed successfully:" );
43 return StatusCode::SUCCESS;
44}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
private

Definition at line 43 of file TrigEgammaFastElectronHypoTool.h.

43{ this, "AcceptAll", false, "Ignore selection" };

◆ m_caloTrackdEoverPHigh

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPHigh { this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" }
private

Definition at line 50 of file TrigEgammaFastElectronHypoTool.h.

50{ this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" };

◆ m_caloTrackdEoverPLow

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPLow { this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "}
private

Definition at line 49 of file TrigEgammaFastElectronHypoTool.h.

49{ this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "};

◆ m_caloTrackDEta

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackDEta { this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }
private

Definition at line 47 of file TrigEgammaFastElectronHypoTool.h.

47{ this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }; //loose cut

◆ m_caloTrackDPhi

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackDPhi { this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }
private

Definition at line 48 of file TrigEgammaFastElectronHypoTool.h.

48{ this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }; //loose cut

◆ m_d0

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_d0 { this, "d0Cut", 0, "d0 cut" }
private

Definition at line 52 of file TrigEgammaFastElectronHypoTool.h.

52{ this, "d0Cut", 0, "d0 cut" };

◆ m_decisionId

HLT::Identifier TrigEgammaFastElectronHypoTool::m_decisionId
private

Definition at line 41 of file TrigEgammaFastElectronHypoTool.h.

◆ m_doLRT

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_doLRT { this, "DoLRT", false, "apply d0 cut for LRT triggers" }
private

Definition at line 44 of file TrigEgammaFastElectronHypoTool.h.

44{ this, "DoLRT", false, "apply d0 cut for LRT triggers" };

◆ m_doRinger

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_doRinger { this, "DoRinger", false, "apply NN ringer selection" }
private

Definition at line 45 of file TrigEgammaFastElectronHypoTool.h.

45{ this, "DoRinger", false, "apply NN ringer selection" };

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigEgammaFastElectronHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 54 of file TrigEgammaFastElectronHypoTool.h.

54{ this, "MonTool", "", "Monitoring tool" };

◆ m_pidName

Gaudi::Property<std::string> TrigEgammaFastElectronHypoTool::m_pidName {this,"PidName", "", "Pid name"}
private

Definition at line 53 of file TrigEgammaFastElectronHypoTool.h.

53{this,"PidName", "", "Pid name"};

◆ m_trackPt

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_trackPt { this, "TrackPt", 5.0*Gaudi::Units::GeV, "Track pT requirement ( separate threshold for each electron )" }
private

Definition at line 46 of file TrigEgammaFastElectronHypoTool.h.

46{ this, "TrackPt", 5.0*Gaudi::Units::GeV, "Track pT requirement ( separate threshold for each electron )" };

◆ m_trtRatio

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_trtRatio { this, "TRTRatio", 0, "TRT HT ratio" }
private

Definition at line 51 of file TrigEgammaFastElectronHypoTool.h.

51{ this, "TRTRatio", 0, "TRT HT ratio" };

The documentation for this class was generated from the following files: