The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::TestSuite::MyVertex Class Reference

Simple class that represents a vertex for testing purposes. More...

#include </builds/gaudi/Gaudi/GaudiTestSuite/include/GaudiTestSuite/MyVertex.h>

Inheritance diagram for Gaudi::TestSuite::MyVertex:
Collaboration diagram for Gaudi::TestSuite::MyVertex:

Public Member Functions

 MyVertex ()
 Standard constructor.
 
 MyVertex (float x, float y, float z)
 Standard constructor.
 
 ~MyVertex () override
 Standard Destructor.
 
const CLIDclID () const override
 Retrieve pointer to class definition structure.
 
float x () const
 Accessors: Retrieve x-component of the track momentum.
 
float y () const
 Accessors: Retrieve y-component of the track momentum.
 
float z () const
 Accessors: Retrieve z-component of the track momentum.
 
void setX (float x)
 Accessors: Update x-component of the track momentum.
 
void setY (float y)
 Accessors: Update y-component of the track momentum.
 
void setZ (float z)
 Accessors: Update z-component of the track momentum.
 
const Eventevent () const
 Access to the source track object (constant case)
 
void setEvent (Event *evt)
 Access to event object.
 
const MyTrackmotherParticle () const
 Mother track.
 
void setMotherParticle (MyTrack *mother)
 Set mother track.
 
const SmartRefVector< MyTrack > & decayParticles () const
 Access to decay particles.
 
void addDecayParticle (MyTrack *track)
 Add decay particle.
 
void removeDecayParticle (MyTrack *vtx)
 Remove decay vertex.
 
const SmartRefVector< Collision > & collisions () const
 Access to collisions.
 
void addCollision (Collision *vtx)
 Add collision.
 
void removeCollision (Collision *vtx)
 Remove collision.
 
StreamBufferserialize (StreamBuffer &s) const override
 Serialize the object for writing.
 
StreamBufferserialize (StreamBuffer &s) override
 Serialize the object for reading.
 
- Public Member Functions inherited from KeyedObject< int >
 KeyedObject ()=default
 Standard Constructor. The object key is preset to the invalid value.
 
 KeyedObject (const key_type &kval)
 Standard Constructor accepting the object's key.
 
 ~KeyedObject () override
 Standard destructor.
 
const key_typekey () const
 Retrieve Key of the object.
 
bool hasKey () const
 Check if the object has a key assigned or not.
 
long index () const override
 Distance in the parent container.
 
- Public Member Functions inherited from ContainedObject
const ObjectContainerBaseparent () const
 Access to parent object.
 
void setParent (ObjectContainerBase *value)
 Update parent member.
 
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the output stream (ASCII)
 

Static Public Member Functions

static const CLIDclassID ()
 
- Static Public Member Functions inherited from ContainedObject
static const CLIDclassID ()
 

Protected Attributes

float m_x
 The vertex location.
 
float m_y
 
float m_z
 
SmartRef< Eventm_event
 Link to Top level event.
 
SmartRef< MyTrackm_motherParticle
 Link to mother track.
 
SmartRefVector< MyTrackm_decayParticles
 Links to all daughter particles.
 
SmartRefVector< Collisionm_collisions
 Vector of collisions this object belongs to.
 
- Protected Attributes inherited from KeyedObject< int >
key_type m_key
 Object Key.
 
long m_refCount
 Reference counter.
 
bool m_hasKey
 Boolean to indicate wether a key was already assigned.
 

Additional Inherited Members

- Public Types inherited from KeyedObject< int >
typedef int key_type
 Definition of the key-type to access object.
 
- Protected Types inherited from KeyedObject< int >
typedef Containers::key_traits< key_typetraits
 definition of the container key traits to be made friend
 
- Protected Member Functions inherited from KeyedObject< int >
unsigned long addRef ()
 Add reference to object (Increase reference counter).
 
unsigned long release ()
 Release reference. If the reference count is ZERO, delete the object.
 
void setKey (const key_type &key)
 Set object key.
 
- Protected Member Functions inherited from ContainedObject
 ContainedObject ()=default
 Constructors.
 
 ContainedObject (const ContainedObject &)
 Copy constructor and assignement: do NOT copy the parent reference...
 
ContainedObjectoperator= (const ContainedObject &)
 
