FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MyProjMCTrack.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // -------------------------------------------------------------------------
10 // ----- MyProjMCTrack header file -----
11 // ----- M. Al-Turany June 2014 -----
12 // -------------------------------------------------------------------------
13 
20 #ifndef MyProjMCTrack_H
21 #define MyProjMCTrack_H 1
22 
23 #include "MyProjDetectorList.h" // for DetectorId
24 
25 #include <Rtypes.h> // for Double_t, Int_t, Double32_t, etc
26 #include <TLorentzVector.h> // for TLorentzVector
27 #include <TMath.h> // for Sqrt
28 #include <TObject.h> // for TObject
29 #include <TVector3.h> // for TVector3
30 
31 class TParticle;
32 
33 class MyProjMCTrack : public TObject
34 {
35 
36  public:
38  MyProjMCTrack();
39 
41  MyProjMCTrack(Int_t pdgCode,
42  Int_t motherID,
43  Double_t px,
44  Double_t py,
45  Double_t pz,
46  Double_t x,
47  Double_t y,
48  Double_t z,
49  Double_t t,
50  Int_t nPoints);
51 
53  MyProjMCTrack(const MyProjMCTrack& track);
54 
56  MyProjMCTrack(TParticle* particle);
57 
59  virtual ~MyProjMCTrack();
60 
62  void Print(Int_t iTrack = 0) const;
63 
65  Int_t GetPdgCode() const { return fPdgCode; }
66  Int_t GetMotherId() const { return fMotherId; }
67  Double_t GetPx() const { return fPx; }
68  Double_t GetPy() const { return fPy; }
69  Double_t GetPz() const { return fPz; }
70  Double_t GetStartX() const { return fStartX; }
71  Double_t GetStartY() const { return fStartY; }
72  Double_t GetStartZ() const { return fStartZ; }
73  Double_t GetStartT() const { return fStartT; }
74  Double_t GetMass() const;
75  Double_t GetEnergy() const;
76  Double_t GetPt() const { return TMath::Sqrt(fPx * fPx + fPy * fPy); }
77  Double_t GetP() const { return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz); }
78  Double_t GetRapidity() const;
79  void GetMomentum(TVector3& momentum);
80  void Get4Momentum(TLorentzVector& momentum);
81  void GetStartVertex(TVector3& vertex);
82 
84  Int_t GetNPoints(DetectorId detId) const;
85 
87  void SetMotherId(Int_t id) { fMotherId = id; }
88  void SetNPoints(Int_t iDet, Int_t np);
89 
90  private:
92  Int_t fPdgCode;
93 
95  Int_t fMotherId;
96 
98  Double32_t fPx, fPy, fPz;
99 
101  Double32_t fStartX, fStartY, fStartZ, fStartT;
102 
118  Int_t fNPoints;
119 
120  ClassDef(MyProjMCTrack, 1);
121 };
122 
123 // ========== Inline functions ========================================
124 
125 inline Double_t MyProjMCTrack::GetEnergy() const
126 {
127  Double_t mass = GetMass();
128  return TMath::Sqrt(mass * mass + fPx * fPx + fPy * fPy + fPz * fPz);
129 }
130 
131 inline void MyProjMCTrack::GetMomentum(TVector3& momentum) { momentum.SetXYZ(fPx, fPy, fPz); }
132 
133 inline void MyProjMCTrack::Get4Momentum(TLorentzVector& momentum) { momentum.SetXYZT(fPx, fPy, fPz, GetEnergy()); }
134 
135 inline void MyProjMCTrack::GetStartVertex(TVector3& vertex) { vertex.SetXYZ(fStartX, fStartY, fStartZ); }
136 
137 #endif
Double_t GetP() const
Definition: MyProjMCTrack.h:77
DetectorId
Int_t GetMotherId() const
Definition: MyProjMCTrack.h:66
void GetMomentum(TVector3 &momentum)
Int_t GetPdgCode() const
Definition: MyProjMCTrack.h:65
void GetStartVertex(TVector3 &vertex)
void SetMotherId(Int_t id)
Definition: MyProjMCTrack.h:87
Double_t GetPz() const
Definition: MyProjMCTrack.h:69
Int_t GetNPoints(DetectorId detId) const
void Get4Momentum(TLorentzVector &momentum)
Double_t GetStartY() const
Definition: MyProjMCTrack.h:71
Double_t GetMass() const
Double_t GetEnergy() const
void Print(Int_t iTrack=0) const
Double_t GetPt() const
Definition: MyProjMCTrack.h:76
Double_t GetRapidity() const
Double_t GetPy() const
Definition: MyProjMCTrack.h:68
void SetNPoints(Int_t iDet, Int_t np)
Double_t GetStartX() const
Definition: MyProjMCTrack.h:70
Double_t GetStartT() const
Definition: MyProjMCTrack.h:73
Double_t GetStartZ() const
Definition: MyProjMCTrack.h:72
Double_t GetPx() const
Definition: MyProjMCTrack.h:67
virtual ~MyProjMCTrack()