00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SimEvent_SimHit_H
00016 #define SimEvent_SimHit_H 1
00017
00018
00019 #include "SimTrackReference.h"
00020 #include "CLHEP/Vector/ThreeVector.h"
00021 #include "GaudiKernel/boost_allocator.h"
00022 #include <ostream>
00023
00024
00025
00026 namespace DayaBay
00027 {
00028
00029
00030 class SimHitCollection;
00031
00032
00042 class SimHit
00043 {
00044 public:
00045
00047 SimHit() : m_hc(0),
00048 m_hitTime(0.0),
00049 m_localPos(),
00050 m_sensDetId(0),
00051 m_weight(0.0),
00052 m_ancestor() {}
00053
00055 virtual ~SimHit() {}
00056
00058 virtual std::ostream& fillStream(std::ostream& s) const;
00059
00062 const DayaBay::SimHitCollection* hc() const;
00063
00066 void setHc(DayaBay::SimHitCollection* value);
00067
00070 double hitTime() const;
00071
00074 void setHitTime(double value);
00075
00078 const CLHEP::Hep3Vector& localPos() const;
00079
00082 void setLocalPos(const CLHEP::Hep3Vector& value);
00083
00086 int sensDetId() const;
00087
00090 void setSensDetId(int value);
00091
00094 float weight() const;
00095
00098 void setWeight(float value);
00099
00102 const DayaBay::SimTrackReference& ancestor() const;
00103
00106 void setAncestor(const DayaBay::SimTrackReference& value);
00107
00108
00109 #ifndef GOD_NOALLOC
00111 static void* operator new ( size_t size )
00112 {
00113 return ( sizeof(SimHit) == size ?
00114 boost::singleton_pool<SimHit, sizeof(SimHit)>::malloc() :
00115 ::operator new(size) );
00116 }
00117
00121 static void* operator new ( size_t size, void* pObj )
00122 {
00123 return ::operator new (size,pObj);
00124 }
00125
00127 static void operator delete ( void* p )
00128 {
00129 boost::singleton_pool<SimHit, sizeof(SimHit)>::is_from(p) ?
00130 boost::singleton_pool<SimHit, sizeof(SimHit)>::free(p) :
00131 ::operator delete(p);
00132 }
00133
00136 static void operator delete ( void* p, void* pObj )
00137 {
00138 ::operator delete (p, pObj);
00139 }
00140 #endif
00141 protected:
00142
00143 private:
00144
00145 DayaBay::SimHitCollection* m_hc;
00146 double m_hitTime;
00147 CLHEP::Hep3Vector m_localPos;
00148 int m_sensDetId;
00149 float m_weight;
00150 DayaBay::SimTrackReference m_ancestor;
00151
00152 };
00153
00154 inline std::ostream& operator<< (std::ostream& str, const SimHit& obj)
00155 {
00156 return obj.fillStream(str);
00157 }
00158
00159 }
00160
00161
00162
00163
00164
00165
00166 #include "SimHitCollection.h"
00167
00168
00169 inline std::ostream& DayaBay::SimHit::fillStream(std::ostream& s) const
00170 {
00171 s << "{ " << "hc : " << m_hc << std::endl
00172 << "hitTime : " << (float)m_hitTime << std::endl
00173 << "localPos : " << m_localPos << std::endl
00174 << "sensDetId : " << m_sensDetId << std::endl
00175 << "weight : " << m_weight << std::endl
00176 << "ancestor : " << m_ancestor << std::endl << " }";
00177 return s;
00178 }
00179
00180
00181 inline const DayaBay::SimHitCollection* DayaBay::SimHit::hc() const
00182 {
00183 return m_hc;
00184 }
00185
00186 inline void DayaBay::SimHit::setHc(DayaBay::SimHitCollection* value)
00187 {
00188 m_hc = value;
00189 }
00190
00191 inline double DayaBay::SimHit::hitTime() const
00192 {
00193 return m_hitTime;
00194 }
00195
00196 inline void DayaBay::SimHit::setHitTime(double value)
00197 {
00198 m_hitTime = value;
00199 }
00200
00201 inline const CLHEP::Hep3Vector& DayaBay::SimHit::localPos() const
00202 {
00203 return m_localPos;
00204 }
00205
00206 inline void DayaBay::SimHit::setLocalPos(const CLHEP::Hep3Vector& value)
00207 {
00208 m_localPos = value;
00209 }
00210
00211 inline int DayaBay::SimHit::sensDetId() const
00212 {
00213 return m_sensDetId;
00214 }
00215
00216 inline void DayaBay::SimHit::setSensDetId(int value)
00217 {
00218 m_sensDetId = value;
00219 }
00220
00221 inline float DayaBay::SimHit::weight() const
00222 {
00223 return m_weight;
00224 }
00225
00226 inline void DayaBay::SimHit::setWeight(float value)
00227 {
00228 m_weight = value;
00229 }
00230
00231 inline const DayaBay::SimTrackReference& DayaBay::SimHit::ancestor() const
00232 {
00233 return m_ancestor;
00234 }
00235
00236 inline void DayaBay::SimHit::setAncestor(const DayaBay::SimTrackReference& value)
00237 {
00238 m_ancestor = value;
00239 }
00240
00241
00242 #endif