ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace xAOD {
17
22
24 //
25 // Implementation of the functions inherited from IParticle
26 //
27
29
30
37
38 return genvecP4().E();
39 }
40
47 double TrigPhoton_v1::rapidity() const {
48
49 return genvecP4().Rapidity();
50 }
51
59 p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
60 return p4;
61 }
62
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
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
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
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
IParticle()=default
TLorentzVector FourMom_t
Definition of the 4-momentum type.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
float e2tsts1() const
get second maximum energy in sampling 1 (strip layer)
float et() const
get Et (calibrated)
float eta() const
get Eta (calibrated)
float emaxs1() const
get maximum energy in sampling 1 (strip layer)
float phi() const
get Phi (calibrated)
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
float ehad1() const
get hadronic Energy (first hadronic layer)
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
float energy() const
get Energy (calibrated)
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
Class describing a photon reconstructed in the HLT.
const TrigEMCluster * emCluster() const
The associated EM cluster, as a simple pointer.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for egamma.
void setFside(float fside)
Documentation to be added.
void setF1(float f1)
Documentation to be added.
void setF3(float f3)
Documentation to be added.
void setRoiWord(uint32_t roi)
Set the RoI word that seeded the reconstruction of this object.
void setF0(float f0)
Documentation to be added.
ElementLink< TrigEMClusterContainer > EMClusterLink_t
Type of the EM cluster link.
void setPt(double pt)
Set the transverse momentum ( ) of the photon.
TrigPhoton_v1()
Default constructor.
virtual double m() const
The invariant mass of the particle.
void setEtHad1(float HadEt)
Documentation to be added.
void setDPhi(float dPhi)
Documentation to be added.
virtual double eta() const
The pseudorapidity ( ) of the particle.
void setRcore(float Reta)
Documentation to be added.
void init(uint32_t roi, float dphi, float deta, const EMClusterLink_t &clLink)
Initialisation function, setting most properties of the object.
void setEtHad(float HadEt)
Documentation to be added.
virtual double rapidity() const
The true rapidity (y) of the particle.
void setWeta2(float Weta2)
Documentation to be added.
virtual double e() const
The total energy of the particle.
float caloEta() const
Pseudorapidity ( ) of the photon in the calorimeter.
virtual double pt() const
The transverse momentum ( ) of the particle.
void setDEta(float dEta)
Documentation to be added.
void setCaloPhi(float caloPhi)
Set the azimuthal angle ( ) of the photon in the calorimeter.
void setEmClusterLink(const EMClusterLink_t &value)
Set the ElementLink pointing to the EM cluster constituent.
virtual double phi() const
The azimuthal angle ( ) of the particle.
void setEratio(float Eratio)
Documentation to be added.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
void setCaloEta(float caloEta)
Set the pseudorapidity ( ) of the photon in the calorimeter.
void setF2(float f2)
Documentation to be added.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : internal egamma type.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad fside
setRcore setEtHad setFside pt
AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1, float, double, px, setPx) AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1
setEt setPhi setE277 weta2
setEt setPhi setE277 setWeta2 setEta1 e2tsts1
setRcore setEtHad setFside setPt caloPhi
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
setCharge setNTRTHiThresholdHits setEratio etHad1
setRcore etHad
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
setEt setPhi e277
setEventNumber uint32_t
setCharge setNTRTHiThresholdHits eratio