00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/TopLevel/AnalEvent.h,v 1.2 2001/04/18 19:07:26 igable Exp $ 00002 #ifndef LHCBEVENT_ANALEVENT_H 00003 #define LHCBEVENT_ANALEVENT_H 1 00004 00005 00006 // Include files 00007 #include <iostream> 00008 #include "GaudiKernel/Kernel.h" 00009 #include "GaudiKernel/DataObject.h" 00010 #include "GaudiKernel/StreamBuffer.h" 00011 #include "GlastEvent/Utilities/Classification.h" 00012 #include "GlastEvent/TopLevel/Definitions.h" 00013 00014 00015 // Externals 00016 extern const CLID& CLID_AnalEvent; 00017 00018 00019 //------------------------------------------------------------------------------ 00020 // 00021 // ClassName: AnalEvent 00022 // 00023 // Description: Essential information of the analysis event 00024 // It can be identified by "/Event/Anal" 00025 // 00026 // It contains: 00027 // - event classification 00028 // 00029 // Author: Pavel Binko 00030 // Changes: P.Binko 19/10/1999 : Formating of ASCII output 00031 // 00032 //------------------------------------------------------------------------------ 00033 00034 00035 class AnalEvent : public DataObject { 00036 00037 public: 00039 AnalEvent(const char* name = "AnalEvent") 00040 : DataObject(name) { } 00042 virtual ~AnalEvent() { } 00043 00045 virtual const CLID& clID() const { return AnalEvent::classID(); } 00046 static const CLID& classID() { return CLID_AnalEvent; } 00047 00049 const Classification& classification() const { 00050 return m_classification; 00051 } 00053 void setClassification (const Classification& value) { 00054 m_classification = value; 00055 } 00056 00058 virtual StreamBuffer& serialize( StreamBuffer& s ) const; 00060 virtual StreamBuffer& serialize( StreamBuffer& s ); 00061 00063 friend std::ostream& operator<< ( std::ostream& s, const AnalEvent& obj ) { 00064 return obj.fillStream(s); 00065 } 00067 virtual std::ostream& fillStream( std::ostream& s ) const; 00068 00069 private: 00071 Classification m_classification; 00072 00073 }; 00074 00075 00076 // 00077 // Inline code must be outside the class definition 00078 // 00079 00080 00082 inline StreamBuffer& AnalEvent::serialize( StreamBuffer& s ) const { 00083 DataObject::serialize(s); 00084 return s << m_classification; 00085 } 00086 00087 00089 inline StreamBuffer& AnalEvent::serialize( StreamBuffer& s ) { 00090 DataObject::serialize(s); 00091 return s >> m_classification; 00092 } 00093 00094 00096 inline std::ostream& AnalEvent::fillStream( std::ostream& s ) const { 00097 return s 00098 << "class AnalEvent :" 00099 << "\n Event classification = " 00100 << GlastEventField( GlastEvent::field12 ) 00101 << m_classification; 00102 } 00103 00104 00105 #endif // LHCBEVENT_ANALEVENT_H
1.2.3 written by Dimitri van Heesch,
© 1997-2000