ATLAS Offline Software
TrigPhoton_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: TrigPhoton_v1.cxx 602892 2014-06-20 12:23:53Z krasznaa $
6 
7 // System include(s):
8 #include <cmath>
9 
10 // EDM include(s):
12 
13 // Local include(s):
15 
16 namespace xAOD {
17 
19  : IParticle() {
20 
21  }
22 
24  //
25  // Implementation of the functions inherited from IParticle
26  //
27 
29 
30 
31  double TrigPhoton_v1::e() const {
37 
38  return genvecP4().E();
39  }
40 
47  double TrigPhoton_v1::rapidity() const {
48 
49  return genvecP4().Rapidity();
50  }
51 
58  FourMom_t p4;
59  p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
60  return p4;
61  }
62 
65  return GenVecFourMom_t(pt(), eta(), phi(), m());
66  }
67 
68  //
70 
72  //
73  // Implementation of the "simple" photon properties
74  //
75 
77  setRoiWord )
78 
80  setRcore )
82  setEratio )
84  setEtHad )
86  setEtHad1 )
87 
92 
94  setFside )
96  setWeta2 )
97 
98  //
100 
102  //
103  // Implementation of the 4-momentum handling functions
104  //
105 
107  setPt )
108 
110  setCaloEta )
112  setCaloPhi )
113 
116 
117  //
119 
121  //
122  // Implementation of the constituent accessor functions
123  //
124 
133  const TrigEMCluster* TrigPhoton_v1::emCluster() const {
134 
135  // The link accessor:
136  static const Accessor< EMClusterLink_t > acc( "emClusterLink" );
137 
138  // Check if the link is available:
139  if( ! acc.isAvailable( *this ) ) {
140  return nullptr;
141  }
142 
143  // Check if the link is valid:
144  const EMClusterLink_t& link = acc( *this );
145  if( ! link.isValid() ) {
146  return nullptr;
147  }
148 
149  // Return the pointer:
150  return *link;
151  }
152 
155  emClusterLink,
156  setEmClusterLink )
157 
158  //
160 
166  void TrigPhoton_v1::init( uint32_t roi,
167  float dphi, float deta,
168  const EMClusterLink_t& clLink ) {
169 
170  setRoiWord( roi );
171  // Marked as oboslete in old EDM, so we drop it here?
172  setCaloEta( 0 );
173  setCaloPhi( 0 );
174  setDEta( deta );
175  setDPhi( dphi );
176  setEtHad( 0 );
177  setEtHad1( 0 );
178  setRcore( 0 );
179  setEratio( 0 );
180  setF0( 0 );
181  setF1( 0 );
182  setF2( 0 );
183  setF3( 0 );
184  setFside( 0 );
185  setWeta2( 0 );
186 
187  // Links to associated trigger track and EM cluster.
188  setEmClusterLink( clLink );
189 
190  // Stash calo cluster variables.
191  if( clLink.isValid() ) {
192 
193  // Get the pointer:
194  const TrigEMCluster* clPtr = *clLink;
195 
196  setPt( clPtr->et() );
197  setCaloEta( clPtr->eta() );
198  setCaloPhi( clPtr->phi() );
199 
200  // EThad
201  if( caloEta() != 0 ) {
202  const float ehad = clPtr->ehad1();
203  const float cl_EThad = ehad / std::cosh( std::abs( caloEta() ) ); // Ehad1/cosh(fabs(eta) */
204  setEtHad( cl_EThad );
205  setEtHad1( cl_EThad );
206  } else {
207  setEtHad( clPtr->ehad1() ); // Ehad1 (=EThad)
208  setEtHad1( clPtr->ehad1() ); // Ehad (=EThad1)
209  }
210 
211  // Rcore (test for positive energy to avoid zeros)
212  const float e277 = clPtr->e277();
213  const float e237 = clPtr->e237();
214  if( e277 != 0 ) { // (VD) before it was '>'
215  setRcore( e237 / e277 );
216  } else {
217  setRcore( 0 );
218  }
219 
220  // Eratio (test for positive energy to avoid zeros)
221  const float emaxs1 = clPtr->emaxs1();
222  const float e2tsts1 = clPtr->e2tsts1();
223  if( emaxs1 + e2tsts1 > 0 ) {
224  const float cl_Eratio = ( ( emaxs1 - e2tsts1 ) /
225  ( emaxs1 + e2tsts1 ) );
226  setEratio( cl_Eratio );
227  } else {
228  setEratio( 0 );
229  }
230 
231  // energy and energy fraction per sample
232  const float tmp_cl_energy = clPtr->energy();
233 
234  if( std::abs( tmp_cl_energy ) > 0.00001 ) { // avoid floating-point exceptions
235 
236  const float cl_e_frac_S0 =
237  ( clPtr->energy( CaloSampling::PreSamplerB ) +
238  clPtr->energy( CaloSampling::PreSamplerE ) ) / tmp_cl_energy;
239  setF0( cl_e_frac_S0 );
240 
241  const float cl_e_frac_S1 =
242  ( clPtr->energy( CaloSampling::EMB1 ) +
243  clPtr->energy( CaloSampling::EME1 ) ) / tmp_cl_energy;
244  setF1( cl_e_frac_S1 );
245 
246  const float cl_e_frac_S2 =
247  ( clPtr->energy( CaloSampling::EMB2 ) +
248  clPtr->energy( CaloSampling::EME2 ) ) / tmp_cl_energy;
249  setF2( cl_e_frac_S2 );
250 
251  const float cl_e_frac_S3 =
252  ( clPtr->energy( CaloSampling::EMB3 ) +
253  clPtr->energy( CaloSampling::EME3 ) ) / tmp_cl_energy;
254  setF3( cl_e_frac_S3 );
255 
256  setFside( clPtr->fracs1() );
257  setWeta2( clPtr->weta2() );
258 
259  } else {
260  setF0( 0 );
261  setF1( 0 );
262  setF2( 0 );
263  setF3( 0 );
264 
265  setFside( 0 );
266  setWeta2( 0 );
267  }
268 
269  }
270 
271  return;
272  }
273 
274 } // namespace xAOD
xAOD::TrigPhoton_v1::GenVecFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for egamma.
Definition: TrigPhoton_v1.h:64
xAOD::TrigEMCluster_v1::emaxs1
float emaxs1() const
get maximum energy in sampling 1 (strip layer)
xAOD::TrigPhoton_v1::genvecP4
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : internal egamma type.
Definition: TrigPhoton_v1.cxx:64
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::eratio
setCharge setNTRTHiThresholdHits eratio
Definition: TrigElectron_v1.cxx:96
xAOD::TrigPhoton_v1::setCaloEta
void setCaloEta(float caloEta)
Set the pseudorapidity ( ) of the photon in the calorimeter.
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
TrigPhoton_v1.h
xAOD::TrigPhoton_v1::init
void init(uint32_t roi, float dphi, float deta, const EMClusterLink_t &clLink)
Initialisation function, setting most properties of the object.
xAOD::TrigPhoton_v1::setDEta
void setDEta(float dEta)
Documentation to be added.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
xAOD::TrigPhoton_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: TrigPhoton_v1.h:52
AuxStoreAccessorMacros.h
xAOD::TrigEMCluster_v1::weta2
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::TrigEMCluster_v1::e2tsts1
float e2tsts1() const
get second maximum energy in sampling 1 (strip layer)
xAOD::TrigPhoton_v1::setF0
void setF0(float f0)
Documentation to be added.
xAOD::TrigPhoton_v1::TrigPhoton_v1
TrigPhoton_v1()
Default constructor.
Definition: TrigPhoton_v1.cxx:18
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::pt
setRcore setEtHad setFside pt
Definition: TrigPhoton_v1.cxx:106
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::TrigPhoton_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: TrigPhoton_v1.h:50
xAOD::TrigPhoton_v1::rapidity
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition: TrigPhoton_v1.cxx:47
xAOD::TrigPhoton_v1::setF1
void setF1(float f1)
Documentation to be added.
xAOD::TrigEMCluster_v1::e237
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell
xAOD::etHad
setRcore etHad
Definition: TrigPhoton_v1.cxx:83
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
read_hist_ntuple.f2
f2
Definition: read_hist_ntuple.py:20
xAOD::TrigPhoton_v1::setRoiWord
void setRoiWord(uint32_t roi)
Set the RoI word that seeded the reconstruction of this object.
xAOD::EgammaParameters::f3
@ f3
fraction of energy reconstructed in 3rd sampling
Definition: EgammaEnums.h:54
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
xAOD::TrigPhoton_v1::setPt
void setPt(double pt)
Set the transverse momentum ( ) of the photon.
xAOD::TrigPhoton_v1::setCaloPhi
void setCaloPhi(float caloPhi)
Set the azimuthal angle ( ) of the photon in the calorimeter.
xAOD::AUXSTORE_PRIMITIVE_SETTER_WITH_CAST
AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1, float, double, px, setPx) AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1
xAOD::TrigEMCluster_v1::phi
float phi() const
get Phi (calibrated)
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
xAOD::e2tsts1
setEt setPhi setE277 setWeta2 setEta1 e2tsts1
Definition: TrigEMCluster_v1.cxx:45
xAOD::AUXSTORE_PRIMITIVE_GETTER_WITH_CAST
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(Muon_v1, uint8_t, Muon_v1::EnergyLossType, energyLossType) AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(Muon_v1
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
xAOD::TrigPhoton_v1::e
virtual double e() const
The total energy of the particle.
Definition: TrigPhoton_v1.cxx:36
xAOD::TrigPhoton_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TrigPhoton_v1.cxx:57
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
xAOD::TrigPhoton_v1::setF3
void setF3(float f3)
Documentation to be added.
xAOD::e277
setEt setPhi e277
Definition: TrigEMCluster_v1.cxx:33
xAOD::fside
setRcore setEtHad fside
Definition: TrigPhoton_v1.cxx:93
xAOD::caloPhi
setRcore setEtHad setFside setPt caloPhi
Definition: TrigPhoton_v1.cxx:111
xAOD::TrigPhoton_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
xAOD::TrigEMCluster_v1::fracs1
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
xAOD::TrigPhoton_v1
Class describing a photon reconstructed in the HLT.
Definition: TrigPhoton_v1.h:38
xAOD::etHad1
setCharge setNTRTHiThresholdHits setEratio etHad1
Definition: TrigElectron_v1.cxx:100
xAOD::weta2
setEt setPhi setE277 weta2
Definition: TrigEMCluster_v1.cxx:37
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
xAOD::TrigEMCluster_v1::e277
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
xAOD::TrigPhoton_v1::caloEta
float caloEta() const
Pseudorapidity ( ) of the photon in the calorimeter.
xAOD::TrigPhoton_v1::setRcore
void setRcore(float Reta)
Documentation to be added.
xAOD::TrigPhoton_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: TrigPhoton_v1.h:54
xAOD::TrigPhoton_v1::setF2
void setF2(float f2)
Documentation to be added.
xAOD::TrigPhoton_v1::setEratio
void setEratio(float Eratio)
Documentation to be added.
xAOD::TrigEMCluster_v1::ehad1
float ehad1() const
get hadronic Energy (first hadronic layer)
xAOD::rcore
rcore
Definition: TrigPhoton_v1.cxx:79
xAOD::TrigPhoton_v1::setWeta2
void setWeta2(float Weta2)
Documentation to be added.
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
xAOD::TrigPhoton_v1::setEtHad1
void setEtHad1(float HadEt)
Documentation to be added.
xAOD::TrigPhoton_v1::setDPhi
void setDPhi(float dPhi)
Documentation to be added.
xAOD::TrigEMCluster_v1::et
float et() const
get Et (calibrated)
xAOD::EgammaParameters::e237
@ e237
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
Definition: EgammaEnums.h:77
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
xAOD::TrigPhoton_v1::setFside
void setFside(float fside)
Documentation to be added.
xAOD::TrigPhoton_v1::setEtHad
void setEtHad(float HadEt)
Documentation to be added.
xAOD::EgammaParameters::emaxs1
@ emaxs1
energy of strip with maximal energy deposit
Definition: EgammaEnums.h:145
xAOD::TrigPhoton_v1::setEmClusterLink
void setEmClusterLink(const EMClusterLink_t &value)
Set the ElementLink pointing to the EM cluster constituent.
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4