ATLAS Offline Software
TrigEgammaEmulationFastElectronHypoTool.cxx
Go to the documentation of this file.
1 
2 
3 
5 #include "GaudiKernel/SystemOfUnits.h"
6 
7 
8 using namespace Trig;
9 
10 //**********************************************************************
11 
14 {}
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 
xAOD::TrigElectron_v1
Class describing an electron reconstructed in the HLT.
Definition: TrigElectron_v1.h:39
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
Trig::TrigEgammaEmulationFastElectronHypoTool::decide
bool decide(const Trig::TrigData &input, const xAOD::TrigElectron *electron) const
Definition: TrigEgammaEmulationFastElectronHypoTool.cxx:42
Trig::TrigEgammaEmulationFastElectronHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigEgammaEmulationFastElectronHypoTool.h:35
Trig::TrigEgammaEmulationFastElectronHypoTool::m_caloTrackdEoverPHigh
Gaudi::Property< float > m_caloTrackdEoverPHigh
Definition: TrigEgammaEmulationFastElectronHypoTool.h:41
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
Trig::TrigEgammaEmulationFastElectronHypoTool::m_caloTrackdEoverPLow
Gaudi::Property< float > m_caloTrackdEoverPLow
Definition: TrigEgammaEmulationFastElectronHypoTool.h:40
Trig::TrigEgammaEmulationBaseHypoTool
Definition: TrigEgammaEmulationBaseHypoTool.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Trig::TrigEgammaEmulationFastElectronHypoTool::m_doLRT
Gaudi::Property< bool > m_doLRT
Definition: TrigEgammaEmulationFastElectronHypoTool.h:36
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
Trig::TrigEgammaEmulationFastElectronHypoTool::m_trackPt
Gaudi::Property< float > m_trackPt
Definition: TrigEgammaEmulationFastElectronHypoTool.h:37
Trig::TrigEgammaEmulationFastElectronHypoTool::m_caloTrackDEta
Gaudi::Property< float > m_caloTrackDEta
Definition: TrigEgammaEmulationFastElectronHypoTool.h:38
TrigEgammaEmulationFastElectronHypoTool.h
Trig::TrigEgammaEmulationFastElectronHypoTool::m_trkd0
Gaudi::Property< float > m_trkd0
Definition: TrigEgammaEmulationFastElectronHypoTool.h:43
Trig::TrigEgammaEmulationFastElectronHypoTool::m_trtRatio
Gaudi::Property< float > m_trtRatio
Definition: TrigEgammaEmulationFastElectronHypoTool.h:42
Trig::TrigData
Definition: TrigEgammaEmulationToolMT.h:40
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
Trig::TrigEgammaEmulationFastElectronHypoTool::emulate
virtual bool emulate(const Trig::TrigData &input, bool &pass) const override
Definition: TrigEgammaEmulationFastElectronHypoTool.cxx:20
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Trig::TrigEgammaEmulationFastElectronHypoTool::m_caloTrackDPhi
Gaudi::Property< float > m_caloTrackDPhi
Definition: TrigEgammaEmulationFastElectronHypoTool.h:39
Trig::TrigEgammaEmulationFastElectronHypoTool::TrigEgammaEmulationFastElectronHypoTool
TrigEgammaEmulationFastElectronHypoTool(const std::string &myname)
Definition: TrigEgammaEmulationFastElectronHypoTool.cxx:12