00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SimEvent_SimPmtHit_H
00016 #define SimEvent_SimPmtHit_H 1
00017
00018
00019 #include "SimTrackReference.h"
00020 #include "CLHEP/Vector/ThreeVector.h"
00021 #include "Event/SimHit.h"
00022 #include "Event/SimTrack.h"
00023 #include "GaudiKernel/boost_allocator.h"
00024 #include <ostream>
00025
00026
00027
00028 namespace DayaBay
00029 {
00030
00031
00032 class SimHitCollection;
00033
00034
00044 class SimPmtHit: public SimHit
00045 {
00046 public:
00047
00049 SimPmtHit() : m_dir(),
00050 m_pol(),
00051 m_wavelength(0.0),
00052 m_type(0) {}
00053
00055 virtual ~SimPmtHit() {}
00056
00058 virtual std::ostream& fillStream(std::ostream& s) const;
00059
00062 const CLHEP::Hep3Vector& dir() const;
00063
00066 void setDir(const CLHEP::Hep3Vector& value);
00067
00070 const CLHEP::Hep3Vector& pol() const;
00071
00074 void setPol(const CLHEP::Hep3Vector& value);
00075
00078 double wavelength() const;
00079
00082 void setWavelength(double value);
00083
00086 int type() const;
00087
00090 void setType(int value);
00091
00092
00093 #ifndef GOD_NOALLOC
00095 static void* operator new ( size_t size )
00096 {
00097 return ( sizeof(SimPmtHit) == size ?
00098 boost::singleton_pool<SimPmtHit, sizeof(SimPmtHit)>::malloc() :
00099 ::operator new(size) );
00100 }
00101
00105 static void* operator new ( size_t size, void* pObj )
00106 {
00107 return ::operator new (size,pObj);
00108 }
00109
00111 static void operator delete ( void* p )
00112 {
00113 boost::singleton_pool<SimPmtHit, sizeof(SimPmtHit)>::is_from(p) ?
00114 boost::singleton_pool<SimPmtHit, sizeof(SimPmtHit)>::free(p) :
00115 ::operator delete(p);
00116 }
00117
00120 static void operator delete ( void* p, void* pObj )
00121 {
00122 ::operator delete (p, pObj);
00123 }
00124 #endif
00125 protected:
00126
00127 private:
00128
00129 CLHEP::Hep3Vector m_dir;
00130 CLHEP::Hep3Vector m_pol;
00131 double m_wavelength;
00132 int m_type;
00133
00134 };
00135
00136 inline std::ostream& operator<< (std::ostream& str, const SimPmtHit& obj)
00137 {
00138 return obj.fillStream(str);
00139 }
00140
00141 }
00142
00143
00144
00145
00146
00147
00148 #include "SimHitCollection.h"
00149
00150
00151 inline std::ostream& DayaBay::SimPmtHit::fillStream(std::ostream& s) const
00152 {
00153 SimHit::fillStream(s);
00154 s << "{ " << "dir : " << m_dir << std::endl
00155 << "pol : " << m_pol << std::endl
00156 << "wavelength : " << (float)m_wavelength << std::endl
00157 << "type : " << m_type << std::endl << " }";
00158 return s;
00159 }
00160
00161
00162 inline const CLHEP::Hep3Vector& DayaBay::SimPmtHit::dir() const
00163 {
00164 return m_dir;
00165 }
00166
00167 inline void DayaBay::SimPmtHit::setDir(const CLHEP::Hep3Vector& value)
00168 {
00169 m_dir = value;
00170 }
00171
00172 inline const CLHEP::Hep3Vector& DayaBay::SimPmtHit::pol() const
00173 {
00174 return m_pol;
00175 }
00176
00177 inline void DayaBay::SimPmtHit::setPol(const CLHEP::Hep3Vector& value)
00178 {
00179 m_pol = value;
00180 }
00181
00182 inline double DayaBay::SimPmtHit::wavelength() const
00183 {
00184 return m_wavelength;
00185 }
00186
00187 inline void DayaBay::SimPmtHit::setWavelength(double value)
00188 {
00189 m_wavelength = value;
00190 }
00191
00192 inline int DayaBay::SimPmtHit::type() const
00193 {
00194 return m_type;
00195 }
00196
00197 inline void DayaBay::SimPmtHit::setType(int value)
00198 {
00199 m_type = value;
00200 }
00201
00202
00203 #endif