All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MyTrack.h
Go to the documentation of this file.
1 // $Id: MyTrack.h,v 1.4 2006/01/26 18:11:06 mato Exp $
2 #ifndef GAUDIEXAMPLES_MYTRACK_H
3 #define GAUDIEXAMPLES_MYTRACK_H
4 
5 // Include files
6 #include "GaudiKernel/SmartRef.h"
10 
11 #include "Event.h"
12 
13 class MyVertex;
14 
15 
16 // External declaration
17 static const CLID& CLID_MyTrack = 9999;
18 
19 
27 class MyTrack : public KeyedObject<int> {
28 private:
30  float m_px, m_py, m_pz;
34 public:
36  MyTrack() : m_px(0.0), m_py(0.0), m_pz(0.0) {
37  }
39  MyTrack(float x, float y, float z) : m_px(x), m_py(y), m_pz(z) {
40  }
42  virtual ~MyTrack() {
43  }
45  virtual const CLID& clID() const { return classID(); }
46  static const CLID& classID() { return CLID_MyTrack; }
48  float px() const { return m_px; }
50  float py() const { return m_py; }
52  float pz() const { return m_pz; }
54  void setPx(float px) { m_px = px; }
56  void setPy(float py) { m_py = py; }
58  void setPz(float pz) { m_pz = pz; }
59 
61  const Event* event() const {
62  return m_event;
63  }
65  void setEvent(Event* evt) {
66  m_event = evt;
67  }
68 
70  const MyVertex* decayVertex() const;
71 
73  void setDecayVertex(MyVertex* decay);
74 
75  std::ostream& fillStream( std::ostream& s ) const {
76  s << "px: " << px() << "py: " << py() << "px: " << pz();
77  return s;
78  }
79 
80 
81 };
82 
83 #include "MyVertex.h"
85 inline const MyVertex* MyTrack::decayVertex() const {
86  return m_decay;
87 }
88 
90 inline void MyTrack::setDecayVertex(MyVertex* decay) {
91  m_decay = decay;
92 }
93 
94 // Definition of all container types of MCParticle
96 
97 #endif // RIO_EXAMPLE1_MYTRACK_H
const Event * event() const
Access to the source track object (constant case)
Definition: MyTrack.h:61
SmartRef< MyVertex > m_decay
Definition: MyTrack.h:33
Essential information of the event used in examples It can be identified by "/Event".
Definition: Event.h:24
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
void setDecayVertex(MyVertex *decay)
Access to event object.
Definition: MyTrack.h:90
void setPz(float pz)
Accessors: Update z-component of the track momentum.
Definition: MyTrack.h:58
float py() const
Accessors: Retrieve y-component of the track momentum.
Definition: MyTrack.h:50
float m_py
Definition: MyTrack.h:30
void setEvent(Event *evt)
Access to event object.
Definition: MyTrack.h:65
void setPy(float py)
Accessors: Update y-component of the track momentum.
Definition: MyTrack.h:56
float px() const
Accessors: Retrieve x-component of the track momentum.
Definition: MyTrack.h:48
std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: MyTrack.h:75
static const CLID & classID()
Definition: MyTrack.h:46
float m_pz
Definition: MyTrack.h:30
float pz() const
Accessors: Retrieve z-component of the track momentum.
Definition: MyTrack.h:52
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
MyTrack(float x, float y, float z)
Standard constructor.
Definition: MyTrack.h:39
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:24
void setPx(float px)
Accessors: Update x-component of the track momentum.
Definition: MyTrack.h:54
virtual ~MyTrack()
Standard Destructor.
Definition: MyTrack.h:42
const MyVertex * decayVertex() const
Access to the source track object (constant case)
Definition: MyTrack.h:85
float m_px
The track momentum.
Definition: MyTrack.h:30
MyTrack()
Standard constructor.
Definition: MyTrack.h:36
string s
Definition: gaudirun.py:210
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyTrack.h:45
SmartRef< Event > m_event
Link to Top level event.
Definition: MyTrack.h:32
KeyedContainer< MyTrack > MyTrackVector
Definition: MyTrack.h:95