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