The Gaudi Framework  master (594c33fa)
Gaudi::Examples::MyVertex Class Reference

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

Inheritance diagram for Gaudi::Examples::MyVertex:
Collaboration diagram for Gaudi::Examples::MyVertex:

Public Member Functions

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

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

Additional Inherited Members

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

Detailed Description

Simple class that represents a vertex for testing purposes

Author
Markus Frank

Definition at line 36 of file MyVertex.h.

Constructor & Destructor Documentation

◆ MyVertex() [1/2]

MyVertex::MyVertex ( )

Standard constructor.

Definition at line 70 of file legacy_examples.cpp.

70 : m_x( 0.0 ), m_y( 0.0 ), m_z( 0.0 ) { s_vtx_instances.count++; }

◆ MyVertex() [2/2]

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

Standard constructor.

Definition at line 73 of file legacy_examples.cpp.

73 : m_x( x ), m_y( y ), m_z( z ) { s_vtx_instances.count++; }

◆ ~MyVertex()

MyVertex::~MyVertex ( )
override

Standard Destructor.

Definition at line 76 of file legacy_examples.cpp.

76 { s_vtx_instances.count--; }

Member Function Documentation

◆ addCollision()

void Gaudi::Examples::MyVertex::addCollision ( Collision vtx)
inline

Add collision.

Add decay vertex.

Definition at line 136 of file MyVertex.h.

136 { m_collisions.push_back( SmartRef<Collision>( c ) ); }

◆ addDecayParticle()

void Gaudi::Examples::MyVertex::addDecayParticle ( MyTrack track)
inline

Add decay particle.

Add decay vertex.

Definition at line 119 of file MyVertex.h.

119 { m_decayParticles.push_back( SmartRef<MyTrack>( p ) ); }

◆ classID()

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

Definition at line 58 of file MyVertex.h.

58 { return CLID_MyVertex; }

◆ clID()

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

Retrieve pointer to class definition structure.

Reimplemented from ContainedObject.

Definition at line 57 of file MyVertex.h.

57 { return classID(); }

◆ collisions()

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

Access to collisions.

Access to decay vertices.

Definition at line 133 of file MyVertex.h.

133 { return m_collisions; }

◆ decayParticles()

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

Access to decay particles.

Access to decay vertices.

Definition at line 116 of file MyVertex.h.

116 { return m_decayParticles; }

◆ event()

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

Access to the source track object (constant case)

Definition at line 73 of file MyVertex.h.

73 { return m_event; }

◆ motherParticle()

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

Mother track.

Mother particle.

Definition at line 110 of file MyVertex.h.

110 { return m_motherParticle; }

◆ removeCollision()

void Gaudi::Examples::MyVertex::removeCollision ( Collision vtx)
inline

Remove collision.

Remove decay vertex.

Definition at line 139 of file MyVertex.h.

139  {
141  for ( i = m_collisions.begin(); i != m_collisions.end(); ++i ) {
142  if ( i->target() == c ) {
143  m_collisions.erase( i );
144  return;
145  }
146  }
147  }

◆ removeDecayParticle()

void Gaudi::Examples::MyVertex::removeDecayParticle ( MyTrack vtx)
inline

Remove decay vertex.

Definition at line 122 of file MyVertex.h.

122  {
124  for ( i = m_decayParticles.begin(); i != m_decayParticles.end(); ++i ) {
125  if ( i->target() == p ) {
126  m_decayParticles.erase( i );
127  return;
128  }
129  }
130  }

◆ serialize() [1/2]

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

Serialize the object for writing.

Reimplemented from ContainedObject.

Definition at line 79 of file legacy_examples.cpp.

79  {
81  s << m_motherParticle( this );
82  s << m_decayParticles( this );
83  s << m_event( this );
84  s << m_collisions( this );
85  s << m_x << m_y << m_z;
86  return s;
87 }

◆ serialize() [2/2]

StreamBuffer & MyVertex::serialize ( StreamBuffer s)
inlineoverridevirtual

Serialize the object for reading.

Reimplemented from ContainedObject.

Definition at line 90 of file legacy_examples.cpp.

