00001
00002 #ifndef GLASTEVENT_EVENT_H
00003 #define GLASTEVENT_EVENT_H 1
00004
00005
00006
00007 #include <iostream>
00008 #include "GaudiKernel/Kernel.h"
00009 #include "GaudiKernel/StreamBuffer.h"
00010 #include "GaudiKernel/DataObject.h"
00011 #include "GlastEvent/Utilities/TimeStamp.h"
00012 #include "GlastEvent/TopLevel/Definitions.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00043 class Event : public DataObject {
00044
00045 public:
00047 Event(const char* name = "Event")
00048 : DataObject(name) { }
00050 virtual ~Event() { }
00051
00053 virtual const CLID& clID() const { return Event::classID(); }
00054 static const CLID& classID() { return CLID_Event; }
00055
00057 long event () const { return m_event; }
00059 void setEvent (long value) { m_event = value; }
00060
00062 long run () const { return m_run; }
00064 void setRun (long value) { m_run = value; }
00065
00067 const TimeStamp& time () const { return m_time; }
00069 void setTime (const TimeStamp& value) { m_time = value; }
00070
00072 virtual StreamBuffer& serialize( StreamBuffer& s ) const;
00074 virtual StreamBuffer& serialize( StreamBuffer& s );
00075
00077 friend std::ostream& operator<< ( std::ostream& s, const Event& obj ) {
00078 return obj.fillStream(s);
00079 }
00081 virtual std::ostream& fillStream( std::ostream& s ) const;
00082
00083 private:
00085 long m_event;
00087 long m_run;
00089 TimeStamp m_time;
00090 };
00091
00092
00093
00094
00095
00096
00097
00099 inline StreamBuffer& Event::serialize( StreamBuffer& s ) const {
00100 DataObject::serialize(s);
00101
00102 return s;
00103
00104
00105
00106 }
00107
00108
00110 inline StreamBuffer& Event::serialize( StreamBuffer& s ) {
00111 DataObject::serialize(s);
00112
00113 return s;
00114
00115
00116
00117 }
00118
00119
00121 inline std::ostream& Event::fillStream( std::ostream& s ) const {
00122 return s
00123 << "class Event :"
00124 << "\n Event number = "
00125 << GlastEventField( GlastEvent::field12 )
00126 << m_event
00127 << "\n Run number = "
00128 << GlastEventField( GlastEvent::field12 )
00129 << m_run
00130 << "\n Time = " << m_time;
00131 }
00132
00133
00134 #endif // GLASTEVENT_EVENT_H