virtual ~ContainedObject ()
 Destructor.
 

Detailed Description

Simple class that represents a vertex for testing purposes.

Author
Markus Frank

Definition at line 33 of file MyVertex.h.

Constructor & Destructor Documentation

◆ MyVertex() [1/2]

MyVertex::MyVertex ( )

Standard constructor.

Definition at line 27 of file MyVertex.cpp.

27: m_x( 0.0 ), m_y( 0.0 ), m_z( 0.0 ) { s_instances.count++; }
float m_x
The vertex location.
Definition MyVertex.h:36

◆ MyVertex() [2/2]

MyVertex::MyVertex ( float x,
float y,
float z )

Standard constructor.

Definition at line 30 of file MyVertex.cpp.

30: m_x( x ), m_y( y ), m_z( z ) { s_instances.count++; }
float y() const
Accessors: Retrieve y-component of the track momentum.
Definition MyVertex.h:59
float x() const
Accessors: Retrieve x-component of the track momentum.
Definition MyVertex.h:57
float z() const
Accessors: Retrieve z-component of the track momentum.
Definition MyVertex.h:61

◆ ~MyVertex()

MyVertex::~MyVertex ( )
override

Standard Destructor.

Definition at line 33 of file MyVertex.cpp.

33{ s_instances.count--; }

Member Function Documentation

◆ addCollision()

void Gaudi::TestSuite::MyVertex::addCollision ( Collision * vtx)
inline

Add collision.

Add decay vertex.

Definition at line 133 of file MyVertex.h.

133{ m_collisions.push_back( SmartRef<Collision>( c ) ); }
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition MyVertex.h:44

◆ addDecayParticle()

void Gaudi::TestSuite::MyVertex::addDecayParticle ( MyTrack * track)
inline

Add decay particle.

Add decay vertex.

Definition at line 116 of file MyVertex.h.

116{ m_decayParticles.push_back( SmartRef<MyTrack>( p ) ); }
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition MyVertex.h:42

◆ classID()

static const CLID & Gaudi::TestSuite::MyVertex::classID ( )
inlinestatic

Definition at line 55 of file MyVertex.h.

55{ return CLID_MyVertex; }

◆ clID()

const CLID & Gaudi::TestSuite::MyVertex::clID ( ) const
inlineoverridevirtual

Retrieve pointer to class definition structure.

Reimplemented from ContainedObject.

Definition at line 54 of file MyVertex.h.

54{ return classID(); }
static const CLID & classID()
Definition MyVertex.h:55

◆ collisions()

const SmartRefVector< Collision > & Gaudi::TestSuite::MyVertex::collisions ( ) const
inline

Access to collisions.

Access to decay vertices.

Definition at line 130 of file MyVertex.h.

130{ return m_collisions; }

◆ decayParticles()

const SmartRefVector< MyTrack > & Gaudi::TestSuite::MyVertex::decayParticles ( ) const
inline

Access to decay particles.

Access to decay vertices.

Definition at line 113 of file MyVertex.h.

113{ return m_decayParticles; }

◆ event()

const Event * Gaudi::TestSuite::MyVertex::event ( ) const
inline

Access to the source track object (constant case)

Definition at line 70 of file MyVertex.h.

70{ return m_event; }
SmartRef< Event > m_event
Link to Top level event.
Definition MyVertex.h:38

◆ motherParticle()

const MyTrack * Gaudi::TestSuite::MyVertex::motherParticle ( ) const
inline

Mother track.

Mother particle.

Definition at line 107 of file MyVertex.h.

107{ return m_motherParticle; }
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition MyVertex.h:40

◆ removeCollision()

void Gaudi::TestSuite::MyVertex::removeCollision ( Collision * vtx)
inline

Remove collision.

Remove decay vertex.

Definition at line 136 of file MyVertex.h.

136 {
137 SmartRefVector<Collision>::iterator i;
138 for ( i = m_collisions.begin(); i != m_collisions.end(); ++i ) {
139 if ( i->target() == c ) {
140 m_collisions.erase( i );
141 return;
142 }
143 }
144 }

◆ removeDecayParticle()

void Gaudi::TestSuite::MyVertex::removeDecayParticle ( MyTrack * vtx)
inline

Remove decay vertex.

Definition at line 119 of file MyVertex.h.

