00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SimEvent_SimTrack_H
00016 #define SimEvent_SimTrack_H 1
00017
00018
00019 #include "SimTrackReference.h"
00020 #include "SimVertexReference.h"
00021 #include "SimProcess.h"
00022 #include "HepMC/GenEvent.h"
00023 #include "GaudiKernel/boost_allocator.h"
00024 #include <vector>
00025 #include <map>
00026 #include <list>
00027 #include <ostream>
00028
00029
00030
00031 namespace DayaBay
00032 {
00033
00034
00035
00045 class SimTrack
00046 {
00047 public:
00048
00050 typedef std::map<int,unsigned int> descendants_map;
00052 typedef std::vector<DayaBay::SimVertex*> vertex_list;
00053
00055 SimTrack() : m_trackId(-1),
00056 m_parentParticle(0),
00057 m_ancestorTrack(0,-1),
00058 m_ancestorVertex(0,-1),
00059 m_primaryParticle(0),
00060 m_particle(0),
00061 m_vertices(),
00062 m_unrecordedDescendants() {}
00063
00065 virtual ~SimTrack() {}
00066
00068 unsigned int unrecordedDescendants(int pdg) const;
00069
00071 void incrementUnrecordedDescendants(int pdg);
00072
00074 void addVertex(DayaBay::SimVertex* v);
00075
00077 std::ostream& fillStream(std::ostream& s) const;
00078
00081 int trackId() const;
00082
00085 void setTrackId(int value);
00086
00089 int parentParticle() const;
00090
00093 void setParentParticle(int value);
00094
00097 const DayaBay::SimTrackReference& ancestorTrack() const;
00098
00101 void setAncestorTrack(const DayaBay::SimTrackReference& value);
00102
00105 const DayaBay::SimVertexReference& ancestorVertex() const;
00106
00109 void setAncestorVertex(const DayaBay::SimVertexReference& value);
00110
00113 const HepMC::GenParticle* primaryParticle() const;
00114
00117 void setPrimaryParticle(const HepMC::GenParticle* value);
00118
00121 int particle() const;
00122
00125 void setParticle(int value);
00126
00129 const vertex_list& vertices() const;
00130
00133 void setVertices(const vertex_list& value);
00134
00137 const descendants_map& unrecordedDescendants() const;
00138
00141 void setUnrecordedDescendants(const descendants_map& value);
00142
00143
00144 #ifndef GOD_NOALLOC
00146 static void* operator new ( size_t size )
00147 {
00148 return ( sizeof(SimTrack) == size ?
00149 boost::singleton_pool<SimTrack, sizeof(SimTrack)>::malloc() :
00150 ::operator new(size) );
00151 }
00152
00156 static void* operator new ( size_t size, void* pObj )
00157 {
00158 return ::operator new (size,pObj);
00159 }
00160
00162 static void operator delete ( void* p )
00163 {
00164 boost::singleton_pool<SimTrack, sizeof(SimTrack)>::is_from(p) ?
00165 boost::singleton_pool<SimTrack, sizeof(SimTrack)>::free(p) :
00166 ::operator delete(p);
00167 }
00168
00171 static void operator delete ( void* p, void* pObj )
00172 {
00173 ::operator delete (p, pObj);
00174 }
00175 #endif
00176 protected:
00177
00178 private:
00179
00180 int m_trackId;
00181 int m_parentParticle;
00182 DayaBay::SimTrackReference m_ancestorTrack;
00183 DayaBay::SimVertexReference m_ancestorVertex;
00184 const HepMC::GenParticle* m_primaryParticle;
00185 int m_particle;
00186 vertex_list m_vertices;
00187 descendants_map m_unrecordedDescendants;
00188
00189 };
00190
00191 inline std::ostream& operator<< (std::ostream& str, const SimTrack& obj)
00192 {
00193 return obj.fillStream(str);
00194 }
00195
00196 }
00197
00198
00199
00200
00201
00202
00203
00204 inline int DayaBay::SimTrack::trackId() const
00205 {
00206 return m_trackId;
00207 }
00208
00209 inline void DayaBay::SimTrack::setTrackId(int value)
00210 {
00211 m_trackId = value;
00212 }
00213
00214 inline int DayaBay::SimTrack::parentParticle() const
00215 {
00216 return m_parentParticle;
00217 }
00218
00219 inline void DayaBay::SimTrack::setParentParticle(int value)
00220 {
00221 m_parentParticle = value;
00222 }
00223
00224 inline const DayaBay::SimTrackReference& DayaBay::SimTrack::ancestorTrack() const
00225 {
00226 return m_ancestorTrack;
00227 }
00228
00229 inline void DayaBay::SimTrack::setAncestorTrack(const DayaBay::SimTrackReference& value)
00230 {
00231 m_ancestorTrack = value;
00232 }
00233
00234 inline const DayaBay::SimVertexReference& DayaBay::SimTrack::ancestorVertex() const
00235 {
00236 return m_ancestorVertex;
00237 }
00238
00239 inline void DayaBay::SimTrack::setAncestorVertex(const DayaBay::SimVertexReference& value)
00240 {
00241 m_ancestorVertex = value;
00242 }
00243
00244 inline const HepMC::GenParticle* DayaBay::SimTrack::primaryParticle() const
00245 {
00246 return m_primaryParticle;
00247 }
00248
00249 inline void DayaBay::SimTrack::setPrimaryParticle(const HepMC::GenParticle* value)
00250 {
00251 m_primaryParticle = value;
00252 }
00253
00254 inline int DayaBay::SimTrack::particle() const
00255 {
00256 return m_particle;
00257 }
00258
00259 inline void DayaBay::SimTrack::setParticle(int value)
00260 {
00261 m_particle = value;
00262 }
00263
00264 inline const DayaBay::SimTrack::vertex_list& DayaBay::SimTrack::vertices() const
00265 {
00266 return m_vertices;
00267 }
00268
00269 inline void DayaBay::SimTrack::setVertices(const vertex_list& value)
00270 {
00271 m_vertices = value;
00272 }
00273
00274 inline const DayaBay::SimTrack::descendants_map& DayaBay::SimTrack::unrecordedDescendants() const
00275 {
00276 return m_unrecordedDescendants;
00277 }
00278
00279 inline void DayaBay::SimTrack::setUnrecordedDescendants(const descendants_map& value)
00280 {
00281 m_unrecordedDescendants = value;
00282 }
00283
00284 inline void DayaBay::SimTrack::incrementUnrecordedDescendants(int pdg)
00285 {
00286
00287 m_unrecordedDescendants[pdg]+=1;
00288
00289 }
00290
00291 inline void DayaBay::SimTrack::addVertex(DayaBay::SimVertex* v)
00292 {
00293
00294 m_vertices.push_back(v);
00295
00296 }
00297
00298
00299 #endif