ATLAS Offline Software
AFPProton_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
14 // xAOD include(s):
16 
17 // Local include(s):
19 
20 namespace xAOD {
21 
23 
24  double AFPProton_v1::pt() const {
25 
26  return p4().Pt();
27  }
28 
29  double AFPProton_v1::eta() const {
30 
31  return p4().Eta();
32  }
33 
34  double AFPProton_v1::phi() const {
35 
36  return p4().Phi();
37  }
38 
39  double AFPProton_v1::m() const {
40 
41  return p4().M();
42  }
43 
45 
46  double AFPProton_v1::rapidity() const {
47 
48  return p4().Rapidity();
49  }
50 
52 
53  FourMom_t p4;
54  p4.SetPxPyPzE( px(), py(), pz(), e() );
55 
56  return p4;
57  }
58 
60 
61  return Type::Particle;
62  }
63 
67 
68  void AFPProton_v1::setPxPyPzE( float px, float py, float pz, float e ) {
69 
70  setPx( px );
71  setPy( py );
72  setPz( pz );
73  setE( e );
74 
75  return;
76  }
77 
78  void AFPProton_v1::setPx( float value ) {
79 
80  static const Accessor< float > acc( "px" );
81  acc( *this ) = value;
82  return;
83  }
84 
85  void AFPProton_v1::setPy( float value ) {
86 
87  static const Accessor< float > acc( "py" );
88  acc( *this ) = value;
89  return;
90  }
91 
92  void AFPProton_v1::setPz( float value ) {
93 
94  static const Accessor< float > acc( "pz" );
95  acc( *this ) = value;
96  return;
97  }
98 
99  void AFPProton_v1::setE( float value ) {
100 
101  static const Accessor< float > acc( "e" );
102  acc( *this ) = value;
103  return;
104  }
105 
109  setMethodID )
110 
112  std::vector< AFPProton_v1::AFPTrackLink_t >,
113  afpTrackLinks, setAFPTrackLinks )
114 
116  static const
117  SG::AuxElement::Accessor< std::vector< AFPProton_v1::AFPTrackLink_t > >
118  tracksAcc( "afpTrackLinks" );
119 
120  void AFPProton_v1::addAFPTrackLink( const AFPTrackLink_t& newTrack ) {
121 
122  tracksAcc( *this ).push_back( newTrack );
123  return;
124  }
125 
126  size_t AFPProton_v1::nTracks() const {
127 
128  // Check if the links are available:
129  if( ! tracksAcc.isAvailable( *this ) ) {
130  return 0;
131  }
132 
133  return tracksAcc( *this ).size();
134  }
135 
136  const AFPTrack* AFPProton_v1::track( size_t index ) const {
137 
138  // Check if the links are available:
139  if( ! tracksAcc.isAvailable( *this ) ) {
140  return nullptr;
141  }
142 
143  // Use the at(...) function so the code would throw an exception if an
144  // impossible index is requested:
145  auto link = tracksAcc( *this ).at( index );
146 
147  // Check if the link can be de-referenced:
148  if( ! link.isValid() ) {
149  return nullptr;
150  }
151 
152  // Return the pointer:
153  return *link;
154  }
155 
156 } // 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::AFPTrack_v2
Class representing a track reconstructed in AFP.
Definition: AFPTrack_v2.h:37
test_pyathena.px
px
Definition: test_pyathena.py:18
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::Accessor< float >
AuxStoreAccessorMacros.h
index
Definition: index.py:1
athena.value
value
Definition: athena.py:124
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::AFPProton_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: AFPProton_v1.cxx:39
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::AFPProton_v1::track
const AFPTrack * track(size_t index) const
Get one of the tracks that was used to reconstruct the proton.
Definition: AFPProton_v1.cxx:136
xAOD::py
py
Definition: CompositeParticle_v1.cxx:160
xAOD::Particle
Particle_v1 Particle
Define the latest version of the particle class.
Definition: Event/xAOD/xAODParticleEvent/xAODParticleEvent/Particle.h:17
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
TRT::Hit::side
@ side
Definition: HitInfo.h:83
xAOD::AFPProton_v1::e
virtual double e() const
The total energy of the particle.
JetVar::Accessor
SG::AuxElement::Accessor< T > Accessor
Definition: JetVariable.h:31
xAOD::AFPProton_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: AFPProton_v1.cxx:51
xAOD::AFPProton_v1::setPx
void setPx(float px)
Set the x-component of the momentum.
Definition: AFPProton_v1.cxx:78
xAOD::AFPProton_v1::py
float py() const
Get the y-component of the momentum.
xAOD::e
setPy e
Definition: CompositeParticle_v1.cxx:166
vector
Definition: MultiHisto.h:13
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
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
AFPProton_v1.h
Header file for AFPProton_v1 class representing a reconstructed proton measured in AFP detectors.
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
xAOD::afpTrackLinks
afpTrackLinks
Definition: AFPProton_v1.cxx:113
xAOD::AFPProton_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: AFPProton_v1.cxx:24
xAOD::AFPProton_v1::setPy
void setPy(float py)
Set the y-component of the momentum.
Definition: AFPProton_v1.cxx:85
xAOD::AFPProton_v1::setPz
void setPz(float pz)
Set the z-component of the momentum.
Definition: AFPProton_v1.cxx:92
xAOD::AFPProton_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: AFPProton_v1.cxx:29
xAOD::AFPProton_v1::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition: AFPProton_v1.h:62
xAOD::AFPProton_v1::AFPProton_v1
AFPProton_v1()
Default constructor.
Definition: AFPProton_v1.cxx:22
AUXSTORE_PRIMITIVE_GETTER
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
Definition: AuxStoreAccessorMacros.h:59
xAOD::AFPProton_v1
Class representing a proton reconstructed in AFP.
Definition: AFPProton_v1.h:36
xAOD::AFPProton_v1::nTracks
size_t nTracks() const
Get the number of tracks that were used to reconstruct the proton.
Definition: AFPProton_v1.cxx:126
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition: ObjectType.h:32
xAOD::AFPProton_v1::px
float px() const
Get the x-component of the momentum.
xAOD::AFPProton_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle (has range to .)
Definition: AFPProton_v1.cxx:34
xAOD::AFPProton_v1::type
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition: AFPProton_v1.cxx:59
xAOD::AFPProton_v1::setE
void setE(float e)
Set the energy.
Definition: AFPProton_v1.cxx:99
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::AFPProton_v1::pz
float pz() const
Get the z-component of the momentum.