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

RawEvent.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/TopLevel/RawEvent.h,v 1.3 2001/04/18 19:07:26 igable Exp $
00002 #ifndef LHCBEVENT_RAWEVENT_H
00003 #define LHCBEVENT_RAWEVENT_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/TriggerPattern.h"
00012 #include "GlastEvent/TopLevel/Definitions.h"
00013 
00014 
00015 // Externals 
00016 extern const CLID& CLID_RawEvent;
00017 
00018 
00019 //------------------------------------------------------------------------------
00020 //
00021 // ClassName:   RawEvent
00022 //  
00023 // Description: Essential information of the raw event
00024 //              It can be identified by "/Event/Raw"
00025 //
00026 //              It contains:
00027 //              - flag, if comming from Monte Carlo
00028 //              - error status
00029 //              - high voltage map
00030 //              - trigger map
00031 //
00032 // Author:      Pavel Binko
00033 // Changes:     P.Binko 19/10/1999 : Formating of ASCII output
00034 //
00035 //------------------------------------------------------------------------------
00036 
00050 class RawEvent : public DataObject                                             {
00051 
00052 public:
00054   RawEvent(const char* name = "RawEvent")
00055     : DataObject(name), 
00056       m_fromMC(false),
00057       m_errorStatus(0),
00058       m_highVoltageMask(0)                                                   { }
00060   virtual ~RawEvent()                                                        { }
00061 
00063   virtual const CLID& clID() const               { return RawEvent::classID(); }
00064   static const CLID& classID()                         { return CLID_RawEvent; }
00065 
00067   bool fromMC () const                                                         {
00068     return m_fromMC;
00069   }
00071   void setFromMC (bool value)                                                  {
00072     m_fromMC = value;
00073   }
00074 
00076   long errorStatus () const                                                    {
00077     return m_errorStatus;
00078   }
00080   void setErrorStatus (long value)                                             {
00081     m_errorStatus = value;
00082   }
00083 
00085   long highVoltageMask () const                                                {
00086     return m_highVoltageMask;
00087   }
00089   void setHighVoltageMask (long value)                                         {
00090     m_highVoltageMask = value;
00091   }
00092 
00094   const TriggerPattern& triggerPattern () const                                {
00095     return m_triggerPattern;
00096   }
00098   void setTriggerPattern (const TriggerPattern& value)                         {
00099     m_triggerPattern = value;
00100   }
00101 
00103   virtual StreamBuffer& serialize( StreamBuffer& s ) const;
00105   virtual StreamBuffer& serialize( StreamBuffer& s );
00106 
00108   friend std::ostream& operator<< ( std::ostream& s, const RawEvent& obj )     {
00109     return obj.fillStream(s);
00110   }
00112   virtual std::ostream& fillStream( std::ostream& s ) const;
00113 
00114 private: 
00116   bool              m_fromMC;
00118   long              m_errorStatus;
00120   long              m_highVoltageMask;
00122   TriggerPattern    m_triggerPattern;
00123 
00124 };
00125 
00126 
00127 //
00128 // Inline code must be outside the class definition
00129 //
00130 
00131 
00133 inline StreamBuffer& RawEvent::serialize( StreamBuffer& s ) const              {
00134   DataObject::serialize(s);
00135   //unsigned char u = (m_fromMC) ? 1 : 0;
00136   return s;
00137 //    << u
00138 //    << m_errorStatus
00139 //    << m_highVoltageMask
00140 //    << m_triggerPattern;
00141 }
00142 
00143 
00145 inline StreamBuffer& RawEvent::serialize( StreamBuffer& s )                    {
00146   DataObject::serialize(s);
00147   unsigned char u;
00148  // s >> u
00149  //   >> m_errorStatus
00150  //   >> m_highVoltageMask
00151  //   >> m_triggerPattern;
00152  // m_fromMC = (u) ? true : false;
00153   return s;
00154 }
00155 
00156 
00158 inline std::ostream& RawEvent::fillStream( std::ostream& s ) const             {
00159   s << "class RawEvent :"
00160     << "\n    Flag of origin    = ";
00161   if( m_fromMC ) {
00162     s << " true";
00163   }
00164   else {
00165     s << "false";
00166   }
00167   s << "\n    Error status      = "
00168     << GlastEventField( GlastEvent::field12 )
00169     << m_errorStatus
00170     << "\n    High voltage mask = "
00171     << GlastEventField( GlastEvent::field12 )
00172     << m_highVoltageMask
00173     << "\n    Present triggers  = " << m_triggerPattern;
00174   return s;
00175 }
00176 
00177 
00178 #endif  // LHCBEVENT_RAWEVENT_H

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