FairShip
Loading...
Searching...
No Matches
ShipMCTrack.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5// -------------------------------------------------------------------------
6// ----- ShipMCTrack header file -----
7// -------------------------------------------------------------------------
8
14
15#ifndef SHIPDATA_SHIPMCTRACK_H_
16#define SHIPDATA_SHIPMCTRACK_H_
17
18#include "Rtypes.h" // for Double_t, Int_t, Double32_t, etc
19#include "ShipDetectorList.h" // for DetectorId
20#include "TLorentzVector.h" // for TLorentzVector
21#include "TMCProcess.h" // enum with process ids
22#include "TMath.h" // for Sqrt
23#include "TObject.h" // for TObject
24#include "TString.h"
25#include "TVector3.h" // for TVector3
26class TParticle;
27
28class ShipMCTrack : public TObject {
29 public:
31 enum SplitRole : Int_t {
35 };
36
39
41 explicit ShipMCTrack(Int_t pdgCode, Int_t motherID, Double_t px, Double_t py,
42 Double_t pz, Double_t E, Double_t x, Double_t y,
43 Double_t z, Double_t t, Int_t nPoints, Int_t eventID,
44 Int_t trackID, Double_t w);
45
47 ShipMCTrack(const ShipMCTrack& track);
48
50 explicit ShipMCTrack(TParticle* particle);
51
53 ~ShipMCTrack() override;
54
56 using TObject::Print;
57 void Print(Int_t iTrack = 0) const;
58
60 Int_t GetPdgCode() const { return fPdgCode; }
61 Int_t GetMotherId() const { return fMotherId; }
62 Double_t GetPx() const { return fPx; }
63 Double_t GetPy() const { return fPy; }
64 Double_t GetPz() const { return fPz; }
65 Double_t GetStartX() const { return fStartX; }
66 Double_t GetStartY() const { return fStartY; }
67 Double_t GetStartZ() const { return fStartZ; }
68 Double_t GetStartT() const { return fStartT; }
69 Int_t GetEventID() const { return fEventID; }
70 void SetProcID(Int_t i) { fProcID = i; }
71 Int_t GetProcID() const { return fProcID; }
72 TString GetProcName() const { return TMCProcessName[fProcID]; }
73 Double_t GetMass() const;
74 Double_t GetEnergy() const;
75 Double_t GetPt() const { return TMath::Sqrt(fPx * fPx + fPy * fPy); }
76 Double_t GetP() const {
77 return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
78 }
79 Double_t GetRapidity() const;
80 void MultiplyWeight(Double_t w) { fW = fW * w; }
81 void SetWeight(Double_t w) { fW = w; }
82 Double_t GetWeight() const;
83 void GetMomentum(TVector3& momentum);
84 void Get4Momentum(TLorentzVector& momentum);
85 void GetStartVertex(TVector3& vertex);
86
102 Int_t GetSplitSet() const { return fSplitSet; }
103 Int_t GetSplitRole() const { return fSplitRole; }
104 Double_t GetSplitWeight() const { return fSplitWeight; }
105 Bool_t IsSplitDecay() const { return fSplitRole == kSplitDecay; }
106 Bool_t IsSplitSurvivor() const { return fSplitRole == kSplitSurvivor; }
107
109 void SetMotherId(Int_t id) { fMotherId = id; }
110 void SetStartT(Double_t t) { fStartT = t; }
111 void SetEventID(const Int_t& eventID);
112 void SetTrackID(const Int_t& trackID);
113 void SetSplitSet(Int_t splitSet, Int_t role, Double_t splitWeight) {
114 fSplitSet = splitSet;
115 fSplitRole = role;
116 fSplitWeight = splitWeight;
117 }
118
119 private:
121 Int_t fPdgCode;
122
125
127 Double32_t fPx, fPy, fPz, fM;
128
131
133 Double32_t fW;
134
136 Int_t fProcID;
137
153 Int_t fNPoints;
154
156 Int_t fEventID;
157
159 Int_t fTrackID;
160
163
166
168 Double32_t fSplitWeight;
169
171};
172
173// ========== Inline functions ========================================
174
175inline void ShipMCTrack::GetMomentum(TVector3& momentum) {
176 momentum.SetXYZ(fPx, fPy, fPz);
177}
178
179inline void ShipMCTrack::Get4Momentum(TLorentzVector& momentum) {
180 momentum.SetXYZT(fPx, fPy, fPz, GetEnergy());
181}
182
183inline void ShipMCTrack::GetStartVertex(TVector3& vertex) {
184 vertex.SetXYZ(fStartX, fStartY, fStartZ);
185}
186
187#endif // SHIPDATA_SHIPMCTRACK_H_
Double_t GetWeight() const
Int_t GetEventID() const
Definition ShipMCTrack.h:69
Bool_t IsSplitDecay() const
~ShipMCTrack() override
Double_t GetStartZ() const
Definition ShipMCTrack.h:67
Double_t GetPt() const
Definition ShipMCTrack.h:75
Bool_t IsSplitSurvivor() const
void MultiplyWeight(Double_t w)
Definition ShipMCTrack.h:80
void Print(Int_t iTrack=0) const
Double32_t fPy
Double_t GetStartX() const
Definition ShipMCTrack.h:65
Double_t GetRapidity() const
Double_t GetMass() const
ClassDefOverride(ShipMCTrack, 10)
void SetWeight(Double_t w)
Definition ShipMCTrack.h:81
void GetMomentum(TVector3 &momentum)
Double_t GetStartY() const
Definition ShipMCTrack.h:66
void SetSplitSet(Int_t splitSet, Int_t role, Double_t splitWeight)
void SetTrackID(const Int_t &trackID)
Double32_t fStartX
Int_t GetProcID() const
Definition ShipMCTrack.h:71
Double32_t fW
Double32_t fStartZ
Double32_t fM
Double32_t fStartY
Double_t GetStartT() const
Definition ShipMCTrack.h:68
void GetStartVertex(TVector3 &vertex)
void SetEventID(const Int_t &eventID)
void SetProcID(Int_t i)
Definition ShipMCTrack.h:70
Double32_t fSplitWeight
Int_t GetSplitRole() const
Double32_t fStartT
Double_t GetPy() const
Definition ShipMCTrack.h:63
Int_t fSplitSet
Double_t GetEnergy() const
Double_t GetPx() const
Definition ShipMCTrack.h:62
TString GetProcName() const
Definition ShipMCTrack.h:72
Int_t GetPdgCode() const
Definition ShipMCTrack.h:60
Int_t fSplitRole
void Get4Momentum(TLorentzVector &momentum)
Int_t GetMotherId() const
Definition ShipMCTrack.h:61
Int_t fMotherId
Double_t GetP() const
Definition ShipMCTrack.h:76
Double_t GetSplitWeight() const
Double32_t fPz
Double32_t fPx
@ kSplitDecay
a clone standing for one decay of the split track
Definition ShipMCTrack.h:34
@ kNotSplit
not part of a split set
Definition ShipMCTrack.h:32
@ kSplitSurvivor
the split track itself, or its continuation
Definition ShipMCTrack.h:33
void SetMotherId(Int_t id)
void SetStartT(Double_t t)
Int_t GetSplitSet() const
Double_t GetPz() const
Definition ShipMCTrack.h:64