CMS 3D CMS Logo

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 public:
21  TrackWithHistory(const G4Track *g4track);
23 
24  inline void *operator new(size_t);
25  inline void operator delete(void *TrackWithHistory);
26 
27  void save() { saved_ = true; }
28  unsigned int trackID() const { return trackID_; }
29  int particleID() const { return particleID_; }
30  int parentID() const { return parentID_; }
31  int genParticleID() const { return genParticleID_; }
32  const math::XYZVectorD &momentum() const { return momentum_; }
33  double totalEnergy() const { return totalEnergy_; }
34  const math::XYZVectorD &vertexPosition() const { return vertexPosition_; }
35  double globalTime() const { return globalTime_; }
36  double localTime() const { return localTime_; }
37  double properTime() const { return properTime_; }
38  const G4VProcess *creatorProcess() const { return creatorProcess_; }
39  double weight() const { return weight_; }
40  void setTrackID(int i) { trackID_ = i; }
41  void setParentID(int i) { parentID_ = i; }
43  bool storeTrack() const { return storeTrack_; }
44  bool saved() const { return saved_; }
50  void checkAtEnd(const G4Track *);
51 
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_;
67  int extractGenID(const G4Track *gt) const;
68 };
69 
70 extern G4ThreadLocal G4Allocator<TrackWithHistory> *fpTrackWithHistoryAllocator;
71 
72 inline void *TrackWithHistory::operator new(size_t) {
74  fpTrackWithHistoryAllocator = new G4Allocator<TrackWithHistory>;
75  return (void *)fpTrackWithHistoryAllocator->MallocSingle();
76 }
77 
78 inline void TrackWithHistory::operator delete(void *aTwH) {
79  fpTrackWithHistoryAllocator->FreeSingle((TrackWithHistory *)aTwH);
80 }
81 
82 #endif
TrackWithHistory::parentID_
int parentID_
Definition: TrackWithHistory.h:55
TrackWithHistory::TrackWithHistory
TrackWithHistory(const G4Track *g4track)
Definition: TrackWithHistory.cc:17
TrackWithHistory::genParticleID
int genParticleID() const
Definition: TrackWithHistory.h:31
TrackWithHistory::globalTime
double globalTime() const
Definition: TrackWithHistory.h:35
mps_fire.i
i
Definition: mps_fire.py:428
TrackWithHistory::weight_
double weight_
Definition: TrackWithHistory.h:64
TrackWithHistory::parentID
int parentID() const
Definition: TrackWithHistory.h:30
TrackWithHistory::trackID_
unsigned int trackID_
Definition: TrackWithHistory.h:53
TrackWithHistory::localTime_
double localTime_
Definition: TrackWithHistory.h:61
TrackWithHistory
Definition: TrackWithHistory.h:16
TrackWithHistory::setTrackID
void setTrackID(int i)
Definition: TrackWithHistory.h:40
TrackWithHistory::checkAtEnd
void checkAtEnd(const G4Track *)
Definition: TrackWithHistory.cc:56
TrackWithHistory::totalEnergy_
double totalEnergy_
Definition: TrackWithHistory.h:58
TrackWithHistory::weight
double weight() const
Definition: TrackWithHistory.h:39
Utilities.operator
operator
Definition: Utilities.py:24
TrackWithHistory::creatorProcess_
const G4VProcess * creatorProcess_
Definition: TrackWithHistory.h:63
submitPVValidationJobs.gt
list gt
Definition: submitPVValidationJobs.py:663
TrackWithHistory::vertexPosition_
math::XYZVectorD vertexPosition_
Definition: TrackWithHistory.h:59
G4TrackToParticleID
Definition: G4TrackToParticleID.h:6
TrackWithHistory::setParentID
void setParentID(int i)
Definition: TrackWithHistory.h:41
TrackWithHistory::storeTrack_
bool storeTrack_
Definition: TrackWithHistory.h:65
TrackWithHistory::save
void save()
Definition: TrackWithHistory.h:27
TrackWithHistory::properTime
double properTime() const
Definition: TrackWithHistory.h:37
TrackWithHistory::saved_
bool saved_
Definition: TrackWithHistory.h:66
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
TrackWithHistory::vertexPosition
const math::XYZVectorD & vertexPosition() const
Definition: TrackWithHistory.h:34
TrackWithHistory::momentum_
math::XYZVectorD momentum_
Definition: TrackWithHistory.h:57
TrackWithHistory::~TrackWithHistory
~TrackWithHistory()
Definition: TrackWithHistory.h:22
fpTrackWithHistoryAllocator
G4ThreadLocal G4Allocator< TrackWithHistory > * fpTrackWithHistoryAllocator
Definition: TrackWithHistory.cc:13
LorentzVector.h
TrackWithHistory::setGenParticleID
void setGenParticleID(int i)
Definition: TrackWithHistory.h:42
TrackWithHistory::totalEnergy
double totalEnergy() const
Definition: TrackWithHistory.h:33
TrackWithHistory::globalTime_
double globalTime_
Definition: TrackWithHistory.h:60
TrackWithHistory::extractGenID
int extractGenID(const G4Track *gt) const
Definition: TrackWithHistory.cc:79
TrackWithHistory::particleID_
int particleID_
Definition: TrackWithHistory.h:54
TrackWithHistory::trackID
unsigned int trackID() const
Definition: TrackWithHistory.h:28
TrackWithHistory::saved
bool saved() const
Definition: TrackWithHistory.h:44
TrackWithHistory::creatorProcess
const G4VProcess * creatorProcess() const
Definition: TrackWithHistory.h:38
TrackWithHistory::momentum
const math::XYZVectorD & momentum() const
Definition: TrackWithHistory.h:32
TrackWithHistory::localTime
double localTime() const
Definition: TrackWithHistory.h:36
TrackWithHistory::storeTrack
bool storeTrack() const
Definition: TrackWithHistory.h:43
Vector3D.h
TrackWithHistory::genParticleID_
int genParticleID_
Definition: TrackWithHistory.h:56
TrackWithHistory::particleID
int particleID() const
Definition: TrackWithHistory.h:29
TrackWithHistory::properTime_
double properTime_
Definition: TrackWithHistory.h:62