ATLAS Offline Software
TrigEgammaEmulationFastPhotonHypoTool.cxx
Go to the documentation of this file.
1 
2 
4 #include "GaudiKernel/SystemOfUnits.h"
5 
6 
7 using namespace Trig;
8 
9 //**********************************************************************
10 
13 {}
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 
xAOD::EgammaParameters::Reta
@ Reta
e237/e277
Definition: EgammaEnums.h:154
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_hadeT2thr
Gaudi::Property< std::vector< float > > m_hadeT2thr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:38
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TrigEgammaEmulationFastPhotonHypoTool.h
Trig::TrigEgammaEmulationBaseHypoTool
Definition: TrigEgammaEmulationBaseHypoTool.h:22
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
Trig::TrigEgammaEmulationFastPhotonHypoTool::emulate
virtual bool emulate(const Trig::TrigData &input, bool &pass) const override
==========================================================================
Definition: TrigEgammaEmulationFastPhotonHypoTool.cxx:19
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:32
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_caeratiothr
Gaudi::Property< std::vector< float > > m_caeratiothr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:40
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:45
Trig::TrigEgammaEmulationFastPhotonHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaEmulationFastPhotonHypoTool.cxx:134
xAOD::TrigPhoton_v1
Class describing a photon reconstructed in the HLT.
Definition: TrigPhoton_v1.h:38
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_hadeTthr
Gaudi::Property< std::vector< float > > m_hadeTthr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:37
Trig::TrigEgammaEmulationFastPhotonHypoTool::decide
bool decide(const Trig::TrigData &input) const
==========================================================================
Definition: TrigEgammaEmulationFastPhotonHypoTool.cxx:42
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_eT2thr
Gaudi::Property< std::vector< float > > m_eT2thr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:36
Trig::TrigData
Definition: TrigEgammaEmulationToolMT.h:40
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:234
xAOD::EgammaParameters::Eratio
@ Eratio
(emaxs1-e2tsts1)/(emaxs1+e2tsts1)
Definition: EgammaEnums.h:158
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_F1thr
Gaudi::Property< std::vector< float > > m_F1thr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:41
Trig::TrigEgammaEmulationFastPhotonHypoTool::TrigEgammaEmulationFastPhotonHypoTool
TrigEgammaEmulationFastPhotonHypoTool(const std::string &myname)
Definition: TrigEgammaEmulationFastPhotonHypoTool.cxx:11
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_carcorethr
Gaudi::Property< std::vector< float > > m_carcorethr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:39
Trig::TrigEgammaEmulationFastPhotonHypoTool::m_eTthr
Gaudi::Property< std::vector< float > > m_eTthr
Definition: TrigEgammaEmulationFastPhotonHypoTool.h:35
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4