| The Gaudi Framework v27r1

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

- File List
- File Members

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;
31 SmartRef<Event> m_event;
32 SmartRef<MyVertex> m_decay;
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
94 typedef KeyedContainer<MyTrack> MyTrackVector;
95
96 #endif // RIO_EXAMPLE1_MYTRACK_H
MyTrack::event
const Event * event() const
Access to the source track object (constant case)
Definition: MyTrack.h:60
MyTrack::m_decay
SmartRef< MyVertex > m_decay
Definition: MyTrack.h:32
Event
Essential information of the event used in examples It can be identified by "/Event".
Definition: Event.h:23
KeyedObject
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
MyTrack::setDecayVertex
void setDecayVertex(MyVertex *decay)
Access to event object.
Definition: MyTrack.h:89
MyTrack::setPz
void setPz(float pz)
Accessors: Update z-component of the track momentum.
Definition: MyTrack.h:57
KeyedContainer< MyTrack >
SmartRef< Event >
MyTrack::py
float py() const
Accessors: Retrieve y-component of the track momentum.
Definition: MyTrack.h:49
MyTrack::m_py
float m_py
Definition: MyTrack.h:29
MyTrack::setEvent
void setEvent(Event *evt)
Access to event object.
Definition: MyTrack.h:64
StreamBuffer.h
MyTrack::setPy
void setPy(float py)
Accessors: Update y-component of the track momentum.
Definition: MyTrack.h:55
MyTrack
Definition: MyTrack.h:26
MyTrack::px
float px() const
Accessors: Retrieve x-component of the track momentum.
Definition: MyTrack.h:47
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
MyTrack::fillStream
std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: MyTrack.h:74
MyTrack::classID
static const CLID & classID()
Definition: MyTrack.h:45
Event.h
MyTrack::m_pz
float m_pz
Definition: MyTrack.h:29
MyTrack::pz
float pz() const
Accessors: Retrieve z-component of the track momentum.
Definition: MyTrack.h:51
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
MyTrack::MyTrack
MyTrack(float x, float y, float z)
Standard constructor.
Definition: MyTrack.h:38
MyVertex
Simple class that represents a vertex for testing purposes.
Definition: MyVertex.h:23
MyVertex.h
MyTrack::setPx
void setPx(float px)
Accessors: Update x-component of the track momentum.
Definition: MyTrack.h:53
MyTrack::~MyTrack
virtual ~MyTrack()
Standard Destructor.
Definition: MyTrack.h:41
MyTrack::decayVertex
const MyVertex * decayVertex() const
Access to the source track object (constant case)
Definition: MyTrack.h:84
MyTrack::m_px
float m_px
The track momentum.
Definition: MyTrack.h:29
MyTrack::MyTrack
MyTrack()
Standard constructor.
Definition: MyTrack.h:35
SmartRef.h
gaudirun.s
string s
Definition: gaudirun.py:245
MyTrack::clID
virtual const CLID & clID() const
Retrieve pointer to class definition structure.
Definition: MyTrack.h:44
ContainedObject.h
MyTrack::m_event
SmartRef< Event > m_event
Link to Top level event.
Definition: MyTrack.h:31
MyTrackVector
KeyedContainer< MyTrack > MyTrackVector
Definition: MyTrack.h:94
std::ostream
STL class.
KeyedContainer.h