| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

MyVertex.h
Go to the documentation of this file.
1 #ifndef GAUDIEXAMPLES_MYVERTEX_H
2 #define GAUDIEXAMPLES_MYVERTEX_H
3
4 // Include files
5 #include "GaudiKernel/SmartRef.h"
6 #include "GaudiKernel/SmartRefVector.h"
7 #include "GaudiKernel/StreamBuffer.h"
8 #include "GaudiKernel/ContainedObject.h"
9 #include "GaudiKernel/KeyedContainer.h"
10
11 // Forward declaration
12 class MyTrack;
13
14 // External declaration
15 static const CLID& CLID_MyVertex = 9998;
16
23 class MyVertex : public KeyedObject<int> {
24 private:
26 double m_x, m_y, m_z;
28 SmartRef<MyTrack> m_mother;
29 SmartRefVector<MyTrack> m_daughters;
30 public:
32 MyVertex() : m_x(0.0), m_y(0.0), m_z(0.0) {
33 }
35 MyVertex(double x, double y, double z) : m_x(x), m_y(y), m_z(z) {
36 }
38 virtual ~MyVertex() {
39 }
41 virtual const CLID& clID() const { return classID(); }
42 static const CLID& classID() { return CLID_MyVertex; }
44 double x() const { return m_x; }
46 double y() const { return m_y; }
48 double z() const { return m_z; }
50 void setX(double x) { m_x = x; }
52 void setY(double y) { m_y = y; }
54 void setZ(double z) { m_z = z; }
55
57 const MyTrack* motherTrack() const { return m_mother; }
58 MyTrack* motherTrack() { return m_mother; }
60 void setMotherTrack( MyTrack* value ) { m_mother = value; }
61 //void setMotherTrack( SmartRef<MyTrack> value );
62
64 //const SmartRefVector<MyTrack>& daughterTracks() const;
65 // SmartRefVector<MyTrack>& daughterTracks();
67 //void setDaughterTracks( const SmartRefVector<MyTrack>& value );
69 //void removeDaughterTracks();
72 void addDaughterTrack( MyTrack* value ) { m_daughters.push_back(value); }
73 //void addDaughterTrack( SmartRef<MyTrack> value );
74
76 virtual StreamBuffer& serialize(StreamBuffer& s);
77
79 virtual StreamBuffer& serialize(StreamBuffer& s) const;
80 };
81
82 #include "MyTrack.h"
83
85 inline StreamBuffer& MyVertex::serialize(StreamBuffer& s) {
86 return s >> m_x >> m_y >> m_z >> m_mother(this) >> m_daughters(this);
87 }
89 inline StreamBuffer& MyVertex::serialize(StreamBuffer& s) const {
90 return s << m_x << m_y << m_z << m_mother(this) << m_daughters(this);
91 }
92
93
94 // Definition of all container types of MyVertex
95 typedef KeyedContainer<MyVertex> MyVertexVector;
96
97 #endif // RIO_EXAMPLE1_MYTRACK_H
MyVertex::motherTrack
const MyTrack * motherTrack() const
Retrieve pointer to mother particle (const or non-const)
Definition: MyVertex.h:57
MyVertex::y
double y() const
Accessors: Retrieve y-position.
Definition: MyVertex.h:46
MyVertex::m_mother
SmartRef< MyTrack > m_mother
Link to Top level event.
Definition: MyVertex.h:28
MyVertex::m_z
double m_z
Definition: MyVertex.h:26
MyVertex::m_x
double m_x
The track momentum.
Definition: MyVertex.h:26
KeyedObject
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
MyVertex::MyVertex
MyVertex(double x, double y, double z)
Standard constructor.
Definition: MyVertex.h:35
StreamBuffer
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
MyVertex::setMotherTrack
void setMotherTrack(MyTrack *value)
Update pointer to mother particle (by a C++ pointer or a smart reference)
Definition: MyVertex.h:60
KeyedContainer< MyVertex >
MyVertex::~MyVertex
virtual ~MyVertex()
Standard Destructor.
Definition: MyVertex.h:38
MyVertex::MyVertex
MyVertex()
Standard constructor.
Definition: MyVertex.h:32
SmartRefVector.h
SmartRef< MyTrack >
MyVertex::motherTrack
MyTrack * motherTrack()
Definition: MyVertex.h:58
StreamBuffer.h
MyTrack.h
SmartRefVector< MyTrack >
std::vector::push_back
T push_back(T...args)
MyVertex::classID
static const CLID & classID()
Definition: MyVertex.h:42
MyVertex::serialize
virtual StreamBuffer & serialize(StreamBuffer &s)
Input streamer.
Definition: MyVertex.h:85
MyTrack
Definition: MyTrack.h:26
MyVertex::setX
void setX(double x)
Accessors: Update x-position.
Definition: MyVertex.h:50
MyVertexVector
KeyedContainer< MyVertex > MyVertexVector
Definition: MyVertex.h:95
MyVertex::m_daughters
SmartRefVector< MyTrack > m_daughters
Definition: MyVertex.h:29
MyVertex::addDaughterTrack
void addDaughterTrack(MyTrack *value)
Retrieve pointer to vector of daughter particles (const or non-const)
Definition: MyVertex.h:72
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
MyVertex::m_y
double m_y
Definition: MyVertex.h:26
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
MyVertex::setZ
void setZ(double z)
Accessors: Update z-position.
Definition: MyVertex.h:54
MyVertex
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:23
MyVertex::setY
void setY(double y)
Accessors: Update y-position.
Definition: MyVertex.h:52
SmartRef.h
gaudirun.s
string s
Definition: gaudirun.py:245
MyVertex::x
double x() const
Accessors: Retrieve x-position.
Definition: MyVertex.h:44
ContainedObject.h
MyVertex::z
double z() const
Accessors: Retrieve z-position.
Definition: MyVertex.h:48
KeyedContainer.h
MyVertex::clID
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyVertex.h:41