ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::AFPProton_v1 Class Reference

Class representing a proton reconstructed in AFP. More...

#include <AFPProton_v1.h>

Inheritance diagram for xAOD::AFPProton_v1:
Collaboration diagram for xAOD::AFPProton_v1:

Public Types

typedef ElementLink< AFPTrackContainerAFPTrackLink_t
 Type of the track links.

Public Member Functions

 AFPProton_v1 ()
 Default constructor.
float chi2 () const
 Get the value of \(\chi^2\) function.
void setChi2 (float chi2)
 Set the value of \(\chi^2\) function.
int side () const
 Get the ATLAS side on which the proton was measured.
void setSide (int side)
 Set the ATLAS side on which the proton was measured.
int methodID () const
 Get the ID of method used to reconstruct the proton.
void setMethodID (int methodID)
 Set the ID of method used to reconstruct the proton.
4-momentum functions
float px () const
 Get the x-component of the momentum.
float py () const
 Get the y-component of the momentum.
float pz () const
 Get the z-component of the momentum.
void setPxPyPzE (float px, float py, float pz, float e)
 Set the 4-momentum.
void setPx (float px)
 Set the x-component of the momentum.
void setPy (float py)
 Set the y-component of the momentum.
void setPz (float pz)
 Set the z-component of the momentum.
void setE (float e)
 Set the energy.
Associated track handling functions
const std::vector< AFPTrackLink_t > & afpTrackLinks () const
 Get vector of links to tracks that were used to reconstruct the proton.
void setAFPTrackLinks (const std::vector< AFPTrackLink_t > &newTracksVector)
 Set vector of links to tracks used for proton reconstruction.
void addAFPTrackLink (const AFPTrackLink_t &newTrack)
 Add a link to a tracks used to reconstruct the proton.
size_t nTracks () const
 Get the number of tracks that were used to reconstruct the proton.
const AFPTracktrack (size_t index) const
 Get one of the tracks that was used to reconstruct the proton.
Functions for getting and setting user properties
template<class T>
XAOD_AUXDATA_DEPRECATED T & auxdata (const std::string &name, const std::string &clsname="")
 Fetch an aux data variable, as a non-const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED const T & auxdata (const std::string &name, const std::string &clsname="") const
 Fetch an aux data variable, as a const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for reading or not.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for writing or not.

IParticle functions

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
virtual double pt () const
 The transverse momentum ( \(p_T\)) of the particle.
virtual double eta () const
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const
 The azimuthal angle ( \(\phi\)) of the particle (has range \(-\pi\) to \(+\pi\).).
virtual double m () const
 The invariant mass of the particle.
virtual double e () const
 The total energy of the particle.
virtual double rapidity () const
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const
 The full 4-momentum of the particle.
virtual Type::ObjectType type () const
 The type of the object as a simple enumeration.

Detailed Description

Class representing a proton reconstructed in AFP.

This class provides information about a reconstucted proton measured in AFP detectors.

Definition at line 36 of file AFPProton_v1.h.

Member Typedef Documentation

◆ AFPTrackLink_t

Type of the track links.

Definition at line 43 of file AFPProton_v1.h.

◆ FourMom_t

Definition of the 4-momentum type.

Definition at line 62 of file AFPProton_v1.h.

Constructor & Destructor Documentation

◆ AFPProton_v1()

xAOD::AFPProton_v1::AFPProton_v1 ( )

Default constructor.

Definition at line 22 of file AFPProton_v1.cxx.

22: IParticle() {}
IParticle()=default

Member Function Documentation

◆ addAFPTrackLink()

void xAOD::AFPProton_v1::addAFPTrackLink ( const AFPTrackLink_t & newTrack)

Add a link to a tracks used to reconstruct the proton.

Definition at line 120 of file AFPProton_v1.cxx.

120 {
121
122 tracksAcc( *this ).push_back( newTrack );
123 return;
124 }
static setAFPTrackLinks const SG::AuxElement::Accessor< std::vector< AFPProton_v1::AFPTrackLink_t > > tracksAcc("afpTrackLinks")
Helper variable.

◆ afpTrackLinks()

const std::vector< AFPTrackLink_t > & xAOD::AFPProton_v1::afpTrackLinks ( ) const

Get vector of links to tracks that were used to reconstruct the proton.

◆ auxdata() [1/2]

template<class T>
XAOD_AUXDATA_DEPRECATED T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" )
inlineinherited

Fetch an aux data variable, as a non-const reference.

This function provides an easy way for users to decorate objects with auxiliary data.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A modifiable reference to the decoration

Definition at line 98 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

