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

Class describing a pile-up truth event in the MC record. More...

#include <TruthPileupEvent_v1.h>

Inheritance diagram for xAOD::TruthPileupEvent_v1:
Collaboration diagram for xAOD::TruthPileupEvent_v1:

Public Member Functions

 TruthPileupEvent_v1 ()
 Default constructor.
virtual Type::ObjectType type () const
 The type of the object as a simple enumeration.
void toPersistent ()
 Function making sure that the object is ready for persistification.

Access to all the particles associated with the event

const TruthParticleLinks_ttruthParticleLinks () const
 Get all the truth particles.
void setTruthParticleLinks (const TruthParticleLinks_t &plinks)
 Set all the truth particles.
size_t nTruthParticles () const
 Get the number of truth particles.
const TruthParticleLink_ttruthParticleLink (size_t index) const
 Get the link to one of the truth particles.
const TruthParticletruthParticle (size_t index) const
 Get a pointer to one of the truth particles.
void addTruthParticleLink (const TruthParticleLink_t &plink)
 Add one truth particle.
void clearTruthParticleLinks ()
 Remove all truth particles.
typedef ElementLink< TruthParticleContainerTruthParticleLink_t
 Type of a single truth particle link.
typedef std::vector< TruthParticleLink_tTruthParticleLinks_t
 Type of the truth particle links vector.

Access to all the vertices associated with the event

const TruthVertexLinks_ttruthVertexLinks () const
 Get all the truth vertices.
void setTruthVertexLinks (const TruthVertexLinks_t &links)
 Set all the truth vertices.
size_t nTruthVertices () const
 Get the number of truth vertices.
const TruthVertexLink_ttruthVertexLink (size_t index) const
 Get the link to one of the truth vertices.
const TruthVertextruthVertex (size_t index) const
 Get a pointer to one of the truth vertices.
void addTruthVertexLink (const TruthVertexLink_t &vlink)
 Add one truth vertex.
void clearTruthVertexLinks ()
 Remove all truth vertices.
typedef ElementLink< TruthVertexContainerTruthVertexLink_t
 Type of a single truth vertex link.
typedef std::vector< TruthVertexLink_tTruthVertexLinks_t
 Type of the truth particle links vector.

Detailed Description

Class describing a pile-up truth event in the MC record.

Author
Andy Buckley Andy..nosp@m.Buck.nosp@m.ley@c.nosp@m.ern..nosp@m.ch
Jovan Mitrevski Jovan.nosp@m..Mit.nosp@m.revsk.nosp@m.i@ce.nosp@m.rn.ch
Revision
622193
Date
2014-10-16 18:08:34 +0200 (Thu, 16 Oct 2014)

Definition at line 23 of file TruthPileupEvent_v1.h.

Member Typedef Documentation

◆ TruthParticleLink_t

Type of a single truth particle link.

Definition at line 48 of file TruthEventBase_v1.h.

◆ TruthParticleLinks_t

Type of the truth particle links vector.

Definition at line 50 of file TruthEventBase_v1.h.

◆ TruthVertexLink_t

Type of a single truth vertex link.

Definition at line 73 of file TruthEventBase_v1.h.

◆ TruthVertexLinks_t

Type of the truth particle links vector.

Definition at line 75 of file TruthEventBase_v1.h.

Constructor & Destructor Documentation

◆ TruthPileupEvent_v1()

xAOD::TruthPileupEvent_v1::TruthPileupEvent_v1 ( )

Default constructor.

Definition at line 12 of file TruthPileupEvent_v1.cxx.

14
15 }
TruthEventBase_v1()
Default constructor.

Member Function Documentation

◆ addTruthParticleLink()

void xAOD::TruthEventBase_v1::addTruthParticleLink ( const TruthParticleLink_t & plink)
inherited

Add one truth particle.

Definition at line 68 of file TruthEventBase_v1.cxx.

68 {
69
70 truthParticleLinksAcc( *this ).push_back( link );
71 return;
72 }

◆ addTruthVertexLink()

void xAOD::TruthEventBase_v1::addTruthVertexLink ( const TruthVertexLink_t & vlink)
inherited

Add one truth vertex.

Definition at line 129 of file TruthEventBase_v1.cxx.

129 {
130
131 truthVertexLinksAcc( *this ).push_back( link );
132 return;
133 }

◆ clearTruthParticleLinks()

void xAOD::TruthEventBase_v1::clearTruthParticleLinks ( )
inherited

Remove all truth particles.

Definition at line 74 of file TruthEventBase_v1.cxx.

74 {
75
76 truthParticleLinksAcc( *this ).clear();
77 return;
78 }

◆ clearTruthVertexLinks()

void xAOD::TruthEventBase_v1::clearTruthVertexLinks ( )
inherited

Remove all truth vertices.

Definition at line 135 of file TruthEventBase_v1.cxx.

135 {
136
137 truthVertexLinksAcc( *this ).clear();
138 return;
139 }

◆ nTruthParticles()

size_t xAOD::TruthEventBase_v1::nTruthParticles ( ) const
inherited

Get the number of truth particles.

◆ nTruthVertices()

size_t xAOD::TruthEventBase_v1::nTruthVertices ( ) const
inherited

Get the number of truth vertices.

◆ setTruthParticleLinks()

void xAOD::TruthEventBase_v1::setTruthParticleLinks ( const TruthParticleLinks_t & plinks)
inherited

Set all the truth particles.

◆ setTruthVertexLinks()

void xAOD::TruthEventBase_v1::setTruthVertexLinks ( const TruthVertexLinks_t & links)
inherited

Set all the truth vertices.

◆ toPersistent()

void xAOD::TruthEventBase_v1::toPersistent ( )
inherited

Function making sure that the object is ready for persistification.

Definition at line 143 of file TruthEventBase_v1.cxx.

143 {
144
145 // Prepare the truth particle links for writing:
146 if( truthParticleLinksAcc.isAvailableWritable( *this ) ) {
147 TruthParticleLinks_t::iterator itr =
148 truthParticleLinksAcc( *this ).begin();
149 TruthParticleLinks_t::iterator end =
150 truthParticleLinksAcc( *this ).end();
151 for( ; itr != end; ++itr ) {
152 itr->toPersistent();
153 }
154 }
155
156 // Prepare the truth vertex links for writing:
157 if( truthVertexLinksAcc.isAvailableWritable( *this ) ) {
158 TruthVertexLinks_t::iterator itr =
159 truthVertexLinksAcc( *this ).begin();
160 TruthVertexLinks_t::iterator end =
161 truthVertexLinksAcc( *this ).end();
162 for( ; itr != end; ++itr ) {
163 itr->toPersistent();
164 }
165 }
166
167 return;
168 }

◆ truthParticle()

const TruthParticle * xAOD::TruthEventBase_v1::truthParticle ( size_t index) const
inherited

Get a pointer to one of the truth particles.

Definition at line 50 of file TruthEventBase_v1.cxx.

50 {
51
52 // Check if the variable is available:
53 if( ! truthParticleLinksAcc.isAvailable( *this ) ) {
54 return nullptr;
55 }
56
57 // Check if the link is valid:
58 const TruthParticleLinks_t& links = truthParticleLinksAcc( *this );
59 if( ! links[ index ].isValid() ) {
60 return nullptr;
61 }
62
63 // Return the de-referenced link:
64 return *( links[ index ] );
65 }
std::vector< TruthParticleLink_t > TruthParticleLinks_t
Type of the truth particle links vector.
str index
Definition DeMoScan.py:362

◆ truthParticleLink()

const TruthEventBase_v1::TruthParticleLink_t & xAOD::TruthEventBase_v1::truthParticleLink ( size_t index) const
inherited

Get the link to one of the truth particles.

Definition at line 45 of file TruthEventBase_v1.cxx.

45 {
46
47 return truthParticleLinksAcc( *this ).at( index );
48 }

◆ truthParticleLinks()

const TruthParticleLinks_t & xAOD::TruthEventBase_v1::truthParticleLinks ( ) const
inherited

Get all the truth particles.

◆ truthVertex()

const TruthVertex * xAOD::TruthEventBase_v1::truthVertex ( size_t index) const
inherited

Get a pointer to one of the truth vertices.

Definition at line 112 of file TruthEventBase_v1.cxx.

112 {
113
114 // Check if the variable is available:
115 if( ! truthVertexLinksAcc.isAvailable( *this ) ) {
116 return nullptr;
117 }
118
119 // Check if the link is valid:
120 const TruthVertexLinks_t& links = truthVertexLinksAcc( *this );
121 if( ! links[ index ].isValid() ) {
122 return nullptr;
123 }
124
125 // Return the de-referenced link:
126 return *( links[ index ] );
127 }
std::vector< TruthVertexLink_t > TruthVertexLinks_t
Type of the truth particle links vector.

◆ truthVertexLink()

const TruthEventBase_v1::TruthVertexLink_t & xAOD::TruthEventBase_v1::truthVertexLink ( size_t index) const
inherited

Get the link to one of the truth vertices.

Definition at line 107 of file TruthEventBase_v1.cxx.

107 {
108
109 return truthVertexLinksAcc( *this ).at(index);
110 }

◆ truthVertexLinks()

const TruthVertexLinks_t & xAOD::TruthEventBase_v1::truthVertexLinks ( ) const
inherited

Get all the truth vertices.

◆ type()

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

The type of the object as a simple enumeration.

Todo
Some identifying info about the type of pile-up, bunch xing, etc.?

Implements xAOD::TruthEventBase_v1.

Definition at line 17 of file TruthPileupEvent_v1.cxx.

17 {
18
19 return Type::TruthPileupEvent;
20 }

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