ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerTower_v2.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: TriggerTower_v2.cxx 793304 2017-01-21 04:50:44Z ssnyder $
6
7// EDM includes(s):
9
10// Local include(s):
12
13namespace xAOD{
14
19
24
26 {
27 if( this != &other ){
28 if( !container() && !hasStore() ){
30 }
32 }
33 return *this;
34 }
35
36
37 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , lut_cp , setLut_cp )
38 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , lut_cp , setLut_cp )
39 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , lut_jep , setLut_jep )
40 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , lut_jep , setLut_jep )
41 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<int16_t> , correction , setCorrection )
42 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<int16_t> , correction , setCorrection )
43 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , correctionEnabled , setCorrectionEnabled )
44 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , correctionEnabled , setCorrectionEnabled )
45 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , bcidVec , setBcidVec )
46 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , bcidVec , setBcidVec )
47 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint16_t> , adc , setAdc )
48 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint16_t> , adc , setAdc )
49 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , bcidExt , setBcidExt )
50 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , bcidExt , setBcidExt )
51 AUXSTORE_OBJECT_SETTER_AND_GETTER( TriggerTower_v2 , std::vector<uint8_t> , sat80Vec , setSat80Vec )
52 AUXSTORE_OBJECT_MOVE( TriggerTower_v2 , std::vector<uint8_t> , sat80Vec , setSat80Vec )
57
58
59
60 void TriggerTower_v2::initialize(const uint32_t CoolId,const float Eta,const float Phi)
61 {
62 setCoolId( CoolId );
63 setEta( Eta );
64 setPhi( Phi );
65 }
66
67 void TriggerTower_v2::initialize(const uint32_t CoolId,const float Eta,const float Phi,
68 const std::vector<uint8_t>& Lut_cp,const std::vector<uint8_t>& Lut_jep,
69 const std::vector<int16_t>& Correction,const std::vector<uint8_t>& CorrectionEnabled,
70 const std::vector<uint8_t>& BcidVec,const std::vector<uint16_t>& Adc,
71 const std::vector<uint8_t>& BcidExt,const std::vector<uint8_t>& Sat80Vec,
72 const uint32_t ErrorWord,
73 const uint8_t Peak,
74 const uint8_t AdcPeak)
75 {
76 setCoolId( CoolId );
77 setEta( Eta );
78 setPhi( Phi );
79 setLut_cp( Lut_cp );
80 setLut_jep( Lut_jep );
81 setCorrection( Correction );
82 setCorrectionEnabled( CorrectionEnabled );
83 setBcidVec( BcidVec );
84 setAdc( Adc );
85 setBcidExt( BcidExt );
86 setSat80Vec( Sat80Vec );
87 setErrorWord( ErrorWord );
88 setPeak( Peak );
89 setAdcPeak( AdcPeak );
90 }
91
92 void TriggerTower_v2::initialize(const uint32_t CoolId,const float Eta,const float Phi,
93 std::vector<uint8_t>&& Lut_cp,
94 std::vector<uint8_t>&& Lut_jep,
95 std::vector<int16_t>&& Correction,
96 std::vector<uint8_t>&& CorrectionEnabled,
97 std::vector<uint8_t>&& BcidVec,
98 std::vector<uint16_t>&& Adc,
99 std::vector<uint8_t>&& BcidExt,
100 std::vector<uint8_t>&& Sat80Vec,
101 const uint32_t ErrorWord,
102 const uint8_t Peak,
103 const uint8_t AdcPeak)
104 {
105 setCoolId( CoolId );
106 setEta( Eta );
107 setPhi( Phi );
108 setLut_cp( std::move(Lut_cp) );
109 setLut_jep( std::move(Lut_jep) );
110 setCorrection( std::move(Correction) );
111 setCorrectionEnabled( std::move(CorrectionEnabled) );
112 setBcidVec( std::move(BcidVec) );
113 setAdc( std::move(Adc) );
114 setBcidExt( std::move(BcidExt) );
115 setSat80Vec( std::move(Sat80Vec) );
116 setErrorWord( ErrorWord );
117 setPeak( Peak );
118 setAdcPeak( AdcPeak );
119 }
120
122 {
123 unsigned int theCoolId = coolId();
124 unsigned int cnum = ( theCoolId >> 24 ) & 0x7;
125 unsigned int mnum = ( theCoolId >> 16 ) & 0xf;
126 // unsigned int chan = theCoolId & 0x3; // To be used for FCAL2,FCAL3 soon
127
128 if (cnum < 4) { // EMB,EMEC
129 return 0;
130 }
131 else if (cnum < 6) { // HEC,FCAL
132 if (mnum == 0) {
133 return 0; // FCAL1
134 }
135 else if (mnum == 8) { // FCAL2,FCAL3
136 // Detail to be determined (using chan): for now use layer 1
137 return 1;
138 }
139 else { // HEC
140 return 1;
141 }
142 }
143 else { // Tile
144 return 1;
145 }
146 // really shouldn't get this far
147 return 1;
148 }
149
151 {
152 unsigned int theCoolId = coolId();
153 unsigned int cnum = ( theCoolId >> 24 ) & 0x7;
154 unsigned int mnum = ( theCoolId >> 16 ) & 0xf;
155 // unsigned int chan = theCoolId & 0x3; // To be used for FCAL2,FCAL3 soon
156
157 if (cnum < 4) { // EMB,EMEC
158 return 0;
159 }
160 else if (cnum < 6) { // HEC,FCAL
161 if (mnum == 0) {
162 return 0; // FCAL1
163 }
164 else if (mnum == 8) { // FCAL2,FCAL3
165 // Detail to be determined (using chan): for now use layer 1
166 return 1;
167 }
168 else { // HEC
169 return 1;
170 }
171 }
172 else { // Tile
173 return 1;
174 }
175 // really shouldn't get this far
176 return 1;
177 }
178
181 {
182 return peak() < lut_cp().size()? lut_cp()[ peak() ]: 0;
183 }
184
187 {
188 return peak() < lut_jep().size()? lut_jep()[ peak() ]: 0;
189 }
190
192 // return true if the TriggerTower is saturated
193 // i.e. it has an energy greater than the saturation threshold
194 // otherwise, return false;
195
197 {
198 return cpET() >= m_saturation;
199 }
200
202 {
203 return jepET() >= m_saturation;
204 }
205
206
207 // IParticle interface
208
209
210 double TriggerTower_v2::eta() const
211 {
212 static const Accessor< float > acc( "eta" );
213 return acc( *this );
214 }
215
217 {
218 static const Accessor< float > acc( "eta" );
219 acc( *this ) = eta;
220 }
221
222 double TriggerTower_v2::phi() const
223 {
224 static const Accessor< float > acc( "phi" );
225 return acc( *this );
226 }
227
229 {
230 static const Accessor< float > acc( "phi" );
231 acc( *this ) = phi;
232 }
233
234 double TriggerTower_v2::pt() const
235 {
236 return static_cast< double >( jepET() );
237 }
238
239 double TriggerTower_v2::m() const
240 {
241 return 0.;
242 }
243
244 double TriggerTower_v2::e() const
245 {
246 return genvecP4().E();
247 }
248
250 {
251 return genvecP4().Rapidity();
252 }
253
255 {
257 p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
258 return p4;
259 }
260
265
266 Type::ObjectType TriggerTower_v2::type() const
267 {
268 return Type::Jet;
269 }
270
271} // namespace xAOD
#define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER)
Macro creating a move accessor for complex auxiliary properties.
#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.
void makePrivateStore()
Create a new (empty) private store for this object.
bool hasStore() const
Return true if this object has an associated store.
const SG::AuxVectorData * container() const
Return the container holding this element.
IParticle & operator=(const IParticle &)=default
IParticle()=default
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Description of TriggerTower_v2.
uint8_t cpET() const
get cpET from peak of lut_cp
void setPeak(uint8_t)
set peak
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
void setSat80Vec(const std::vector< uint8_t > &)
set sat80Vec
void setBcidVec(const std::vector< uint8_t > &)
set bcidVec
TriggerTower_v2 & operator=(const TriggerTower_v2 &other)
Assignment operator.
uint32_t coolId() const
Tower identifiers.
TriggerTower_v2()
Default constructor.
void setCorrectionEnabled(const std::vector< uint8_t > &)
set correctionEnabled
void setCorrection(const std::vector< int16_t > &)
set correction
virtual void initialize(const uint32_t CoolId, const float Eta, const float Phi)
initialize
virtual double rapidity() const final
The true rapidity (y) of the particle.
int sampling() const
get sampling ( 0 = EM, 1 = Had )
void setErrorWord(uint32_t)
set error
void setLut_cp(const std::vector< uint8_t > &)
set lut_cp
uint8_t peak() const
get peak
uint8_t jepET() const
get jepET from peak of lut_jep
virtual double eta() const final
The pseudorapidity ( ) of the particle.
bool isCpSaturated() const
Is tower saturated?
virtual Type::ObjectType type() const final
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
void setBcidExt(const std::vector< uint8_t > &)
set bcidExt
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for trigger tower.
virtual double e() const final
The total energy of the particle.
void setAdc(const std::vector< uint16_t > &)
set adc
virtual FourMom_t p4() const final
The full 4-momentum of the particle as a TLoretzVector.
void setLut_jep(const std::vector< uint8_t > &)
set lut_jep
void setAdcPeak(uint8_t)
set adcPeak
int layer() const
get layer ( 0 = EM, 1 = Had, 2 = FCAL23) - to be confirmed
virtual double pt() const final
The transverse momentum ( ) of the particle.
const std::vector< uint8_t > & lut_cp() const
get lut_cp
virtual double m() const final
The invariant mass of the particle.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector type.
void setCoolId(uint32_t)
set coolID
const std::vector< uint8_t > & lut_jep() const
get lut_jep
virtual double phi() const final
The azimuthal angle ( ) of the particle.
static const uint8_t m_saturation
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
setEventNumber uint32_t