Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Event.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/TopLevel/Event.h,v 1.4 2001/04/19 17:35:03 burnett Exp $
00002 #ifndef GLASTEVENT_EVENT_H
00003 #define GLASTEVENT_EVENT_H 1
00004 
00005 
00006 // Include files
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 // ClassName:   Event
00018 //  
00019 // Description: Essential information of the event
00020 //              It can be identified by "/Event"
00021 //
00022 //              It contains:
00023 //              - run number
00024 //              - event number
00025 //              - time stamp
00026 //
00027 // Author:      Pavel Binko
00028 // Changes:     P.Binko 19/10/1999 : Formating of ASCII output
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 // Inline code must be outside the class definition
00095 //
00096 
00097 
00099 inline StreamBuffer& Event::serialize( StreamBuffer& s ) const                 {
00100   DataObject::serialize(s);
00101   // HMK The member variables are not filled yet
00102   return s;
00103     //<< m_event
00104     //<< m_run
00105     //<< m_time;
00106 }
00107 
00108 
00110 inline StreamBuffer& Event::serialize( StreamBuffer& s )                       {
00111   DataObject::serialize(s);
00112   // HMK The member variables are not filled yet
00113   return s;
00114     //>> m_event
00115     //>> m_run
00116     //>> m_time;
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

Generated at Wed Nov 21 12:22:49 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000