All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MyVertex.h
Go to the documentation of this file.
1 // $Id: MyVertex.h,v 1.4 2006/01/26 18:11:06 mato Exp $
2 #ifndef GAUDIEXAMPLES_MYVERTEX_H
3 #define GAUDIEXAMPLES_MYVERTEX_H
4 
5 // Include files
6 #include "GaudiKernel/SmartRef.h"
11 
12 // Forward declaration
13 class MyTrack;
14 
15 // External declaration
16 static const CLID& CLID_MyVertex = 9998;
17 
24 class MyVertex : public KeyedObject<int> {
25 private:
27  double m_x, m_y, m_z;
31 public:
33  MyVertex() : m_x(0.0), m_y(0.0), m_z(0.0) {
34  }
36  MyVertex(double x, double y, double z) : m_x(x), m_y(y), m_z(z) {
37  }
39  virtual ~MyVertex() {
40  }
42  virtual const CLID& clID() const { return classID(); }
43  static const CLID& classID() { return CLID_MyVertex; }
45  double x() const { return m_x; }
47  double y() const { return m_y; }
49  double z() const { return m_z; }
51  void setX(double x) { m_x = x; }
53  void setY(double y) { m_y = y; }
55  void setZ(double z) { m_z = z; }
56 
58  const MyTrack* motherTrack() const { return m_mother; }
59  MyTrack* motherTrack() { return m_mother; }
62  //void setMotherTrack( SmartRef<MyTrack> value );
63 
65  //const SmartRefVector<MyTrack>& daughterTracks() const;
66  // SmartRefVector<MyTrack>& daughterTracks();
68  //void setDaughterTracks( const SmartRefVector<MyTrack>& value );
70  //void removeDaughterTracks();
73  void addDaughterTrack( MyTrack* value ) { m_daughters.push_back(value); }
74  //void addDaughterTrack( SmartRef<MyTrack> value );
75 
78 
80  virtual StreamBuffer& serialize(StreamBuffer& s) const;
81 };
82 
83 #include "MyTrack.h"
84 
87  return s >> m_x >> m_y >> m_z >> m_mother(this) >> m_daughters(this);
88 }
91  return s << m_x << m_y << m_z << m_mother(this) << m_daughters(this);
92 }
93 
94 
95 // Definition of all container types of MyVertex
97 
98 #endif // RIO_EXAMPLE1_MYTRACK_H
const MyTrack * motherTrack() const
Retrieve pointer to mother particle (const or non-const)
Definition: MyVertex.h:58
double y() const
Accessors: Retrieve y-position.
Definition: MyVertex.h:47
SmartRef< MyTrack > m_mother
Link to Top level event.
Definition: MyVertex.h:29
double m_z
Definition: MyVertex.h:27
double m_x
The track momentum.
Definition: MyVertex.h:27
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
MyVertex(double x, double y, double z)
Standard constructor.
Definition: MyVertex.h:36
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:40
void setMotherTrack(MyTrack *value)
Update pointer to mother particle (by a C++ pointer or a smart reference)
Definition: MyVertex.h:61
virtual ~MyVertex()
Standard Destructor.
Definition: MyVertex.h:39
MyVertex()
Standard constructor.
Definition: MyVertex.h:33
MyTrack * motherTrack()
Definition: MyVertex.h:59
static const CLID & classID()
Definition: MyVertex.h:43
virtual StreamBuffer & serialize(StreamBuffer &s)
Input streamer.
Definition: MyVertex.h:86
void setX(double x)
Accessors: Update x-position.
Definition: MyVertex.h:51
KeyedContainer< MyVertex > MyVertexVector
Definition: MyVertex.h:96
SmartRefVector< MyTrack > m_daughters
Definition: MyVertex.h:30
void addDaughterTrack(MyTrack *value)
Retrieve pointer to vector of daughter particles (const or non-const)
Definition: MyVertex.h:73
double m_y
Definition: MyVertex.h:27
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
void setZ(double z)
Accessors: Update z-position.
Definition: MyVertex.h:55
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:24
void setY(double y)
Accessors: Update y-position.
Definition: MyVertex.h:53
string s
Definition: gaudirun.py:210
double x() const
Accessors: Retrieve x-position.
Definition: MyVertex.h:45
double z() const
Accessors: Retrieve z-position.
Definition: MyVertex.h:49
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyVertex.h:42