ATLAS Offline Software
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 
13 namespace xAOD{
14 
16  IParticle()
17  {
18  }
19 
21  IParticle( other )
22  {
23  }
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  {
256  FourMom_t p4;
257  p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
258  return p4;
259  }
260 
263  return GenVecFourMom_t(pt(), eta(), phi(), m());
264  }
265 
267  {
268  return Type::Jet;
269  }
270 
271 } // namespace xAOD
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::TriggerTower_v2::TriggerTower_v2
TriggerTower_v2()
Default constructor.
Definition: TriggerTower_v2.cxx:15
xAOD::TriggerTower_v2::rapidity
virtual double rapidity() const final
The true rapidity (y) of the particle.
Definition: TriggerTower_v2.cxx:249
xAOD::TriggerTower_v2::cpET
uint8_t cpET() const
get cpET from peak of lut_cp
Definition: TriggerTower_v2.cxx:180
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
xAOD::TriggerTower_v2::phi
virtual double phi() const final
The azimuthal angle ( ) of the particle.
Definition: TriggerTower_v2.cxx:222
SG::Accessor< float >
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
xAOD::TriggerTower_v2::isCpSaturated
bool isCpSaturated() const
Is tower saturated?
Definition: TriggerTower_v2.cxx:196
TriggerTower_v2.h
xAOD::TriggerTower_v2::lut_cp
const std::vector< uint8_t > & lut_cp() const
get lut_cp
xAOD::TriggerTower_v2::operator=
TriggerTower_v2 & operator=(const TriggerTower_v2 &other)
Assignment operator.
Definition: TriggerTower_v2.cxx:25
initialize
void initialize()
Definition: run_EoverP.cxx:894
AUXSTORE_OBJECT_MOVE
#define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER)
Macro creating a move accessor for complex auxiliary properties.
Definition: AuxStoreAccessorMacros.h:101
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
xAOD::TriggerTower_v2::type
virtual Type::ObjectType type() const final
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
Definition: TriggerTower_v2.cxx:266
xAOD::TriggerTower_v2::setBcidVec
void setBcidVec(const std::vector< uint8_t > &)
set bcidVec
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TriggerTower_v2::lut_jep
const std::vector< uint8_t > & lut_jep() const
get lut_jep
Phi
@ Phi
Definition: RPCdef.h:8
xAOD::TriggerTower_v2::setAdcPeak
void setAdcPeak(uint8_t)
set adcPeak
xAOD::TriggerTower_v2::sampling
int sampling() const
get sampling ( 0 = EM, 1 = Had )
Definition: TriggerTower_v2.cxx:150
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
xAOD::TriggerTower_v2::setEta
void setEta(float)
Definition: TriggerTower_v2.cxx:216
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::TriggerTower_v2::setAdc
void setAdc(const std::vector< uint16_t > &)
set adc
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:68
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
xAOD::TriggerTower_v2::initialize
virtual void initialize(const uint32_t CoolId, const float Eta, const float Phi)
initialize
Definition: TriggerTower_v2.cxx:60
xAOD::TriggerTower_v2::setPhi
void setPhi(float)
Definition: TriggerTower_v2.cxx:228
xAOD::TriggerTower_v2::setPeak
void setPeak(uint8_t)
set peak
xAOD::TriggerTower_v2::setCoolId
void setCoolId(uint32_t)
set coolID
xAOD::TriggerTower_v2::setErrorWord
void setErrorWord(uint32_t)
set error
xAOD::TriggerTower_v2::pt
virtual double pt() const final
The transverse momentum ( ) of the particle.
Definition: TriggerTower_v2.cxx:234
xAOD::TriggerTower_v2::layer
int layer() const
get layer ( 0 = EM, 1 = Had, 2 = FCAL23) - to be confirmed
Definition: TriggerTower_v2.cxx:121
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
xAOD::TriggerTower_v2::eta
virtual double eta() const final
The pseudorapidity ( ) of the particle.
Definition: TriggerTower_v2.cxx:210
xAOD::TriggerTower_v2::coolId
uint32_t coolId() const
Tower identifiers.
xAOD::TriggerTower_v2::m_saturation
static const uint8_t m_saturation
Definition: TriggerTower_v2.h:224
xAOD::TriggerTower_v2::setCorrection
void setCorrection(const std::vector< int16_t > &)
set correction
xAOD::TriggerTower_v2::setSat80Vec
void setSat80Vec(const std::vector< uint8_t > &)
set sat80Vec
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
xAOD::TriggerTower_v2::setLut_cp
void setLut_cp(const std::vector< uint8_t > &)
set lut_cp
xAOD::TriggerTower_v2::setLut_jep
void setLut_jep(const std::vector< uint8_t > &)
set lut_jep
xAOD::TriggerTower_v2::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition: TriggerTower_v2.h:85
xAOD::TriggerTower_v2::peak
uint8_t peak() const
get peak
xAOD::TriggerTower_v2::genvecP4
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector type.
Definition: TriggerTower_v2.cxx:262
SG::AuxElement::hasStore
bool hasStore() const
Return true if this object has an associated store.
Definition: AuxElement.cxx:355
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
xAOD::TriggerTower_v2::setCorrectionEnabled
void setCorrectionEnabled(const std::vector< uint8_t > &)
set correctionEnabled
xAOD::TriggerTower_v2::isJepSaturated
bool isJepSaturated() const
Definition: TriggerTower_v2.cxx:201
xAOD::TriggerTower_v2::setBcidExt
void setBcidExt(const std::vector< uint8_t > &)
set bcidExt
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition: ObjectType.h:32
xAOD::TriggerTower_v2::p4
virtual FourMom_t p4() const final
The full 4-momentum of the particle as a TLoretzVector.
Definition: TriggerTower_v2.cxx:254
xAOD::TriggerTower_v2::jepET
uint8_t jepET() const
get jepET from peak of lut_jep
Definition: TriggerTower_v2.cxx:186
xAOD::IParticle::operator=
IParticle & operator=(const IParticle &)=default
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
Eta
@ Eta
Definition: RPCdef.h:8
xAOD::TriggerTower_v2::m
virtual double m() const final
The invariant mass of the particle.
Definition: TriggerTower_v2.cxx:239
xAOD::TriggerTower_v2::GenVecFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for trigger tower.
Definition: TriggerTower_v2.h:91
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27
xAOD::TriggerTower_v2::e
virtual double e() const final
The total energy of the particle.
Definition: TriggerTower_v2.cxx:244