00001
00002 #ifndef LHCBEVENT_MCEVENT_H
00003 #define LHCBEVENT_MCEVENT_H 1
00004
00005
00006
00007 #include <iostream>
00008 #include <vector>
00009 #include <algorithm>
00010 #include "GaudiKernel/Kernel.h"
00011 #include "GaudiKernel/DataObject.h"
00012 #include "GaudiKernel/StreamBuffer.h"
00013 #include "GlastEvent/TopLevel/SubMCEvent.h"
00014 #include "GlastEvent/TopLevel/Definitions.h"
00015
00016
00017
00018 extern const CLID& CLID_McEvent;
00019
00020
00021
00022
00023
00024
00025
00026
00027
00037 class MCEvent : public DataObject {
00038
00039 public:
00041 MCEvent( const char* name = "MCEvent", int sourceId=0)
00042 : DataObject(name), m_sourceId(sourceId) {}
00044 virtual ~MCEvent() { }
00045
00047 virtual const CLID& clID() const { return MCEvent::classID(); }
00048 static const CLID& classID() { return CLID_McEvent; }
00049
00051 MCEvent& operator=(const MCEvent& copy) {
00052 return *this;
00053 }
00054
00056 int sourceId () const {
00057 return m_sourceId;
00058 }
00060 void setSourceId(int s);
00061
00063 virtual StreamBuffer& serialize( StreamBuffer& s ) const;
00065 virtual StreamBuffer& serialize( StreamBuffer& s );
00066
00068 friend std::ostream& operator<< ( std::ostream& s, const MCEvent& obj ) {
00069 return obj.fillStream(s);
00070 }
00072 virtual std::ostream& fillStream( std::ostream& s ) const;
00073
00074 private:
00075
00076 int m_sourceId;
00077
00078 };
00079
00080 inline void MCEvent::setSourceId(int s)
00081 {
00082 m_sourceId = s;
00083 }
00084
00085
00086
00087
00088
00089
00091 inline StreamBuffer& MCEvent::serialize( StreamBuffer& s ) const {
00092 DataObject::serialize(s);
00093 s << m_sourceId;
00094 return s;
00095 }
00096
00097
00099 inline StreamBuffer& MCEvent::serialize( StreamBuffer& s ) {
00100 DataObject::serialize(s);
00101 s >> m_sourceId;
00102 return s;
00103 }
00104
00105
00107 inline std::ostream& MCEvent::fillStream( std::ostream& s ) const {
00108 s << "class MCEvent :\n"
00109 << " Source Id = "
00110 << GlastEventField( GlastEvent::field12 )
00111 << m_sourceId;
00112 return s;
00113 }
00114
00115
00116 #endif // GLASTEVENT_MCEVENT_H