ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtMCTrack.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 version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // -------------------------------------------------------------------------
10 // ----- AtMCTrack header file -----
11 // ----- M. Al-Turany June 2014 -----
12 // -------------------------------------------------------------------------
13 
20 #ifndef AtMCTrack_H
21 #define AtMCTrack_H 1
22 
23 #include <Rtypes.h> // for Double_t, Int_t, Double32_t, etc
24 #include <TLorentzVector.h> // for TLorentzVector
25 #include <TMath.h> // for Sqrt
26 #include <TObject.h> // for TObject
27 #include <TVector3.h> // for TVector3
28 
29 class TParticle;
30 class TBuffer;
31 class TClass;
32 class TMemberInspector;
33 
34 class AtMCTrack : public TObject {
35 
36 public:
38  AtMCTrack();
39 
41  AtMCTrack(Int_t pdgCode, Int_t motherID, Double_t px, Double_t py, Double_t pz, Double_t x, Double_t y, Double_t z,
42  Double_t t, Int_t nPoints);
43 
45  AtMCTrack(const AtMCTrack &track);
46 
48  AtMCTrack(TParticle *particle);
49 
51  virtual ~AtMCTrack();
52 
54  void Print(Int_t iTrack = 0) const;
55 
57  Int_t GetPdgCode() const { return fPdgCode; }
58  Int_t GetMotherId() const { return fMotherId; }
59  Double_t GetPx() const { return fPx; }
60  Double_t GetPy() const { return fPy; }
61  Double_t GetPz() const { return fPz; }
62  Double_t GetStartX() const { return fStartX; }
63  Double_t GetStartY() const { return fStartY; }
64  Double_t GetStartZ() const { return fStartZ; }
65  Double_t GetStartT() const { return fStartT; }
66  Double_t GetMass() const;
67  Double_t GetEnergy() const;
68  Double_t GetPt() const { return TMath::Sqrt(fPx * fPx + fPy * fPy); }
69  Double_t GetP() const { return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz); }
70  Double_t GetRapidity() const;
71  void GetMomentum(TVector3 &momentum);
72  void Get4Momentum(TLorentzVector &momentum);
73  void GetStartVertex(TVector3 &vertex);
74 
76  void SetMotherId(Int_t id) { fMotherId = id; }
77 
78 private:
80  Int_t fPdgCode;
81 
83  Int_t fMotherId;
84 
86  Double32_t fPx, fPy, fPz;
87 
89  Double32_t fStartX, fStartY, fStartZ, fStartT;
90 
106  Int_t fNPoints;
107 
108  ClassDef(AtMCTrack, 1);
109 };
110 
111 // ========== Inline functions ========================================
112 
113 inline Double_t AtMCTrack::GetEnergy() const
114 {
115  Double_t mass = GetMass();
116  return TMath::Sqrt(mass * mass + fPx * fPx + fPy * fPy + fPz * fPz);
117 }
118 
119 inline void AtMCTrack::GetMomentum(TVector3 &momentum)
120 {
121  momentum.SetXYZ(fPx, fPy, fPz);
122 }
123 
124 inline void AtMCTrack::Get4Momentum(TLorentzVector &momentum)
125 {
126  momentum.SetXYZT(fPx, fPy, fPz, GetEnergy());
127 }
128 
129 inline void AtMCTrack::GetStartVertex(TVector3 &vertex)
130 {
131  vertex.SetXYZ(fStartX, fStartY, fStartZ);
132 }
133 
134 #endif
AtMCTrack::GetPt
Double_t GetPt() const
Definition: AtMCTrack.h:68
AtMCTrack::GetPy
Double_t GetPy() const
Definition: AtMCTrack.h:60
AtMCTrack::GetMomentum
void GetMomentum(TVector3 &momentum)
Definition: AtMCTrack.h:119
AtMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: AtMCTrack.h:57
AtMCTrack::GetPx
Double_t GetPx() const
Definition: AtMCTrack.h:59
AtMCTrack::GetStartX
Double_t GetStartX() const
Definition: AtMCTrack.h:62
AtMCTrack::AtMCTrack
AtMCTrack()
Definition: AtMCTrack.cxx:31
AtMCTrack::SetMotherId
void SetMotherId(Int_t id)
Definition: AtMCTrack.h:76
y
const double * y
Definition: lmcurve.cxx:20
AtMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex)
Definition: AtMCTrack.h:129
AtMCTrack::GetStartZ
Double_t GetStartZ() const
Definition: AtMCTrack.h:64
AtMCTrack::GetStartY
Double_t GetStartY() const
Definition: AtMCTrack.h:63
AtMCTrack::GetP
Double_t GetP() const
Definition: AtMCTrack.h:69
AtMCTrack::~AtMCTrack
virtual ~AtMCTrack()
AtMCTrack::GetMass
Double_t GetMass() const
Definition: AtMCTrack.cxx:80
AtMCTrack::GetStartT
Double_t GetStartT() const
Definition: AtMCTrack.h:65
AtMCTrack
Definition: AtMCTrack.h:34
AtMCTrack::GetEnergy
Double_t GetEnergy() const
Definition: AtMCTrack.h:113
AtMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: AtMCTrack.cxx:95
AtMCTrack::Get4Momentum
void Get4Momentum(TLorentzVector &momentum)
Definition: AtMCTrack.h:124
AtMCTrack::Print
void Print(Int_t iTrack=0) const
Definition: AtMCTrack.cxx:67
AtMCTrack::GetPz
Double_t GetPz() const
Definition: AtMCTrack.h:61
AtMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: AtMCTrack.h:58
AtMCTrack::AtMCTrack
AtMCTrack(const AtMCTrack &track)