CMS 3D CMS Logo

G4SimTrack.h
Go to the documentation of this file.
1 #ifndef SimG4Core_G4SimTrack_H
2 #define SimG4Core_G4SimTrack_H
3 
8 #include <cmath>
9 
10 class G4SimTrack {
11 public:
13 
14  G4SimTrack(int iid, int ipart, const math::XYZVectorD& ip, double ie)
15  : id_(iid),
16  ipart_(ipart),
17  ip_(ip),
18  ie_(ie),
19  ivert_(-1),
20  igenpart_(-1),
21  parentID_(-1),
22  parentMomentum_(math::XYZVectorD(0., 0., 0.)),
23  tkSurfacePosition_(math::XYZVectorD(0., 0., 0.)),
24  tkSurfaceMomentum_(math::XYZTLorentzVectorD(0., 0., 0., 0.)),
26 
27  G4SimTrack(int iid, int ipart, const math::XYZVectorD& ip, double ie, int iv, int ig, const math::XYZVectorD& ipmom)
28  : id_(iid),
29  ipart_(ipart),
30  ip_(ip),
31  ie_(ie),
32  ivert_(iv),
33  igenpart_(ig),
34  parentMomentum_(ipmom),
35  tkSurfacePosition_(math::XYZVectorD(0., 0., 0.)),
36  tkSurfaceMomentum_(math::XYZTLorentzVectorD(0., 0., 0., 0.)),
38 
39  G4SimTrack(int iid,
40  int ipart,
41  const math::XYZVectorD& ip,
42  double ie,
43  int iv,
44  int ig,
45  const math::XYZVectorD& ipmom,
46  const math::XYZVectorD& tkpos,
47  const math::XYZTLorentzVectorD& tkmom)
48  : id_(iid),
49  ipart_(ipart),
50  ip_(ip),
51  ie_(ie),
52  ivert_(iv),
53  igenpart_(ig),
54  parentMomentum_(ipmom),
55  tkSurfacePosition_(tkpos),
56  tkSurfaceMomentum_(tkmom),
58 
59  ~G4SimTrack() = default;
60 
61  int id() const { return id_; }
62  int part() const { return ipart_; }
63  const math::XYZVectorD& momentum() const { return ip_; }
64  double energy() const { return ie_; }
65  int ivert() const { return ivert_; }
66  int igenpart() const { return igenpart_; }
67  // parent momentum at interaction
68  const math::XYZVectorD& parentMomentum() const { return parentMomentum_; }
69  // Information at level of tracker surface
72  // parent track ID (only stored if parent momentum at interaction
73  // is stored, else = -1)
74  int parentID() const { return parentID_; }
75 
77  if (track->crossedBoundary()) {
78  crossedBoundary_ = track->crossedBoundary();
79  idAtBoundary_ = track->getIDAtBoundary();
80  positionAtBoundary_ = track->getPositionAtBoundary();
81  momentumAtBoundary_ = track->getMomentumAtBoundary();
82  }
83  }
84  bool crossedBoundary() const { return crossedBoundary_; }
87  int getIDAtBoundary() const { return idAtBoundary_; }
88 
89 private:
90  int id_;
91  int ipart_;
93  double ie_;
94  int ivert_;
95  int igenpart_;
96  int parentID_;
104 };
105 
106 #endif
void copyCrossedBoundaryVars(const TrackWithHistory *track)
Definition: G4SimTrack.h:76
int ivert() const
Definition: G4SimTrack.h:65
int ipart_
Definition: G4SimTrack.h:91
const math::XYZVectorD & parentMomentum() const
Definition: G4SimTrack.h:68
bool crossedBoundary_
Definition: G4SimTrack.h:100
math::XYZTLorentzVectorF positionAtBoundary_
Definition: G4SimTrack.h:102
int32_t *__restrict__ iv
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
int idAtBoundary_
Definition: G4SimTrack.h:101
int ivert_
Definition: G4SimTrack.h:94
~G4SimTrack()=default
bool crossedBoundary() const
Definition: G4SimTrack.h:84
math::XYZVectorD parentMomentum_
Definition: G4SimTrack.h:97
G4SimTrack(int iid, int ipart, const math::XYZVectorD &ip, double ie, int iv, int ig, const math::XYZVectorD &ipmom, const math::XYZVectorD &tkpos, const math::XYZTLorentzVectorD &tkmom)
Definition: G4SimTrack.h:39
double energy() const
Definition: G4SimTrack.h:64
math::XYZTLorentzVectorD tkSurfaceMomentum_
Definition: G4SimTrack.h:99
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
int igenpart_
Definition: G4SimTrack.h:95
const math::XYZTLorentzVectorF & getMomentumAtBoundary() const
Definition: G4SimTrack.h:86
math::XYZVectorD tkSurfacePosition_
Definition: G4SimTrack.h:98
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
int igenpart() const
Definition: G4SimTrack.h:66
const math::XYZTLorentzVectorF & getPositionAtBoundary() const
Definition: G4SimTrack.h:85
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
Definition: G4SimTrack.h:71
const math::XYZVectorD & momentum() const
Definition: G4SimTrack.h:63
int parentID() const
Definition: G4SimTrack.h:74
math::XYZVectorD ip_
Definition: G4SimTrack.h:92
G4SimTrack(int iid, int ipart, const math::XYZVectorD &ip, double ie, int iv, int ig, const math::XYZVectorD &ipmom)
Definition: G4SimTrack.h:27
const math::XYZVectorD & trackerSurfacePosition() const
Definition: G4SimTrack.h:70
int part() const
Definition: G4SimTrack.h:62
G4SimTrack(int iid, int ipart, const math::XYZVectorD &ip, double ie)
Definition: G4SimTrack.h:14
int parentID_
Definition: G4SimTrack.h:96
double ie_
Definition: G4SimTrack.h:93
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
int id() const
Definition: G4SimTrack.h:61
math::XYZTLorentzVectorF momentumAtBoundary_
Definition: G4SimTrack.h:103
int getIDAtBoundary() const
Definition: G4SimTrack.h:87