90  {
92  s >> m_motherParticle( this );
93  s >> m_decayParticles( this );
94  s >> m_event( this );
95  s >> m_collisions( this );
96  s >> m_x >> m_y >> m_z;
97  return s;
98 }

◆ setEvent()

void Gaudi::Examples::MyVertex::setEvent ( Event evt)
inline

Access to event object.

Definition at line 75 of file MyVertex.h.

75 { m_event = evt; }

◆ setMotherParticle()

void Gaudi::Examples::MyVertex::setMotherParticle ( MyTrack mother)
inline

Set mother track.

Set origin vertex.

Definition at line 113 of file MyVertex.h.

113 { m_motherParticle = mother; }

◆ setX()

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

Accessors: Update x-component of the track momentum.

Definition at line 66 of file MyVertex.h.

66 { m_x = x; }

◆ setY()

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

Accessors: Update y-component of the track momentum.

Definition at line 68 of file MyVertex.h.

68 { m_y = y; }

◆ setZ()

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

Accessors: Update z-component of the track momentum.

Definition at line 70 of file MyVertex.h.

70 { m_z = z; }

◆ x()

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

Accessors: Retrieve x-component of the track momentum.

Definition at line 60 of file MyVertex.h.

60 { return m_x; }

◆ y()

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

Accessors: Retrieve y-component of the track momentum.

Definition at line 62 of file MyVertex.h.

62 { return m_y; }

◆ z()

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

Accessors: Retrieve z-component of the track momentum.

Definition at line 64 of file MyVertex.h.

64 { return m_z; }

Member Data Documentation

◆ m_collisions

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

Vector of collisions this object belongs to.

Definition at line 47 of file MyVertex.h.

◆ m_decayParticles

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

Links to all daughter particles.

Definition at line 45 of file MyVertex.h.

◆ m_event

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

Link to Top level event.

Definition at line 41 of file MyVertex.h.

◆ m_motherParticle

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

Link to mother track.

Definition at line 43 of file MyVertex.h.

◆ m_x

float Gaudi::Examples::MyVertex::m_x
protected

The vertex location.

Definition at line 39 of file MyVertex.h.

◆ m_y

float Gaudi::Examples::MyVertex::m_y
protected

Definition at line 39 of file MyVertex.h.

◆ m_z

float Gaudi::Examples::MyVertex::m_z
protected

Definition at line 39 of file MyVertex.h.


The documentation for this class was generated from the following files:
IOTest.evt
evt
Definition: IOTest.py:107
KeyedObject::serialize
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.
Definition: KeyedObject.h:143
SmartRefVector
Kernel objects: SmartRefVector.
Definition: SmartRefVector.h:79
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Examples::MyVertex::y
float y() const
Accessors: Retrieve y-component of the track momentum.
Definition: MyVertex.h:62
Gaudi::Examples::MyVertex::m_z
float m_z
Definition: MyVertex.h:39
gaudirun.c
c
Definition: gaudirun.py:525
Gaudi::Examples::MyVertex::m_motherParticle
SmartRef< MyTrack > m_motherParticle
Link to mother track.
Definition: MyVertex.h:43
Gaudi::Examples::MyVertex::classID
static const CLID & classID()
Definition: MyVertex.h:58
Gaudi::Examples::MyVertex::m_decayParticles
SmartRefVector< MyTrack > m_decayParticles
Links to all daughter particles.
Definition: MyVertex.h:45
Gaudi::Examples::MyVertex::m_collisions
SmartRefVector< Collision > m_collisions
Vector of collisions this object belongs to.
Definition: MyVertex.h:47
Gaudi::Examples::MyVertex::m_x
float m_x
The vertex location.
Definition: MyVertex.h:39
Gaudi::Examples::MyVertex::z
float z() const
Accessors: Retrieve z-component of the track momentum.
Definition: MyVertex.h:64
Gaudi::Examples::MyVertex::x
float x() const
Accessors: Retrieve x-component of the track momentum.
Definition: MyVertex.h:60
Gaudi::Examples::MyVertex::m_y
float m_y
Definition: MyVertex.h:39
Gaudi::Examples::MyVertex::m_event
SmartRef< Event > m_event
Link to Top level event.
Definition: MyVertex.h:41
SmartRef
Kernel objects: SmartRef.
Definition: SmartRef.h:76