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;
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 
77 
79  virtual StreamBuffer& serialize(StreamBuffer& s) const;
80 };
81 
82 #include "MyTrack.h"
83 
86  return s >> m_x >> m_y >> m_z >> m_mother(this) >> m_daughters(this);
87 }
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
96 
97 #endif // RIO_EXAMPLE1_MYTRACK_H
const MyTrack * motherTrack() const
Retrieve pointer to mother particle (const or non-const)
Definition: MyVertex.h:57
double y() const
Accessors: Retrieve y-position.
Definition: MyVertex.h:46
SmartRef< MyTrack > m_mother
Link to Top level event.
Definition: MyVertex.h:28
double m_z
Definition: MyVertex.h:26
double m_x
The track momentum.
Definition: MyVertex.h:26
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
MyVertex(double x, double y, double z)
Standard constructor.
Definition: MyVertex.h:35
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
void setMotherTrack(MyTrack *value)
Update pointer to mother particle (by a C++ pointer or a smart reference)
Definition: MyVertex.h:60
virtual ~MyVertex()
Standard Destructor.
Definition: MyVertex.h:38
MyVertex()
Standard constructor.
Definition: MyVertex.h:32
MyTrack * motherTrack()
Definition: MyVertex.h:58
static const CLID & classID()
Definition: MyVertex.h:42
virtual StreamBuffer & serialize(StreamBuffer &s)
Input streamer.
Definition: MyVertex.h:85
void setX(double x)
Accessors: Update x-position.
Definition: MyVertex.h:50
KeyedContainer< MyVertex > MyVertexVector
Definition: MyVertex.h:95
SmartRefVector< MyTrack > m_daughters
Definition: MyVertex.h:29
void addDaughterTrack(MyTrack *value)
Retrieve pointer to vector of daughter particles (const or non-const)
Definition: MyVertex.h:72
double m_y
Definition: MyVertex.h:26
void setZ(double z)
Accessors: Update z-position.
Definition: MyVertex.h:54
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:23
void setY(double y)
Accessors: Update y-position.
Definition: MyVertex.h:52
string s
Definition: gaudirun.py:245
double x() const
Accessors: Retrieve x-position.
Definition: MyVertex.h:44
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
double z() const
Accessors: Retrieve z-position.
Definition: MyVertex.h:48
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyVertex.h:41