9 #include "GaudiKernel/SystemOfUnits.h"
17 const std::string&
name,
47 ATH_MSG_ERROR(
" There are no cuts set (EtaBins property is an empty list)" );
48 return StatusCode::FAILURE;
51 unsigned int nEtaBin =
m_etabin.size();
52 #define CHECK_SIZE( __n) if ( m_##__n.size() != (nEtaBin - 1) ) \
53 { ATH_MSG_DEBUG(" __n size is " << m_##__n.size() << " but needs to be " << (nEtaBin - 1) ); return StatusCode::FAILURE; }
75 return StatusCode::SUCCESS;
88 return StatusCode::SUCCESS;
119 mon_dEta, mon_dPhi, mon_eT_T2Calo, mon_hadET_T2Calo,
120 mon_rCore, mon_energyRatio, mon_etaBin, mon_Eta,
121 mon_Phi, mon_F1, mon_Weta2, mon_Wstot, mon_F3, PassedCuts );
123 PassedCuts = PassedCuts + 1;
125 float dEta(0),
dPhi(0), eT_T2Calo(0), rCore(0), hadET_T2Calo(0), energyRatio(0),
eta(0),
phi(0), F1(0), Weta2(0), Wstot(0), F3(0);
129 ATH_MSG_DEBUG(
"AcceptAll property is set: taking all events" );
132 ATH_MSG_DEBUG(
"AcceptAll property not set: applying selection" );
135 auto roiDescriptor =
input.roi;
137 if ( fabs( roiDescriptor->eta() ) > 2.6 ) {
138 ATH_MSG_DEBUG(
"REJECT The cluster had eta coordinates beyond the EM fiducial volume : " << roiDescriptor->eta() <<
"; stop the chain now" );
144 <<
": Eta = " << roiDescriptor->eta()
145 <<
", Phi = " << roiDescriptor->phi() );
148 double etaRef = roiDescriptor->eta();
149 double phiRef = roiDescriptor->phi();
151 if ( fabs( phiRef ) >
M_PI ) phiRef -= 2*
M_PI;
153 auto pClus =
input.cluster;
154 float absEta = fabs( pClus->eta() );
162 dEta = pClus->eta() - etaRef;
165 dPhi = fabs( pClus->phi() - phiRef );
169 if ( pClus->emaxs1() + pClus->e2tsts1() > 0 )
170 energyRatio = ( pClus->emaxs1() - pClus->e2tsts1() ) / ( pClus->emaxs1() + pClus->e2tsts1() );
173 if ( pClus->e277()!= 0. ) rCore = pClus->e237() / pClus->e277();
177 eT_T2Calo = pClus->et();
178 if ( eT_T2Calo!=0 && pClus->eta()!=0 ) hadET_T2Calo = pClus->ehad1()/cosh( fabs( pClus->eta() ) )/eT_T2Calo;
181 Weta2 = pClus->weta2();
184 Wstot = pClus->wstot();
192 F3 = fabs( eallsamples )>0. ?
e3/eallsamples : 0.;
196 <<
" roi eta=" << etaRef <<
" DeltaEta=" <<
dEta
205 PassedCuts = PassedCuts + 1;
209 <<
" roi phi="<< phiRef <<
" DeltaPhi="<<
dPhi
218 PassedCuts = PassedCuts + 1;
221 if ( cutIndex == -1 ) {
229 PassedCuts = PassedCuts + 1;
239 PassedCuts = PassedCuts + 1;
243 if ( inCrack || F1 <
m_F1thr[0] ) {
244 ATH_MSG_DEBUG (
"TrigEMCluster: InCrack= " << inCrack <<
" F1=" << F1 );
252 PassedCuts = PassedCuts + 1;
253 if( inCrack ) energyRatio = -1;
254 mon_energyRatio = energyRatio;
258 if ( eT_T2Calo <
m_eTthr[cutIndex] ) {
262 mon_eT_T2Calo = eT_T2Calo;
263 PassedCuts = PassedCuts + 1;
265 float hadET_cut = 0.0;
267 if ( eT_T2Calo >
m_eT2thr[cutIndex] ) {
277 ATH_MSG_DEBUG (
"TrigEMCluster: ET_had=" << hadET_T2Calo <<
" cut: <" << hadET_cut );
278 if ( hadET_T2Calo > hadET_cut ) {
282 mon_hadET_T2Calo = hadET_T2Calo;
283 PassedCuts = PassedCuts + 1;
288 PassedCuts = PassedCuts + 1;
297 PassedCuts = PassedCuts + 1;
306 PassedCuts = PassedCuts + 1;
310 if ( F3 >
m_F3thr[cutIndex] ) {
315 PassedCuts = PassedCuts + 1;
341 float et(0),
eta(0),
phi(0), NNOutput(0);
344 ATH_MSG_DEBUG(
"AcceptAll property is set: taking all events" );
347 ATH_MSG_DEBUG(
"AcceptAll property not set: applying selection" );
350 auto ringerShape =
input.ringerShape;
354 emCluster = ringerShape->emCluster();
356 ATH_MSG_DEBUG(
"There is no link to xAOD::TrigEMCluster into the Ringer object.");
361 ATH_MSG_WARNING(
"There is no xAOD::TrigRingerRings link into the rnnOutput object.");
366 et = emCluster->
et();
384 ATH_MSG_DEBUG(
"Pid name " <<
m_pidName <<
" not found into the decorator. Probably this decision was not computed by the hypo alg." );
386 mon_NNOutput = NNOutput;
395 auto binIterator = std::adjacent_find(
m_etabin.begin(),
m_etabin.end(), [=](
float left,
float right){ return left < absEta and absEta < right; } );
396 if ( binIterator ==
m_etabin.end() ) {
399 return binIterator -
m_etabin.begin();