ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaEmulationFastPhotonHypoTool.cxx
Go to the documentation of this file.
1
2
4#include "GaudiKernel/SystemOfUnits.h"
5
6
7using namespace Trig;
8
9//**********************************************************************
10
14
15
16
18
20 bool &pass ) const
21{
22 pass = false;
23
24 if(!input.roi){
25 ATH_MSG_DEBUG( "RoI is null ptr");
26 return false;
27 }
28
29 if(!input.trig_photon){
30 ATH_MSG_DEBUG( "Cluster is null ptr");
31 return false;
32 }
33
34 pass = decide(input);
35
36 return true;
37}
38
40
41
43{
44
45 float EmET = -99.0;
46 float HadEmRatio = -99.0;
47 float Reta = -99.0;
48 float Eratio = -99.0;
49 float f1 = -99.0;
50 float HadET = -99.0;
51
52 const xAOD::TrigPhoton* photon = input.trig_photon;
53
54
55 // Determine which eta bin to apply the cuts
56 float absEta = std::abs( photon->eta() );
57
58
59 int etaBin = findCutIndex(absEta);
60
61 // getting photon variable
62 Eratio = photon->eratio();
63 Reta = photon->rcore();
64 EmET = photon->pt();
65 HadET = photon->etHad();
66 f1 = photon->f1();
67
68
69 HadEmRatio = (EmET!=0) ? HadET/EmET : -1.0;
70
71
72 if(m_acceptAll) {
73 ATH_MSG_DEBUG ( "Accept all property is set: TrigPhoton: ET_em=" << EmET << " cut in etaBin "
74 << etaBin << " is ET_em >= " << m_eTthr[0] );
75 return true;
76 }
77
78 // eta range
79 if ( etaBin==-1 ) {
80 ATH_MSG_VERBOSE( "Photon eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
81 return true;
82 } else {
83 ATH_MSG_VERBOSE( "eta bin used for cuts " << etaBin );
84 }
85 // Reta (was previously called Rcore)
86 if ( Reta > m_carcorethr[etaBin] ){
87 ATH_MSG_VERBOSE( "TrigPhoton Reta=" << Reta
88 << " cut in etaBin " << etaBin << " is Reta >= " << m_carcorethr[etaBin] );
89 return false;
90 }
91 // // Eratio
92 bool inCrack = ( absEta > 2.37 || ( absEta > 1.37 && absEta < 1.52) );
93 if ( inCrack || f1<m_F1thr[0] ) {
94 ATH_MSG_VERBOSE( "TrigPhoton: InCrack= " << inCrack << " F1=" << f1
95 << " Eratio cut not being applied" );
96 } else {
97 if ( Eratio > m_caeratiothr[etaBin] ) return false;
98 }
99 if(inCrack) Eratio = -1; //Set default value in crack for monitoring.
100
101 // ET_em
102 if ( EmET < m_eTthr[etaBin]) {
103 ATH_MSG_VERBOSE( "TrigPhoton: ET_em=" << EmET
104 << " not in etaBin " << etaBin << " is ET_em < " << m_eTthr[etaBin] );
105 return false;
106 }
107
108 // ET_had
109 // find which ET_had to apply : this depends on the ET_em and the eta bin
110 float hadET_cut=-1;
111
112 if ( EmET > m_eT2thr[etaBin] ) {
113 hadET_cut = m_hadeT2thr[etaBin] ;
114 ATH_MSG_VERBOSE( "ET_em>" << m_eT2thr[etaBin] );
115 } else {
116 hadET_cut = m_hadeTthr[etaBin];
117 ATH_MSG_VERBOSE( "ET_em<" << m_eT2thr[etaBin] );
118 }
119
120 if ( HadEmRatio < hadET_cut ){
121 ATH_MSG_VERBOSE( "TrigPhoton: ET_had=" << HadEmRatio
122 << " not in etaBin " << etaBin );
123 return false;
124
125 }
126
127 return true;
128
129}
130
131
132//==================================================================
133
135 const float absEta = std::abs(eta);
136 auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
137 if ( binIterator == m_etabin.end() ) {
138 return -1;
139 }
140 return binIterator - m_etabin.begin();
141}
142
143
144
Scalar eta() const
pseudorapidity method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
bool decide(const Trig::TrigData &input) const
==========================================================================
virtual bool emulate(const Trig::TrigData &input, bool &pass) const override
==========================================================================
The common trigger namespace for trigger analysis tools.
TrigPhoton_v1 TrigPhoton
Declare the latest version of TrigPhoton.