99 {
100
101 return SG::Accessor< T >(name, clsname)(*this);
102 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ auxdata() [2/2]

template<class T>
XAOD_AUXDATA_DEPRECATED const T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Fetch an aux data variable, as a const reference.

This function provides an easy way for users to retrieve auxiliary decorations from an object.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A constant reference to the decoration

Definition at line 118 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

119 {
120
121 return SG::ConstAccessor< T >( name, clsname )( *this );
122 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570

◆ chi2()

float xAOD::AFPProton_v1::chi2 ( ) const

Get the value of \(\chi^2\) function.

◆ e()

virtual double xAOD::AFPProton_v1::e ( ) const
virtual

The total energy of the particle.

Implements xAOD::IParticle.

◆ eta()

double xAOD::AFPProton_v1::eta ( ) const
virtual

The pseudorapidity ( \(\eta\)) of the particle.

Implements xAOD::IParticle.

Definition at line 29 of file AFPProton_v1.cxx.

29 {
30
31 return p4().Eta();
32 }
virtual FourMom_t p4() const
The full 4-momentum of the particle.

◆ isAvailable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for reading or not.

This function should be used to check if a user property which may or may not exist, is set on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration exists or not

Definition at line 135 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

136 {
137
138 return SG::ConstAccessor< T >(name, clsname).isAvailable(*this);
139 }
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.

◆ isAvailableWritable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for writing or not.

This function can be used to check whether it will be possible to set a user property on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration is possible to set

Definition at line 152 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

153 {
154
155 return SG::Accessor< T >(name, clsname).isAvailableWritable(*this);
156 }
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.

◆ m()

double xAOD::AFPProton_v1::m ( ) const
virtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 39 of file AFPProton_v1.cxx.

39 {
40
41 return p4().M();
42 }

◆ methodID()

int xAOD::AFPProton_v1::methodID ( ) const

Get the ID of method used to reconstruct the proton.

◆ nTracks()

size_t xAOD::AFPProton_v1::nTracks ( ) const

Get the number of tracks that were used to reconstruct the proton.

Definition at line 126 of file AFPProton_v1.cxx.

126 {
127
128 // Check if the links are available:
129 if( ! tracksAcc.isAvailable( *this ) ) {
130 return 0;
131 }
132
133 return tracksAcc( *this ).size();
134 }

◆ p4()

AFPProton_v1::FourMom_t xAOD::AFPProton_v1::p4 ( ) const
virtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 51 of file AFPProton_v1.cxx.

51 {
52
54 p4.SetPxPyPzE( px(), py(), pz(), e() );
55
56 return p4;
57 }
float pz() const
Get the z-component of the momentum.
float py() const
Get the y-component of the momentum.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
virtual double e() const
The total energy of the particle.
float px() const
Get the x-component of the momentum.

◆ phi()

double xAOD::AFPProton_v1::phi ( ) const
virtual

The azimuthal angle ( \(\phi\)) of the particle (has range \(-\pi\) to \(+\pi\).).

Implements xAOD::IParticle.

Definition at line 34 of file AFPProton_v1.cxx.

34 {
35
36 return p4().Phi();
37 }

◆ pt()

double xAOD::AFPProton_v1::pt ( ) const
virtual

The transverse momentum ( \(p_T\)) of the particle.

Implements xAOD::IParticle.

Definition at line 24 of file AFPProton_v1.cxx.

24 {
25
26 return p4().Pt();
27 }

◆ px()

float xAOD::AFPProton_v1::px ( ) const

Get the x-component of the momentum.

◆ py()

float xAOD::AFPProton_v1::py ( ) const

Get the y-component of the momentum.

◆ pz()

float xAOD::AFPProton_v1::pz ( ) const

Get the z-component of the momentum.

◆ rapidity()

double xAOD::AFPProton_v1::rapidity ( ) const
virtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 46 of file AFPProton_v1.cxx.

46 {
47
48 return p4().Rapidity();
49 }

◆ setAFPTrackLinks()

void xAOD::AFPProton_v1::setAFPTrackLinks ( const std::vector< AFPTrackLink_t > & newTracksVector)

Set vector of links to tracks used for proton reconstruction.

◆ setChi2()

void xAOD::AFPProton_v1::setChi2 ( float chi2)

Set the value of \(\chi^2\) function.

◆ setE()

void xAOD::AFPProton_v1::setE ( float e)

Set the energy.

Definition at line 99 of file AFPProton_v1.cxx.

99 {
100
101 static const Accessor< float > acc( "e" );
102 acc( *this ) = value;
103 return;
104 }
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ setMethodID()

void xAOD::AFPProton_v1::setMethodID ( int methodID)

Set the ID of method used to reconstruct the proton.

◆ setPx()

void xAOD::AFPProton_v1::setPx ( float px)

Set the x-component of the momentum.

Definition at line 78 of file AFPProton_v1.cxx.

78 {
79
80 static const Accessor< float > acc( "px" );
81 acc( *this ) = value;
82 return;
83 }

◆ setPxPyPzE()

void xAOD::AFPProton_v1::setPxPyPzE ( float px,
float py,
float pz,
float e )

Set the 4-momentum.

Definition at line 68 of file AFPProton_v1.cxx.

68 {
69
70 setPx( px );
71 setPy( py );
72 setPz( pz );
73 setE( e );
74
75 return;
76 }
void setE(float e)
Set the energy.
void setPz(float pz)
Set the z-component of the momentum.
void setPx(float px)
Set the x-component of the momentum.
void setPy(float py)
Set the y-component of the momentum.

◆ setPy()

void xAOD::AFPProton_v1::setPy ( float py)

Set the y-component of the momentum.

Definition at line 85 of file AFPProton_v1.cxx.

85 {
86
87 static const Accessor< float > acc( "py" );
88 acc( *this ) = value;
89 return;
90 }

◆ setPz()

void xAOD::AFPProton_v1::setPz ( float pz)

Set the z-component of the momentum.

Definition at line 92 of file AFPProton_v1.cxx.

92 {
93
94 static const Accessor< float > acc( "pz" );
95 acc( *this ) = value;
96 return;
97 }

◆ setSide()

void xAOD::AFPProton_v1::setSide ( int side)

Set the ATLAS side on which the proton was measured.

◆ side()

int xAOD::AFPProton_v1::side ( ) const

Get the ATLAS side on which the proton was measured.

◆ track()

const AFPTrack * xAOD::AFPProton_v1::track ( size_t index) const

Get one of the tracks that was used to reconstruct the proton.

Definition at line 136 of file AFPProton_v1.cxx.

136 {
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 }
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ type()

Type::ObjectType xAOD::AFPProton_v1::type ( ) const
virtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 59 of file AFPProton_v1.cxx.

59 {
60
61 return Type::Particle;
62 }

The documentation for this class was generated from the following files: