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

Class describing a Vertex. More...

#include <Vertex_v1.h>

Inheritance diagram for xAOD::Vertex_v1:
Collaboration diagram for xAOD::Vertex_v1:

Public Member Functions

 Vertex_v1 ()
 Default constructor.
 Vertex_v1 (const Vertex_v1 &other)
 Copy constructor.
Vertex_v1operator= (const Vertex_v1 &tp)
 Assignment operator. This can involve creating and copying an Auxilary store, and so should be used sparingly.
Type::ObjectType type () const
 A little helper function for identifying the type in template code.
float x () const
 Returns the x position.
void setX (float value)
 Sets the x position.
float y () const
 Returns the y position.
void setY (float value)
 Sets the y position.
float z () const
 Returns the z position.
void setZ (float value)
 Sets the z position.
float time () const
 Returns the time.
void setTime (float value)
 Sets the time.
float timeResolution () const
 Returns the time resolution.
void setTimeResolution (float value)
 Sets the time resolution.
uint8_t hasValidTime () const
 Returns whether or not the vertex has a valid time.
void setHasValidTime (uint8_t value)
 Sets whether or not the vertex has a valid time.
const std::vector< float > & covariance () const
 Returns the covariance matrix as a simple vector of values.
void setCovariance (const std::vector< float > &value)
 Sets the covariance matrix as a simple vector of values.
const Amg::Vector3Dposition () const
 Returns the 3-pos.
void setPosition (const Amg::Vector3D &position)
 Sets the 3-position.
const AmgSymMatrix (3) &covariancePosition() const
 Returns the vertex covariance matrix.
void setCovariancePosition (const AmgSymMatrix(3)&covariancePosition)
 Sets the vertex covariance matrix.
VxType::VertexType vertexType () const
 The type of the vertex.
void setVertexType (VxType::VertexType vType)
 Set the type of the vertex.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex ()
 Non-const access to the VxTrackAtVertex vector.
const std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex () const
 Const access to the vector of tracks fitted to the vertex (may not exist!).
bool vxTrackAtVertexAvailable () const
 Check if VxTrackAtVertices are attached to the object.
void resetCache ()
 Reset the internal cache of the object.

Private Attributes

CxxUtils::CachedValue< Amg::Vector3Dm_position
 Cached position of the vertex.
CxxUtils::CachedValue< AmgSymMatrix(3)> m_covariance
 Cached covariance of the vertex.

Track particle contents operations

typedef std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
 Type for the associated track particles.
typedef std::vector< ElementLink< xAOD::NeutralParticleContainer > > NeutralParticleLinks_t
 Type for the associated neutral particles.
const TrackParticleLinks_ttrackParticleLinks () const
 Get all the particles associated with the vertex.
void setTrackParticleLinks (const TrackParticleLinks_t &trackParticles)
 Set all track particle links at once.
const std::vector< float > & trackWeights () const
 Get all the track weights.
void setTrackWeights (const std::vector< float > &weights)
 Set all the track weights.
const NeutralParticleLinks_tneutralParticleLinks () const
 Get all the particles associated with the vertex.
void setNeutralParticleLinks (const NeutralParticleLinks_t &neutralParticles)
 Set all neutral particle links at once.
const std::vector< float > & neutralWeights () const
 Get all the neutral weights.
void setNeutralWeights (const std::vector< float > &weights)
 Set all the neutral weights.
const TrackParticletrackParticle (size_t i) const
 Get the pointer to a given track that was used in vertex reco.
float trackWeight (size_t i) const
 Get the weight of a given track in the vertex reconstruction.
size_t nTrackParticles () const
 Get the number of tracks associated with this vertex.
const NeutralParticleneutralParticle (size_t i) const
 Get the pointer to a given neutral that was used in vertex reco.
float neutralWeight (size_t i) const
 Get the weight of a given neutral in the vertex reconstruction.
size_t nNeutralParticles () const
 Get the number of neutrals associated with this vertex.
