Event.h
Go to the documentation of this file.
1 #ifndef GAUDIEXAMPLES_EVENT_H
2 #define GAUDIEXAMPLES_EVENT_H 1
3 
4 // Include files
5 #include "GaudiKernel/Kernel.h"
6 #include "GaudiKernel/Time.h"
7 #include "GaudiKernel/StreamBuffer.h"
8 #include "GaudiKernel/DataObject.h"
9 #include <iostream>
10 #include <iomanip>
11 
21 static const CLID CLID_Event = 110;
22 
23 class Event : public DataObject {
24 
25 public:
27  Event(): DataObject(), m_event(0), m_run(0) { }
29  virtual ~Event() { }
30 
32  virtual const CLID& clID() const { return classID(); }
33  static const CLID& classID() { return CLID_Event; }
34 
36  long event () const { return m_event; }
38  void setEvent (long value) { m_event = value; }
39 
41  long run () const { return m_run; }
43  void setRun (long value) { m_run = value; }
44 
46  const Gaudi::Time& time () const { return m_time; }
48  void setTime (const Gaudi::Time& value) { m_time = value; }
49 
51  friend std::ostream& operator<< ( std::ostream& s, const Event& obj ) {
52  return obj.fillStream(s);
53  }
55  virtual inline std::ostream& fillStream( std::ostream& s ) const;
56 
57 private:
59  long m_event;
61  long m_run;
64 };
65 
67 inline std::ostream& Event::fillStream( std::ostream& s ) const {
68  return s
69  << "class Event :"
70  << "\n Event number = "
71  << std::setw(12)
72  << m_event
73  << "\n Run number = "
74  << std::setw(12)
75  << m_run
76  << "\n Time = " << m_time;
77 }
78 
79 
80 #endif // GAUDIEXAMPLES_EVENT_H
long event() const
Retrieve event number.
Definition: Event.h:36
Essential information of the event used in examples It can be identified by "/Event".
Definition: Event.h:23
Gaudi::Time m_time
Time stamp.
Definition: Event.h:63
Event()
Constructors.
Definition: Event.h:27
friend std::ostream & operator<<(std::ostream &s, const Event &obj)
Output operator (ASCII)
Definition: Event.h:51
void setRun(long value)
Update run number.
Definition: Event.h:43
long m_event
Event number.
Definition: Event.h:59
long run() const
Retrieve run number.
Definition: Event.h:41
void setTime(const Gaudi::Time &value)
Update reference to event time stamp.
Definition: Event.h:48
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: Event.h:67
long m_run
Run number.
Definition: Event.h:61
Based on seal::Time.
Definition: Time.h:213
const Gaudi::Time & time() const
Retrieve reference to event time stamp.
Definition: Event.h:46
static const CLID & classID()
Definition: Event.h:33
void setEvent(long value)
Update event number.
Definition: Event.h:38
string s
Definition: gaudirun.py:245
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual ~Event()
Destructor.
Definition: Event.h:29
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: Event.h:32