00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/TopLevel/SubMCEvent.h,v 1.2 2001/04/18 19:07:26 igable Exp $ 00002 #ifndef LHCBEVENT_SUBMCEVENT_H 00003 #define LHCBEVENT_SUBMCEVENT_H 1 00004 00005 00006 // Include files 00007 #include <iostream> 00008 #include <vector> 00009 #include "GaudiKernel/Kernel.h" 00010 #include "GaudiKernel/StreamBuffer.h" 00011 #include "GlastEvent/Utilities/RandomNumberSeed.h" 00012 #include "GlastEvent/Utilities/ProcessingVersion.h" 00013 #include "CLHEP/Geometry/Point3D.h" 00014 #include "GlastEvent/Utilities/CLHEPStreams.h" 00015 #include "GlastEvent/TopLevel/Definitions.h" 00016 00017 00018 //------------------------------------------------------------------------------ 00019 // 00020 // ClassName: SubMCEvent 00021 // 00022 // Description: Essential information of the sub- Monte Carlo event 00023 // (the Monte Carlo event can be assembled from several 00024 // of these sub-events) 00025 // 00026 // The class SubMCEvent uses the Class Library for HEP 00027 // <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/index.html">CLHEP</A> 00028 // 00029 // It contains: 00030 // - detector characteristics 00031 // - primary vertex 00032 // - Monte Carlo event weight 00033 // - random number seed 00034 // - processing version 00035 // 00036 // Author: Pavel Binko 00037 // Changes: P.Binko 19/10/1999 : Formating of ASCII output 00038 // 00039 //------------------------------------------------------------------------------ 00040 00041 00042 class SubMCEvent { 00043 00044 public: 00046 SubMCEvent() { } 00048 ~SubMCEvent() { } 00049 00051 SubMCEvent& operator= ( const SubMCEvent clone ) { 00052 m_detectorCharacteristics = clone.detectorCharacteristics(); 00053 m_processingVersion = clone.processingVersion(); 00054 m_randomNumberSeed = clone.randomNumberSeed(); 00055 m_primaryVertex = clone.primaryVertex(); 00056 m_weight = clone.weight(); 00057 return *this; 00058 } 00059 00061 bool operator== ( const SubMCEvent& t ) const { 00062 return 00063 detectorCharacteristics() == t.detectorCharacteristics() 00064 && processingVersion() == t.processingVersion() 00065 && randomNumberSeed() == t.randomNumberSeed() 00066 && primaryVertex() == t.primaryVertex() 00067 && weight() == t.weight(); 00068 } 00069 00071 long detectorCharacteristics () const { 00072 return m_detectorCharacteristics; 00073 } 00075 void setDetectorCharacteristics (long value) { 00076 m_detectorCharacteristics = value; 00077 } 00078 00080 const HepPoint3D& primaryVertex () const { 00081 return m_primaryVertex; 00082 } 00083 HepPoint3D& primaryVertex () { 00084 return m_primaryVertex; 00085 } 00087 void setPrimaryVertex (const HepPoint3D& value) { 00088 m_primaryVertex = value; 00089 } 00090 00092 double weight () const { 00093 return m_weight; 00094 } 00096 void setWeight (double value) { 00097 m_weight = value; 00098 } 00099 00101 const RandomNumberSeed& randomNumberSeed () const { 00102 return m_randomNumberSeed; 00103 } 00105 void setRandomNumberSeed (const RandomNumberSeed& value) { 00106 m_randomNumberSeed = value; 00107 } 00108 00110 const ProcessingVersion& processingVersion () const { 00111 return m_processingVersion; 00112 } 00114 void setProcessingVersion (const ProcessingVersion& value) { 00115 m_processingVersion = value; 00116 } 00117 00119 friend StreamBuffer& operator<< ( StreamBuffer& s, const SubMCEvent& obj ) { 00120 return s 00121 << obj.m_detectorCharacteristics 00122 << obj.m_primaryVertex 00123 << obj.m_weight 00124 << obj.m_randomNumberSeed 00125 << obj.m_processingVersion; 00126 } 00128 friend StreamBuffer& operator>> ( StreamBuffer& s, SubMCEvent& obj ) { 00129 return s 00130 >> obj.m_detectorCharacteristics 00131 >> obj.m_primaryVertex 00132 >> obj.m_weight 00133 >> obj.m_randomNumberSeed 00134 >> obj.m_processingVersion; 00135 } 00136 00137 00139 friend std::ostream& operator<< ( std::ostream& s, const SubMCEvent& obj ) { 00140 return obj.fillStream(s); 00141 } 00143 std::ostream& fillStream( std::ostream& s ) const; 00144 00145 private: 00147 long m_detectorCharacteristics; 00150 HepPoint3D m_primaryVertex; 00152 double m_weight; 00154 RandomNumberSeed m_randomNumberSeed; 00156 ProcessingVersion m_processingVersion; 00157 00158 }; 00159 00160 00161 // 00162 // Inline code must be outside the class definition 00163 // 00164 00165 00167 inline std::ostream& SubMCEvent::fillStream( std::ostream& s ) const { 00168 return s 00169 << "class SubMCEvent :\n" 00170 << "\n Detector characteristics = " 00171 << GlastEventField( GlastEvent::field12 ) 00172 << m_detectorCharacteristics 00173 << "\n Primary vertex location = ( " 00174 << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision ) 00175 << m_primaryVertex.x() << ", " 00176 << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision ) 00177 << m_primaryVertex.y() << ", " 00178 << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision ) 00179 << m_primaryVertex.z() << " )" 00180 << "\n Monte Carlo event weight = " 00181 << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision ) 00182 << m_weight 00183 << "\n Random number seed = " << m_randomNumberSeed 00184 << "\n Processing version = " << m_processingVersion; 00185 } 00186 00187 00188 #endif // LHCBEVENT_SUBMCEVENT_H
1.2.3 written by Dimitri van Heesch,
© 1997-2000