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