The Gaudi Framework  master (594c33fa)
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 More...
 
typedef std::vector< const MyTrack * > ConstVector
 the type of vector of const-pointers More...
 
typedef SharedObjectsContainer< MyTrackSelection
 the type of selection More...
 
typedef KeyedContainer< MyTrack, Containers::HashMapContainer
 the actual type of container in TES More...
 
- Public Types inherited from KeyedObject< int >
typedef int key_type
 Definition of the key-type to access object. More...
 

Public Member Functions

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

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 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

Definition at line 39 of file MyTrack.h.

Member Typedef Documentation

◆ 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 }

◆ 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 }

◆ ~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 ) ); }

◆ 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(); }

◆ 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; }

◆ originVertex()

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

Origin vertex.

Definition at line 138 of file MyTrack.h.

138 { return m_originVertex; }

◆ 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  {
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 ContainedObject.

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  }

◆ serialize() [2/2]

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

Serialize the object for reading.

Reimplemented from ContainedObject.

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; }

◆ 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; }

◆ 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; }

Friends And Related Function 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:
IOTest.evt
evt
Definition: IOTest.py:107
Gaudi::TestSuite::MyTrack::m_py
float m_py
Definition: MyTrack.h:66
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
Gaudi::TestSuite::MyTrack::px
float px() const
Accessors: Retrieve x-component of the track momentum.
Definition: MyTrack.h:86
Gaudi::TestSuite::MyTrack::m_pz
float m_pz
Definition: MyTrack.h:66
gaudirun.s
string s
Definition: gaudirun.py:346
bug_34121.t
t
Definition: bug_34121.py:31
Gaudi::TestSuite::MyTrack::pz
float pz() const
Accessors: Retrieve z-component of the track momentum.
Definition: MyTrack.h:90
KeyedObject< int >
Gaudi::TestSuite::MyTrack::classID
static const CLID & classID()
Definition: MyTrack.h:84
Gaudi::TestSuite::MyTrack::m_decayVertices
SmartRefVector< MyVertex > m_decayVertices
Links to all decay vertices.
Definition: MyTrack.h:72
Gaudi::TestSuite::MyTrack::m_event
SmartRef< Event > m_event
Link to Top level event.
Definition: MyTrack.h:68
Gaudi::TestSuite::MyTrack::m_originVertex
SmartRef< MyVertex > m_originVertex
Link to origin vertex.
Definition: MyTrack.h:70
SmartRef
Kernel objects: SmartRef.
Definition: SmartRef.h:76
Gaudi::TestSuite::MyTrack::py
float py() const
Accessors: Retrieve y-component of the track momentum.
Definition: MyTrack.h:88
Gaudi::TestSuite::MyTrack::m_px
float m_px
The track momentum.
Definition: MyTrack.h:66
ContainedObject::serialize
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
Definition: ContainedObject.h:69