void addTrackAtVertex (const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
 Add a new track to the vertex.
void addNeutralAtVertex (const ElementLink< NeutralParticleContainer > &tr, float weight=1.0)
 Add a new neutral to the vertex.
void clearTracks ()
 Remove all tracks from the vertex.
void clearNeutrals ()
 Remove all neutrals from the vertex.

Fit quality functions

float chiSquared () const
 Returns the \( \chi^2 \) of the vertex fit as float.
float numberDoF () const
 Returns the number of degrees of freedom of the vertex fit as float.
void setFitQuality (float chiSquared, float numberDoF)
 Set the 'Fit Quality' information.

Detailed Description

Member Typedef Documentation

◆ NeutralParticleLinks_t

Type for the associated neutral particles.

Definition at line 141 of file Vertex_v1.h.

◆ TrackParticleLinks_t

Type for the associated track particles.

Definition at line 128 of file Vertex_v1.h.

Constructor & Destructor Documentation

◆ Vertex_v1() [1/2]

xAOD::Vertex_v1::Vertex_v1 ( )

Default constructor.

Definition at line 19 of file Vertex_v1.cxx.

21 m_position(),
22 m_covariance() {
23
24 }
CxxUtils::CachedValue< Amg::Vector3D > m_position
Cached position of the vertex.
Definition Vertex_v1.h:191
CxxUtils::CachedValue< AmgSymMatrix(3)> m_covariance
Cached covariance of the vertex.
Definition Vertex_v1.h:193
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.

◆ Vertex_v1() [2/2]

xAOD::Vertex_v1::Vertex_v1 ( const Vertex_v1 & other)

Copy constructor.

Definition at line 26 of file Vertex_v1.cxx.

28 m_position( other.m_position ),
29 m_covariance( other.m_covariance ){
30 //copy aux store content (only the stuffs already loaded in memory!)
31 this->makePrivateStore( other );
32 }
void makePrivateStore()
Create a new (empty) private store for this object.

Member Function Documentation

◆ addNeutralAtVertex()

void xAOD::Vertex_v1::addNeutralAtVertex ( const ElementLink< NeutralParticleContainer > & tr,
float weight = 1.0 )

Add a new neutral to the vertex.

Definition at line 323 of file Vertex_v1.cxx.

324 {
325
326 neutralAcc( *this ).push_back( tr );
327 weightNeutralAcc( *this ).push_back( weight );
328 return;
329 }
static const SG::AuxElement::Accessor< std::vector< float > > weightNeutralAcc("neutralWeights")
Accessor for the neutral weights.
static const SG::AuxElement::Accessor< Vertex_v1::NeutralParticleLinks_t > neutralAcc("neutralParticleLinks")
Accessor for the neutral links.

◆ addTrackAtVertex()

void xAOD::Vertex_v1::addTrackAtVertex ( const ElementLink< TrackParticleContainer > & tr,
float weight = 1.0 )

Add a new track to the vertex.

Definition at line 314 of file Vertex_v1.cxx.

315 {
316
317 trackAcc( *this ).push_back( tr );
318 weightTrackAcc( *this ).push_back( weight );
319 return;
320 }
static const SG::AuxElement::Accessor< Vertex_v1::TrackParticleLinks_t > trackAcc("trackParticleLinks")
Accessor for the track links.
static const SG::AuxElement::Accessor< std::vector< float > > weightTrackAcc("trackWeights")
Accessor for the track weights.

◆ AmgSymMatrix()

const xAOD::Vertex_v1::AmgSymMatrix ( 3 ) const &

Returns the vertex covariance matrix.

◆ chiSquared()

float xAOD::Vertex_v1::chiSquared ( ) const

Returns the \( \chi^2 \) of the vertex fit as float.

◆ clearNeutrals()

void xAOD::Vertex_v1::clearNeutrals ( )

Remove all neutrals from the vertex.

Definition at line 338 of file Vertex_v1.cxx.

338 {
339
340 neutralAcc( *this ).clear();
341 weightNeutralAcc( *this ).clear();
342 return;
343 }

◆ clearTracks()

void xAOD::Vertex_v1::clearTracks ( )

Remove all tracks from the vertex.

Definition at line 331 of file Vertex_v1.cxx.

331 {
332
333 trackAcc( *this ).clear();
334 weightTrackAcc( *this ).clear();
335 return;
336 }

◆ covariance()

const std::vector< float > & xAOD::Vertex_v1::covariance ( ) const

Returns the covariance matrix as a simple vector of values.

◆ hasValidTime()

uint8_t xAOD::Vertex_v1::hasValidTime ( ) const

Returns whether or not the vertex has a valid time.

◆ neutralParticle()

const NeutralParticle * xAOD::Vertex_v1::neutralParticle ( size_t i) const

Get the pointer to a given neutral that was used in vertex reco.

Definition at line 280 of file Vertex_v1.cxx.

280 {
281
282 if( ! neutralAcc.isAvailable( *this ) ) {
283 return nullptr;
284 }
285 if( ( neutralAcc( *this ).size() <= i ) ||
286 ( ! neutralAcc( *this )[ i ].isValid() ) ) {
287 return nullptr;
288 }
289
290 return ( *( neutralAcc( *this )[ i ] ) );
291 }

◆ neutralParticleLinks()

const NeutralParticleLinks_t & xAOD::Vertex_v1::neutralParticleLinks ( ) const

Get all the particles associated with the vertex.

◆ neutralWeight()

float xAOD::Vertex_v1::neutralWeight ( size_t i) const

Get the weight of a given neutral in the vertex reconstruction.

Definition at line 293 of file Vertex_v1.cxx.

293 {
294
295 if( weightNeutralAcc( *this ).size() <= i ) {
296 return -1.0;
297 }
298 return weightNeutralAcc( *this )[ i ];
299 }

◆ neutralWeights()

const std::vector< float > & xAOD::Vertex_v1::neutralWeights ( ) const

Get all the neutral weights.

◆ nNeutralParticles()

size_t xAOD::Vertex_v1::nNeutralParticles ( ) const

Get the number of neutrals associated with this vertex.

Definition at line 301 of file Vertex_v1.cxx.

301 {
302
303 if( ! neutralAcc.isAvailable( *this ) ) {
304 return 0;
305 }
306
307 return neutralAcc( *this ).size();
308 }

◆ nTrackParticles()

size_t xAOD::Vertex_v1::nTrackParticles ( ) const

Get the number of tracks associated with this vertex.

Definition at line 270 of file Vertex_v1.cxx.

270 {
271
272 if( ! trackAcc.isAvailable( *this ) ) {
273 return 0;
274 }
275
276 return trackAcc( *this ).size();
277 }

◆ numberDoF()

float xAOD::Vertex_v1::numberDoF ( ) const

Returns the number of degrees of freedom of the vertex fit as float.

◆ operator=()

Vertex_v1 & xAOD::Vertex_v1::operator= ( const Vertex_v1 & tp)

Assignment operator. This can involve creating and copying an Auxilary store, and so should be used sparingly.

Definition at line 34 of file Vertex_v1.cxx.

34 {
35
36 // Check if anything needs to be done:
37 if( this == &tp ) {
38 return *this;
39 }
40
41 // If the object doesn't have an auxiliary store yet, make a private
42 // one for it:
43 if( ( ! hasStore() ) && ( ! container() ) ) {
45 }
46
47 // copy the cache
48 m_position = tp.m_position;
49 m_covariance = tp.m_covariance;
50
51 // Now let the base class copy the auxiliary contents:
52 SG::AuxElement::operator=( tp );
53
54 // Return the object:
55 return *this;
56 }
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.

◆ position()

const Amg::Vector3D & xAOD::Vertex_v1::position ( ) const

Returns the 3-pos.

◆ resetCache()

void xAOD::Vertex_v1::resetCache ( )

Reset the internal cache of the object.

Definition at line 348 of file Vertex_v1.cxx.

348 {
349 m_position.reset();
350 m_covariance.reset();
351 return;
352 }

◆ setCovariance()

void xAOD::Vertex_v1::setCovariance ( const std::vector< float > & value)

Sets the covariance matrix as a simple vector of values.

◆ setCovariancePosition()

void xAOD::Vertex_v1::setCovariancePosition ( const AmgSymMatrix(3)& covariancePosition)

Sets the vertex covariance matrix.

◆ setFitQuality()

void xAOD::Vertex_v1::setFitQuality ( float chiSquared,
float numberDoF )

Set the 'Fit Quality' information.

Definition at line 150 of file Vertex_v1.cxx.

150 {
151
152 static const Accessor< float > acc1( "chiSquared" );
153 static const Accessor< float > acc2( "numberDoF" );
154 acc1( *this ) = chiSquared;
155 acc2( *this ) = numberDoF;
156
157 return;
158 }
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
float chiSquared() const
Returns the of the vertex fit as float.

◆ setHasValidTime()

void xAOD::Vertex_v1::setHasValidTime ( uint8_t value)

Sets whether or not the vertex has a valid time.

◆ setNeutralParticleLinks()

void xAOD::Vertex_v1::setNeutralParticleLinks ( const NeutralParticleLinks_t & neutralParticles)

Set all neutral particle links at once.

◆ setNeutralWeights()

void xAOD::Vertex_v1::setNeutralWeights ( const std::vector< float > & weights)

Set all the neutral weights.

◆ setPosition()

void xAOD::Vertex_v1::setPosition ( const Amg::Vector3D & position)

Sets the 3-position.

◆ setTime()

void xAOD::Vertex_v1::setTime ( float value)

Sets the time.

◆ setTimeResolution()

void xAOD::Vertex_v1::setTimeResolution ( float value)

Sets the time resolution.

◆ setTrackParticleLinks()

void xAOD::Vertex_v1::setTrackParticleLinks ( const TrackParticleLinks_t & trackParticles)

Set all track particle links at once.

◆ setTrackWeights()

void xAOD::Vertex_v1::setTrackWeights ( const std::vector< float > & weights)

Set all the track weights.

◆ setVertexType()

void xAOD::Vertex_v1::setVertexType ( VxType::VertexType vType)

Set the type of the vertex.

◆ setX()

void xAOD::Vertex_v1::setX ( float value)

Sets the x position.

◆ setY()

void xAOD::Vertex_v1::setY ( float value)

Sets the y position.

◆ setZ()

void xAOD::Vertex_v1::setZ ( float value)

Sets the z position.

◆ time()

float xAOD::Vertex_v1::time ( ) const

Returns the time.

◆ timeResolution()

float xAOD::Vertex_v1::timeResolution ( ) const

Returns the time resolution.

◆ trackParticle()

setTrackWeights setNeutralWeights const TrackParticle * xAOD::Vertex_v1::trackParticle ( size_t i) const

Get the pointer to a given track that was used in vertex reco.

Definition at line 249 of file Vertex_v1.cxx.

249 {
250
251 if( ! trackAcc.isAvailable( *this ) ) {
252 return nullptr;
253 }
254 if( ( trackAcc( *this ).size() <= i ) ||
255 ( ! trackAcc( *this )[ i ].isValid() ) ) {
256 return nullptr;
257 }
258
259 return ( *( trackAcc( *this )[ i ] ) );
260 }

◆ trackParticleLinks()

const TrackParticleLinks_t & xAOD::Vertex_v1::trackParticleLinks ( ) const

Get all the particles associated with the vertex.

◆ trackWeight()

float xAOD::Vertex_v1::trackWeight ( size_t i) const

Get the weight of a given track in the vertex reconstruction.

Definition at line 262 of file Vertex_v1.cxx.

262 {
263
264 if( weightTrackAcc( *this ).size() <= i ) {
265 return -1.0;
266 }
267 return weightTrackAcc( *this )[ i ];
268 }

◆ trackWeights()

const std::vector< float > & xAOD::Vertex_v1::trackWeights ( ) const

Get all the track weights.

◆ type()

Type::ObjectType xAOD::Vertex_v1::type ( ) const

A little helper function for identifying the type in template code.

Definition at line 58 of file Vertex_v1.cxx.

58 {
59
60 return Type::Vertex;
61 }

◆ vertexType()

VxType::VertexType xAOD::Vertex_v1::vertexType ( ) const

The type of the vertex.

◆ vxTrackAtVertex() [1/2]

std::vector< Trk::VxTrackAtVertex > & xAOD::Vertex_v1::vxTrackAtVertex ( )

Non-const access to the VxTrackAtVertex vector.

This function can be used to attach an Athena-only, reconstruction specific information to the object.

The data is attached as a dynamic auxiliary property. And it needs to be explicitly disabled for writing out, as we don't have a valid dictionary for it. Not to mention that these objects are very large.

Returns
A modifiable object, creating it if necessary

Definition at line 181 of file Vertex_v1.cxx.

181 {
182
183 return vxVertAcc( *this );
184 }
static setVertexType const SG::AuxElement::Accessor< std::vector< Trk::VxTrackAtVertex > > vxVertAcc("vxTrackAtVertex")
Helper object for implementing the vxTrackAtVertex functions.

◆ vxTrackAtVertex() [2/2]

const std::vector< Trk::VxTrackAtVertex > & xAOD::Vertex_v1::vxTrackAtVertex ( ) const

Const access to the vector of tracks fitted to the vertex (may not exist!).

This function can be used to access the Athena-only, reconstruction specific decoration on the object.

Keep in mind that this decoration is not available for most of the vertices. When calling this function on an object that doesn't have this decoration, an exception will be thrown. Use the vxTrackAtVertexAvailable() function to check if this function will succeed or not.

Returns
A constant reference to the decoration

Definition at line 198 of file Vertex_v1.cxx.

198 {
199
200 return vxVertAcc( *this );
201 }

◆ vxTrackAtVertexAvailable()

bool xAOD::Vertex_v1::vxTrackAtVertexAvailable ( ) const

Check if VxTrackAtVertices are attached to the object.

This function can be used to check whether this Athena-only, reconstruction-specific decoration is available on the object.

In most cases it isn't.

Returns
The availablility of the decoration

Definition at line 209 of file Vertex_v1.cxx.

209 {
210
211 return vxVertAcc.isAvailable( *this );
212 }

◆ x()

float xAOD::Vertex_v1::x ( ) const

Returns the x position.

◆ y()

float xAOD::Vertex_v1::y ( ) const

Returns the y position.

◆ z()

float xAOD::Vertex_v1::z ( ) const

Returns the z position.

Member Data Documentation

◆ m_covariance

CxxUtils::CachedValue<AmgSymMatrix(3)> xAOD::Vertex_v1::m_covariance
private

Cached covariance of the vertex.

Definition at line 193 of file Vertex_v1.h.

◆ m_position

CxxUtils::CachedValue<Amg::Vector3D> xAOD::Vertex_v1::m_position
private

Cached position of the vertex.

Definition at line 191 of file Vertex_v1.h.


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