MyTrack.h
Go to the documentation of this file.
1 #ifndef GAUDIEXAMPLES_MYTRACK_H
2 #define GAUDIEXAMPLES_MYTRACK_H
3 
4 // Include files
5 #include "GaudiKernel/SmartRef.h"
6 #include "GaudiKernel/StreamBuffer.h"
7 #include "GaudiKernel/ContainedObject.h"
8 #include "GaudiKernel/KeyedContainer.h"
9 
10 #include "Event.h"
11 
12 class MyVertex;
13 
14 
15 // External declaration
16 static const CLID& CLID_MyTrack = 9999;
17 
18 
26 class MyTrack : public KeyedObject<int> {
27 private:
29  float m_px, m_py, m_pz;
33 public:
35  MyTrack() : m_px(0.0), m_py(0.0), m_pz(0.0) {
36  }
38  MyTrack(float x, float y, float z) : m_px(x), m_py(y), m_pz(z) {
39  }
41  virtual ~MyTrack() {
42  }
44  virtual const CLID& clID() const { return classID(); }
45  static const CLID& classID() { return CLID_MyTrack; }
47  float px() const { return m_px; }
49  float py() const { return m_py; }
51  float pz() const { return m_pz; }
53  void setPx(float px) { m_px = px; }
55  void setPy(float py) { m_py = py; }
57  void setPz(float pz) { m_pz = pz; }
58 
60  const Event* event() const {
61  return m_event;
62  }
64  void setEvent(Event* evt) {
65  m_event = evt;
66  }
67 
69  const MyVertex* decayVertex() const;
70 
72  void setDecayVertex(MyVertex* decay);
73 
74  std::ostream& fillStream( std::ostream& s ) const {
75  s << "px: " << px() << "py: " << py() << "px: " << pz();
76  return s;
77  }
78 
79 
80 };
81 
82 #include "MyVertex.h"
84 inline const MyVertex* MyTrack::decayVertex() const {
85  return m_decay;
86 }
87 
89 inline void MyTrack::setDecayVertex(MyVertex* decay) {
90  m_decay = decay;
91 }
92 
93 // Definition of all container types of MCParticle
95 
96 #endif // RIO_EXAMPLE1_MYTRACK_H
const Event * event() const
Access to the source track object (constant case)
Definition: MyTrack.h:60
SmartRef< MyVertex > m_decay
Definition: MyTrack.h:32
Essential information of the event used in examples It can be identified by "/Event".
Definition: Event.h:23
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
void setDecayVertex(MyVertex *decay)
Access to event object.
Definition: MyTrack.h:89
void setPz(float pz)
Accessors: Update z-component of the track momentum.
Definition: MyTrack.h:57
float py() const
Accessors: Retrieve y-component of the track momentum.
Definition: MyTrack.h:49
float m_py
Definition: MyTrack.h:29
void setEvent(Event *evt)
Access to event object.
Definition: MyTrack.h:64
void setPy(float py)
Accessors: Update y-component of the track momentum.
Definition: MyTrack.h:55
float px() const
Accessors: Retrieve x-component of the track momentum.
Definition: MyTrack.h:47
std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: MyTrack.h:74
static const CLID & classID()
Definition: MyTrack.h:45
float m_pz
Definition: MyTrack.h:29
float pz() const
Accessors: Retrieve z-component of the track momentum.
Definition: MyTrack.h:51
MyTrack(float x, float y, float z)
Standard constructor.
Definition: MyTrack.h:38
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:23
void setPx(float px)
Accessors: Update x-component of the track momentum.
Definition: MyTrack.h:53
virtual ~MyTrack()
Standard Destructor.
Definition: MyTrack.h:41
const MyVertex * decayVertex() const
Access to the source track object (constant case)
Definition: MyTrack.h:84
float m_px
The track momentum.
Definition: MyTrack.h:29
MyTrack()
Standard constructor.
Definition: MyTrack.h:35
string s
Definition: gaudirun.py:245
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyTrack.h:44
SmartRef< Event > m_event
Link to Top level event.
Definition: MyTrack.h:31
KeyedContainer< MyTrack > MyTrackVector
Definition: MyTrack.h:94
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8