00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GenEvent_GenHeader_H
00016 #define GenEvent_GenHeader_H 1
00017
00018
00019 #include "HepMC/GenEvent.h"
00020 #include "Event/HeaderObject.h"
00021 #include "GaudiKernel/boost_allocator.h"
00022 #include <ostream>
00023
00024
00025
00026 namespace DayaBay
00027 {
00028
00029
00030
00031
00032 static const CLID CLID_GenHeader = 51201;
00033
00034
00035 namespace GenHeaderLocation {
00036 static const std::string& Default = "/Event/Gen/GenHeader";
00037 }
00038
00039
00049 class GenHeader: public HeaderObject
00050 {
00051 public:
00052
00054 static const std::string& defaultLocation() { return GenHeaderLocation::Default; }
00055 virtual const std::string& defLoc() const { return GenHeaderLocation::Default; }
00056
00058 enum statusType{ Unknown = 0,
00059 StableInProdGen = 1,
00060 DecayedByProdGen = 2,
00061 DocumentationParticle = 3
00062 };
00063
00065 GenHeader() : m_generatorName("Unknown"),
00066 m_event(0) {}
00067
00069 virtual ~GenHeader();
00070
00071
00072 virtual const CLID& clID() const;
00073 static const CLID& classID();
00074
00076 void setEvent(HepMC::GenEvent* event);
00077
00079 std::ostream& fillStream(std::ostream& s) const;
00080
00083 const std::string& generatorName() const;
00084
00087 void setGeneratorName(const std::string& value);
00088
00091 const HepMC::GenEvent* event() const;
00092
00095 HepMC::GenEvent* event();
00096
00097
00098 #ifndef GOD_NOALLOC
00100 static void* operator new ( size_t size )
00101 {
00102 return ( sizeof(GenHeader) == size ?
00103 boost::singleton_pool<GenHeader, sizeof(GenHeader)>::malloc() :
00104 ::operator new(size) );
00105 }
00106
00110 static void* operator new ( size_t size, void* pObj )
00111 {
00112 return ::operator new (size,pObj);
00113 }
00114
00116 static void operator delete ( void* p )
00117 {
00118 boost::singleton_pool<GenHeader, sizeof(GenHeader)>::is_from(p) ?
00119 boost::singleton_pool<GenHeader, sizeof(GenHeader)>::free(p) :
00120 ::operator delete(p);
00121 }
00122
00125 static void operator delete ( void* p, void* pObj )
00126 {
00127 ::operator delete (p, pObj);
00128 }
00129 #endif
00130 protected:
00131
00132 private:
00133
00134 std::string m_generatorName;
00135 HepMC::GenEvent* m_event;
00136
00137 };
00138
00139 inline std::ostream& operator<< (std::ostream& str, const GenHeader& obj)
00140 {
00141 return obj.fillStream(str);
00142 }
00143
00144 inline std::ostream & operator << (std::ostream & s, DayaBay::GenHeader::statusType e) {
00145 switch (e) {
00146 case DayaBay::GenHeader::Unknown : return s << "Unknown";
00147 case DayaBay::GenHeader::StableInProdGen : return s << "StableInProdGen";
00148 case DayaBay::GenHeader::DecayedByProdGen : return s << "DecayedByProdGen";
00149 case DayaBay::GenHeader::DocumentationParticle : return s << "DocumentationParticle";
00150 default : return s << "ERROR wrong value for enum DayaBay::GenHeader::statusType";
00151 }
00152 }
00153
00154
00155 }
00156
00157
00158
00159
00160
00161
00162
00163 inline const CLID& DayaBay::GenHeader::clID() const
00164 {
00165 return DayaBay::GenHeader::classID();
00166 }
00167
00168 inline const CLID& DayaBay::GenHeader::classID()
00169 {
00170 return CLID_GenHeader;
00171 }
00172
00173 inline const std::string& DayaBay::GenHeader::generatorName() const
00174 {
00175 return m_generatorName;
00176 }
00177
00178 inline void DayaBay::GenHeader::setGeneratorName(const std::string& value)
00179 {
00180 m_generatorName = value;
00181 }
00182
00183 inline const HepMC::GenEvent* DayaBay::GenHeader::event() const
00184 {
00185 return m_event;
00186 }
00187
00188 inline HepMC::GenEvent* DayaBay::GenHeader::event()
00189 {
00190 return m_event;
00191 }
00192
00193
00194 #endif