ATLAS Offline Software
TrigEgammaEmulationPrecisionCaloHypoTool.cxx
Go to the documentation of this file.
1 
3 #include "GaudiKernel/SystemOfUnits.h"
4 
5 
6 using namespace Trig;
7 
8 //**********************************************************************
9 
12 {}
13 
14 
15 
17 
18 
20  bool &pass) const
21 {
22  pass=false;
23 
24  if( !input.roi ) return false;
25 
26  if( input.clusters.empty() ) return false;
27 
28  for ( const auto &cl : input.clusters )
29  {
30  if( decide( input, cl ) ){
31  pass=true;
32  return true;
33  }
34  }
35 
36  return false;
37 }
38 
39 
40 
41 
43  const xAOD::CaloCluster *pClus ) const
44 {
45  unsigned PassedCuts=0;
46 
47  if(!input.roi){
48  ATH_MSG_DEBUG("L1 not found");
49  return false;
50  }
51 
52  // when leaving scope it will ship data to monTool
53  PassedCuts = PassedCuts + 1; //got called (data in place)
54 
55  auto roiDescriptor = input.roi;
56 
57 
58  if ( std::abs( roiDescriptor->eta() ) > 2.6 ) {
59  ATH_MSG_DEBUG( "REJECT The cluster had eta coordinates beyond the EM fiducial volume : " << roiDescriptor->eta() << "; stop the chain now" );
60  return false;
61  }
62 
63  ATH_MSG_DEBUG( "; RoI ID = " << roiDescriptor->roiId()
64  << ": Eta = " << roiDescriptor->eta()
65  << ", Phi = " << roiDescriptor->phi() );
66 
67  // fill local variables for RoI reference position
68  double etaRef = roiDescriptor->eta();
69  double phiRef = roiDescriptor->phi();
70  // correct phi the to right range ( probably not needed anymore )
71  if ( std::abs( phiRef ) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range
72 
73  float absEta = std::abs( pClus->eta() );
74 
75  const int cutIndex = findCutIndex( absEta );
76 
77  float dEta = pClus->eta() - etaRef;
78  // Deal with angle diferences greater than Pi
79  float dPhi = std::abs( pClus->phi() - phiRef );
80  dPhi = ( dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); // TB why only <
81  float eT_Cluster = pClus->et();
82  // apply cuts: DeltaEta( clus-ROI )
83  ATH_MSG_DEBUG( "CaloCluster: eta=" << pClus->eta()
84  << " roi eta=" << etaRef << " DeltaEta=" << dEta
85  << " cut: <" << m_detacluster );
86 
87  if ( std::abs( pClus->eta() - etaRef ) > m_detacluster ) {
88  ATH_MSG_DEBUG("REJECT Cluster dEta cut failed");
89  return false;
90  }
91  PassedCuts = PassedCuts + 1; //Deta
92 
93  // DeltaPhi( clus-ROI )
94  ATH_MSG_DEBUG( ": phi=" << pClus->phi()
95  << " roi phi="<< phiRef << " DeltaPhi="<< dPhi
96  << " cut: <" << m_dphicluster );
97 
98  if( dPhi > m_dphicluster ) {
99  ATH_MSG_DEBUG("REJECT Clsuter dPhi cut failed");
100  return false;
101  }
102  PassedCuts = PassedCuts + 1; //DPhi
103 
104 
105 
106  // eta range
107  if ( cutIndex == -1 ) { // VD
108  ATH_MSG_DEBUG( "Cluster eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
109  return false;
110  } else {
111  ATH_MSG_DEBUG( "eta bin used for cuts " << cutIndex );
112  }
113  PassedCuts = PassedCuts + 1; // passed eta cut
114 
115  // ET_em
116  ATH_MSG_DEBUG( "CaloCluster: ET_em=" << eT_Cluster << " cut: >" << m_eTthr[cutIndex] );
117  if ( eT_Cluster < m_eTthr[cutIndex] ) {
118  ATH_MSG_DEBUG("REJECT et cut failed");
119  return false;
120  }
121  PassedCuts = PassedCuts + 1; // ET_em
122 
123 
124  // got this far => passed!
125  // Reach this point successfully
126  ATH_MSG_DEBUG( "pass!" );
127 
128  return true;
129 
130 }
131 
133 
135  const float absEta = std::abs(eta);
136 
137  auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
138  if ( binIterator == m_etabin.end() ) {
139  return -1;
140  }
141  return binIterator - m_etabin.begin();
142 }
143 
144 
145 
146 
147 
148 
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.h:37
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::decide
bool decide(const TrigData &input, const xAOD::CaloCluster *) const
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.cxx:42
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
TrigEgammaEmulationPrecisionCaloHypoTool.h
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::TrigEgammaEmulationPrecisionCaloHypoTool
TrigEgammaEmulationPrecisionCaloHypoTool(const std::string &myname)
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.cxx:10
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::emulate
virtual bool emulate(const TrigData &input, bool &pass) const override
==========================================================================
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.cxx:19
Trig::TrigEgammaEmulationBaseHypoTool
Definition: TrigEgammaEmulationBaseHypoTool.h:22
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::findCutIndex
int findCutIndex(float eta) const
==========================================================================
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.cxx:134
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:530
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_detacluster
Gaudi::Property< float > m_detacluster
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.h:34
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_dphicluster
Gaudi::Property< float > m_dphicluster
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.h:35
Trig::TrigEgammaEmulationPrecisionCaloHypoTool::m_eTthr
Gaudi::Property< std::vector< float > > m_eTthr
Definition: TrigEgammaEmulationPrecisionCaloHypoTool.h:38
Trig::TrigData
Definition: TrigEgammaEmulationToolMT.h:40
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:232
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:525
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26