CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackWithHistory.h
Go to the documentation of this file.
1 #ifndef SimG4Core_TrackWithHistory_H
2 #define SimG4Core_TrackWithHistory_H
3 
4 #include "G4Track.hh"
7 
8 #include "G4Allocator.hh"
9 
10 class G4VProcess;
17 {
18 public:
22  TrackWithHistory(const G4Track * g4track);
24 
25  inline void * operator new(size_t);
26  inline void operator delete(void * TrackWithHistory);
27 
28  void save() { saved_ = true; }
29  unsigned int trackID() const { return trackID_; }
30  int particleID() const { return particleID_; }
31  int parentID() const { return parentID_; }
32  int genParticleID() const { return genParticleID_; }
33  const math::XYZVectorD & momentum() const { return momentum_; }
34  double totalEnergy() const { return totalEnergy_; }
35  const math::XYZVectorD & vertexPosition() const { return vertexPosition_; }
36  double globalTime() const { return globalTime_; }
37  double localTime() const { return localTime_; }
38  double properTime() const { return properTime_; }
39  const G4VProcess * creatorProcess() const { return creatorProcess_; }
40  double weight() const { return weight_; }
41  void setTrackID(int i) { trackID_ = i; }
42  void setParentID(int i) { parentID_ = i; }
44  bool storeTrack() const { return storeTrack_; }
45  bool saved() const { return saved_; }
51  void checkAtEnd(const G4Track *);
52 private:
53  unsigned int trackID_;
55  int parentID_;
58  double totalEnergy_;
60  double globalTime_;
61  double localTime_;
62  double properTime_;
63  const G4VProcess * creatorProcess_;
64  double weight_;
66  bool saved_;
68  int extractGenID(const G4Track * gt) const;
69 };
70 
71 extern G4Allocator<TrackWithHistory> TrackWithHistoryAllocator;
72 
73 inline void * TrackWithHistory::operator new(size_t) {
74  void * aTwH;
75  aTwH = (void *) TrackWithHistoryAllocator.MallocSingle();
76  return aTwH;
77 }
78 
79 inline void TrackWithHistory::operator delete(void * aTwH) {
80  TrackWithHistoryAllocator.FreeSingle((TrackWithHistory*) aTwH);
81 }
82 
83 
84 #endif
const G4VProcess * creatorProcess_
int i
Definition: DBlmapReader.cc:9
void setParentID(int i)
double properTime() const
int extractGenID(const G4Track *gt) const
math::XYZVectorD vertexPosition_
math::XYZVectorD momentum_
bool saved() const
double totalEnergy() const
void setGenParticleID(int i)
unsigned int trackID_
bool storeTrack() const
static G4TrackToParticleID * theG4TrackToParticleID
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:9
double localTime() const
void setTrackID(int i)
G4Allocator< TrackWithHistory > TrackWithHistoryAllocator
unsigned int trackID() const
void checkAtEnd(const G4Track *)
int particleID() const
int parentID() const
const G4VProcess * creatorProcess() const
double weight() const
const math::XYZVectorD & momentum() const
double globalTime() const
DTRecHit1DPair & gt
const math::XYZVectorD & vertexPosition() const
int genParticleID() const
TrackWithHistory(const G4Track *g4track)