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

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

Inheritance diagram for Gaudi::TestSuite::MyTrack:
Collaboration diagram for Gaudi::TestSuite::MyTrack:

Public Types

typedef std::vector< MyTrack * > Vector
 the type of plain vector
 
typedef std::vector< const MyTrack * > ConstVector
 the type of vector of const-pointers
 
typedef SharedObjectsContainer< MyTrackSelection
 the type of selection
 
typedef KeyedContainer< MyTrack, Containers::HashMapContainer
 the actual type of container in TES
 
- Public Types inherited from KeyedObject< int >
typedef int key_type
 Definition of the key-type to access object.
 

Public Member Functions

 MyTrack ()
 Standard constructor.
 
 MyTrack (float x, float y, float z)
 Standard constructor.
 
 MyTrack (const MyTrack &t)
 
 ~MyTrack () override
 Standard Destructor.
 
const CLIDclID () const override
 Retrieve pointer to class definition structure.
 
float px () const
 Accessors: Retrieve x-component of the track momentum.
 
float py () const
 Accessors: Retrieve y-component of the track momentum.
 
float pz () const
 Accessors: Retrieve z-component of the track momentum.
 
void setPx (float px)
 Accessors: Update x-component of the track momentum.
 
void setPy (float py)
 Accessors: Update y-component of the track momentum.
 
void setPz (float pz)
 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 MyVertexoriginVertex () const
 Origin vertex.
 
void setOriginVertex (MyVertex *origin)
 Set origin vertex.
 
const SmartRefVector< MyVertex > & decayVertices () const
 Access to decay vertices.
 
void addDecayVertex (MyVertex *vtx)
 Add decay vertex.
 
void removeDecayVertex (MyVertex *vtx)
 Remove decay vertex.
 
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_px
 The track momentum.
 
float m_py
 
float m_pz
 
SmartRef< Eventm_event
 Link to Top level event.
 
SmartRef< MyVertexm_originVertex
 Link to origin vertex.
 
SmartRefVector< MyVertexm_decayVertices
 Links to all decay vertices.
 
- 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.
 

Friends

class GaudiObjectHandler< MyTrack >
 

Additional Inherited Members

- 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

Definition at line 39 of file MyTrack.h.

Member Typedef Documentation

◆ ConstVector

typedef std::vector<const MyTrack*> Gaudi::TestSuite::MyTrack::ConstVector

the type of vector of const-pointers

Definition at line 53 of file MyTrack.h.

◆ Container

the actual type of container in TES

Definition at line 61 of file MyTrack.h.

◆ Selection

the type of selection

Definition at line 55 of file MyTrack.h.

◆ Vector

the type of plain vector

Definition at line 51 of file MyTrack.h.

Constructor & Destructor Documentation

◆ MyTrack() [1/3]

MyTrack::MyTrack ( )

Standard constructor.

Definition at line 27 of file MyTrack.cpp.

27 : m_px( 0.0 ), m_py( 0.0 ), m_pz( 0.0 ) {
28 // m_event(this);
29 // m_originVertex(this);
30 // m_decayVertices(this);
31 s_instances.count++;
32}
float m_px
The track momentum.
Definition MyTrack.h:66

◆ MyTrack() [2/3]

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

Standard constructor.

Definition at line 35 of file MyTrack.cpp.

35 : m_px( x ), m_py( y ), m_pz( z ) {
36 // m_event(this);
37 // m_originVertex(this);
38 // m_decayVertices(this);
39 s_instances.count++;
40}

◆ MyTrack() [3/3]

MyTrack::MyTrack ( const MyTrack & t)

Definition at line 42 of file MyTrack.cpp.

42 : KeyedObject<int>( t.key() ), m_px( t.m_px ), m_py( t.m_py ), m_pz( t.m_pz ) {
43 s_instances.count++;
44}
KeyedObject()=default

◆ ~MyTrack()

MyTrack::~MyTrack ( )
override

Standard Destructor.

Definition at line 47 of file MyTrack.cpp.

47{ s_instances.count--; }

Member Function Documentation

◆ addDecayVertex()

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

Add decay vertex.

Definition at line 147 of file MyTrack.h.

147{ m_decayVertices.push_back( SmartRef<MyVertex>( vtx ) ); }
SmartRefVector< MyVertex > m_decayVertices
Links to all decay vertices.
Definition MyTrack.h:72

◆ classID()

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

Definition at line 84 of file MyTrack.h.

84{ return CLID_MyTrack; }

◆ clID()

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

Retrieve pointer to class definition structure.

Reimplemented from ContainedObject.

Definition at line 83 of file MyTrack.h.

83{ return classID(); }
static const CLID & classID()
Definition MyTrack.h:84

◆ decayVertices()

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

Access to decay vertices.

Definition at line 144 of file MyTrack.h.

144{ return m_decayVertices; }

◆ event()

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