119 {
120 SmartRefVector<MyTrack>::iterator i;
121 for ( i = m_decayParticles.begin(); i != m_decayParticles.end(); ++i ) {
122 if ( i->target() == p ) {
123 m_decayParticles.erase( i );
124 return;
125 }
126 }
127 }

◆ serialize() [1/2]

StreamBuffer & MyVertex::serialize ( StreamBuffer & s) const
inlineoverridevirtual

Serialize the object for writing.

Reimplemented from KeyedObject< int >.

Definition at line 36 of file MyVertex.cpp.

36 {
38 s << m_motherParticle( this );
39 s << m_decayParticles( this );
40 s << m_event( this );
41 s << m_collisions( this );
42 s << m_x << m_y << m_z;
43 return s;
44}
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.

◆ serialize() [2/2]

StreamBuffer & MyVertex::serialize ( StreamBuffer & s)
inlineoverridevirtual

Serialize the object for reading.

Reimplemented from KeyedObject< int >.

Definition at line 47 of file MyVertex.cpp.

47 {
49 s >> m_motherParticle( this );
50 s >> m_decayParticles( this );
51 s >> m_event( this );
52 s >> m_collisions( this );
53 s >> m_x >> m_y >> m_z;
54 return s;
55}

◆ setEvent()

void Gaudi::TestSuite::MyVertex::setEvent ( Event * evt)
inline

Access to event object.

Definition at line 72 of file MyVertex.h.

72{ m_event = evt; }

◆ setMotherParticle()

void Gaudi::TestSuite::MyVertex::setMotherParticle ( MyTrack * mother)
inline

Set mother track.

Set origin vertex.

Definition at line 110 of file MyVertex.h.

110{ m_motherParticle = mother; }

◆ setX()

void Gaudi::TestSuite::MyVertex::setX ( float x)
inline

Accessors: Update x-component of the track momentum.

Definition at line 63 of file MyVertex.h.

63{ m_x = x; }

◆ setY()

void Gaudi::TestSuite::MyVertex::setY ( float y)
inline

Accessors: Update y-component of the track momentum.

Definition at line 65 of file MyVertex.h.

65{ m_y = y; }

◆ setZ()

void Gaudi::TestSuite::MyVertex::setZ ( float z)
inline

Accessors: Update z-component of the track momentum.

Definition at line 67 of file MyVertex.h.

67{ m_z = z; }

◆ x()

float Gaudi::TestSuite::MyVertex::x ( ) const
inline

Accessors: Retrieve x-component of the track momentum.

Definition at line 57 of file MyVertex.h.

57{ return m_x; }

◆ y()

float Gaudi::TestSuite::MyVertex::y ( ) const
inline

Accessors: Retrieve y-component of the track momentum.

Definition at line 59 of file MyVertex.h.

59{ return m_y; }

◆ z()

float Gaudi::TestSuite::MyVertex::z ( ) const
inline

Accessors: Retrieve z-component of the track momentum.

Definition at line 61 of file MyVertex.h.

61{ return m_z; }

Member Data Documentation

◆ m_collisions

SmartRefVector<Collision> Gaudi::TestSuite::MyVertex::m_collisions
protected

Vector of collisions this object belongs to.

Definition at line 44 of file MyVertex.h.

◆ m_decayParticles

SmartRefVector<MyTrack> Gaudi::TestSuite::MyVertex::m_decayParticles
protected

Links to all daughter particles.

Definition at line 42 of file MyVertex.h.

◆ m_event

SmartRef<Event> Gaudi::TestSuite::MyVertex::m_event
protected

Link to Top level event.

Definition at line 38 of file MyVertex.h.

◆ m_motherParticle

SmartRef<MyTrack> Gaudi::TestSuite::MyVertex::m_motherParticle
protected

Link to mother track.

Definition at line 40 of file MyVertex.h.

◆ m_x

float Gaudi::TestSuite::MyVertex::m_x
protected

The vertex location.

Definition at line 36 of file MyVertex.h.

◆ m_y

float Gaudi::TestSuite::MyVertex::m_y
protected

Definition at line 36 of file MyVertex.h.

◆ m_z

float Gaudi::TestSuite::MyVertex::m_z
protected

Definition at line 36 of file MyVertex.h.


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