ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaEmulationFastElectronHypoTool.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4
5
7#include "GaudiKernel/SystemOfUnits.h"
8
9
10using namespace Trig;
11
12//**********************************************************************
13
17
18
19
20//=================================================================
21
23 bool &pass) const
24{
25 pass=false;
26
27 if( !input.roi ) return false;
28
29 if( input.trig_electrons.empty() ) return false;
30
31 for ( const auto &el : input.trig_electrons )
32 {
33 if( decide( input, el ) ){
34 pass=true;
35 return true;
36 }
37 }
38
39 return false;
40}
41
42//=================================================================
43
45 const xAOD::TrigElectron* electron ) const
46{
47
48 if ( m_acceptAll ) {
49 ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
50 return true;
51 } else {
52 ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
53 }
54
55
56 const xAOD::TrackParticle* trkIter = electron-> trackParticle();
57 if ( trkIter == 0 ){ // disconsider candidates without track
58 return false;
59 }
60
61 // Retrieve all quantities
62 float dPhiCalo = electron->trkClusDphi();
63 float dEtaCalo = electron->trkClusDeta();
64 float ptCalo = electron->pt();
65 float eToverPt = electron->etOverPt();
66 float NTRHits = electron->nTRTHits();
67 float NStrawHits = electron->nTRTHiThresholdHits();
68 float TRTHitRatio = NStrawHits == 0 ? 1e10 : NTRHits/NStrawHits;
69
70 if ( ptCalo < m_trackPt ){
71 ATH_MSG_DEBUG( "Fails pt cut" << ptCalo << " < " << m_trackPt );
72 return false;
73 }
74
75 if ( dEtaCalo > m_caloTrackDEta ) {
76 ATH_MSG_DEBUG( "Fails dEta cut " << dEtaCalo << " < " << m_caloTrackDEta );
77 return false;
78 }
79 if ( dPhiCalo > m_caloTrackDPhi ) {
80 ATH_MSG_DEBUG( "Fails dPhi cut " << dPhiCalo << " < " << m_caloTrackDPhi );
81 return false;
82 }
83
84 if( eToverPt < m_caloTrackdEoverPLow ) {
85 ATH_MSG_DEBUG( "Fails eoverp low cut " << eToverPt << " < " << m_caloTrackdEoverPLow );
86 return false;
87 }
88 if ( eToverPt > m_caloTrackdEoverPHigh ) {
89 ATH_MSG_DEBUG( "Fails eoverp high cut " << eToverPt << " < " << m_caloTrackdEoverPHigh );
90 return false;
91 }
92 if ( TRTHitRatio < m_trtRatio ){
93 ATH_MSG_DEBUG( "Fails TRT cut " << TRTHitRatio << " < " << m_trtRatio );
94 return false;
95 }
96
97
98 if(m_doLRT){
99 ATH_MSG_DEBUG( "doLRT: " <<m_doLRT);
100 ATH_MSG_DEBUG( "Track d0: " <<m_trkd0);
101 float trk_d0 = std::fabs(trkIter->d0());
102 if(trk_d0 < m_trkd0){
103 ATH_MSG_DEBUG( "Fails d0 cut " <<trk_d0<< " < " <<m_trkd0 );
104 return false;
105 }
106 }
107
108
109 ATH_MSG_DEBUG( "Passed selection" );
110 return true;
111
112}
113
#define ATH_MSG_DEBUG(x,...)
virtual bool emulate(const Trig::TrigData &input, bool &pass) const override
bool decide(const Trig::TrigData &input, const xAOD::TrigElectron *electron) const
float d0() const
Returns the parameter.
The common trigger namespace for trigger analysis tools.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrigElectron_v1 TrigElectron
Declare the latest version of the class.