Access to the source track object (constant case)

Definition at line 99 of file MyTrack.h.

99{ return m_event; }
SmartRef< Event > m_event
Link to Top level event.
Definition MyTrack.h:68

◆ originVertex()

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

Origin vertex.

Definition at line 138 of file MyTrack.h.

138{ return m_originVertex; }
SmartRef< MyVertex > m_originVertex
Link to origin vertex.
Definition MyTrack.h:70

◆ px()

float Gaudi::TestSuite::MyTrack::px ( ) const
inline

Accessors: Retrieve x-component of the track momentum.

Definition at line 86 of file MyTrack.h.

86{ return m_px; }

◆ py()

float Gaudi::TestSuite::MyTrack::py ( ) const
inline

Accessors: Retrieve y-component of the track momentum.

Definition at line 88 of file MyTrack.h.

88{ return m_py; }

◆ pz()

float Gaudi::TestSuite::MyTrack::pz ( ) const
inline

Accessors: Retrieve z-component of the track momentum.

Definition at line 90 of file MyTrack.h.

90{ return m_pz; }

◆ removeDecayVertex()

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

Remove decay vertex.

Definition at line 150 of file MyTrack.h.

150 {
151 SmartRefVector<MyVertex>::iterator i;
152 for ( i = m_decayVertices.begin(); i != m_decayVertices.end(); ++i ) {
153 if ( i->target() == vtx ) {
154 m_decayVertices.erase( i );
155 return;
156 }
157 }
158 }

◆ serialize() [1/2]

StreamBuffer & Gaudi::TestSuite::MyTrack::serialize ( StreamBuffer & s) const
inlineoverridevirtual

Serialize the object for writing.

Reimplemented from KeyedObject< int >.

Definition at line 161 of file MyTrack.h.

161 {
162#ifdef __PLAIN_GAUDI
164#else
166#endif
167 return s << m_event( this ) << m_originVertex( this ) << m_decayVertices( this ) << m_px << m_py << m_pz;
168 }
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
StreamBuffer & serialize(StreamBuffer &s) const override
Serialize the object for writing.

◆ serialize() [2/2]

StreamBuffer & Gaudi::TestSuite::MyTrack::serialize ( StreamBuffer & s)
inlineoverridevirtual

Serialize the object for reading.

Reimplemented from KeyedObject< int >.

Definition at line 171 of file MyTrack.h.

171 {
172#ifdef __PLAIN_GAUDI
174#else
176#endif
177 return s >> m_event( this ) >> m_originVertex( this ) >> m_decayVertices( this ) >> m_px >> m_py >> m_pz;
178 }

◆ setEvent()

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

Access to event object.

Definition at line 101 of file MyTrack.h.

101{ m_event = evt; }

◆ setOriginVertex()

void Gaudi::TestSuite::MyTrack::setOriginVertex ( MyVertex * origin)
inline

Set origin vertex.

Definition at line 141 of file MyTrack.h.

141{ m_originVertex = origin; }

◆ setPx()

void Gaudi::TestSuite::MyTrack::setPx ( float px)
inline

Accessors: Update x-component of the track momentum.

Definition at line 92 of file MyTrack.h.

92{ m_px = px; }
float px() const
Accessors: Retrieve x-component of the track momentum.
Definition MyTrack.h:86

◆ setPy()

void Gaudi::TestSuite::MyTrack::setPy ( float py)
inline

Accessors: Update y-component of the track momentum.

Definition at line 94 of file MyTrack.h.

94{ m_py = py; }
float py() const
Accessors: Retrieve y-component of the track momentum.
Definition MyTrack.h:88

◆ setPz()

void Gaudi::TestSuite::MyTrack::setPz ( float pz)
inline

Accessors: Update z-component of the track momentum.

Definition at line 96 of file MyTrack.h.

96{ m_pz = pz; }
float pz() const
Accessors: Retrieve z-component of the track momentum.
Definition MyTrack.h:90

Friends And Related Symbol Documentation

◆ GaudiObjectHandler< MyTrack >

friend class GaudiObjectHandler< MyTrack >
friend

Definition at line 127 of file MyTrack.h.

Member Data Documentation

◆ m_decayVertices

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

Links to all decay vertices.

Definition at line 72 of file MyTrack.h.

◆ m_event

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

Link to Top level event.

Definition at line 68 of file MyTrack.h.

◆ m_originVertex

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

Link to origin vertex.

Definition at line 70 of file MyTrack.h.

◆ m_px

float Gaudi::TestSuite::MyTrack::m_px
protected

The track momentum.

Definition at line 66 of file MyTrack.h.

◆ m_py

float Gaudi::TestSuite::MyTrack::m_py
protected

Definition at line 66 of file MyTrack.h.

◆ m_pz

float Gaudi::TestSuite::MyTrack::m_pz
protected

Definition at line 66 of file MyTrack.h.


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