FairShip
Loading...
Searching...
No Matches
ShipParticle Class Reference

#include <ShipParticle.h>

Inheritance diagram for ShipParticle:
Collaboration diagram for ShipParticle:

Public Member Functions

 ShipParticle ()
 
 ShipParticle (Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, Double_t px, Double_t py, Double_t pz, Double_t etot, Double_t vx, Double_t vy, Double_t vz, Double_t time)
 
 ShipParticle (Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, const TLorentzVector &p, const TLorentzVector &v)
 
virtual ~ShipParticle ()
 
 ShipParticle (const ShipParticle &particle)=default
 
ShipParticleoperator= (const ShipParticle &particle)=default
 
void Print (Int_t iTrack=0) const
 
Int_t GetPdgCode () const
 
Int_t GetStatusCode () const
 
Int_t GetMother (Int_t i) const
 
Int_t GetFirstMother () const
 
Int_t GetSecondMother () const
 
Int_t GetDaughter (Int_t i) const
 
Int_t GetFirstDaughter () const
 
Int_t GetLastDaughter () const
 
const char * GetName () const override
 
Double_t Px () const
 
Double_t Py () const
 
Double_t Pz () const
 
Double_t P () const
 
Double_t Pt () const
 
Double_t Energy () const
 
void GetMomentum (TLorentzVector &momentum) const
 
TLorentzVector GetMomentum () const
 
void Momentum (TLorentzVector &momentum) const
 
Double_t GetMass () const
 
Double_t Vx () const
 
Double_t Vy () const
 
Double_t Vz () const
 
Double_t T () const
 
void GetVertex (TVector3 &vertex) const
 
TVector3 GetVertex () const
 
void ProductionVertex (TLorentzVector &vertex) const
 
const std::array< Double_t, 10 > & GetCovP () const
 
void SetCovP (const Double_t *covElements)
 
void SetCovP (const std::array< Double_t, 10 > &covElements)
 
const std::array< Double_t, 6 > & GetCovV () const
 
void SetCovV (const Double_t *covElements)
 
void SetCovV (const std::array< Double_t, 6 > &covElements)
 
Double_t GetDoca () const
 
void SetDoca (Double_t x)
 

Private Member Functions

 ClassDefOverride (ShipParticle, 3)
 

Private Attributes

Int_t fPdgCode
 
Int_t fStatusCode
 
Int_t fMother [2]
 
Int_t fDaughter [2]
 
Double_t fPx
 
Double_t fPy
 
Double_t fPz
 
Double_t fE
 
Double_t fVx
 
Double_t fVy
 
Double_t fVz
 
Double_t fVt
 
std::array< Double_t, 10 > fCovP
 
std::array< Double_t, 6 > fCovV
 
Double_t fDoca
 

Detailed Description

Definition at line 18 of file ShipParticle.h.

Constructor & Destructor Documentation

◆ ShipParticle() [1/4]

ShipParticle::ShipParticle ( )

Default constructor

Definition at line 15 of file ShipParticle.cxx.

16 : TObject(),
17 fPdgCode(0),
18 fStatusCode(0),
19 fMother{0, 0},
20 fDaughter{0, 0},
21 fPx(0.),
22 fPy(0.),
23 fPz(0.),
24 fE(0.),
25 fVx(0.),
26 fVy(0.),
27 fVz(0.),
28 fVt(0.),
29 fCovP{0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
30 fCovV{0., 0., 0., 0., 0., 0.},
31 fDoca(0.) {}
Double_t fE
Definition: ShipParticle.h:105
Double_t fPx
Definition: ShipParticle.h:102
Int_t fDaughter[2]
Definition: ShipParticle.h:99
std::array< Double_t, 10 > fCovP
Definition: ShipParticle.h:116
Double_t fVz
Definition: ShipParticle.h:110
Double_t fVy
Definition: ShipParticle.h:109
Int_t fStatusCode
Definition: ShipParticle.h:97
Double_t fPz
Definition: ShipParticle.h:104
Int_t fMother[2]
Definition: ShipParticle.h:98
Double_t fDoca
Definition: ShipParticle.h:122
std::array< Double_t, 6 > fCovV
Definition: ShipParticle.h:119
Double_t fVx
Definition: ShipParticle.h:108
Int_t fPdgCode
Definition: ShipParticle.h:96
Double_t fPy
Definition: ShipParticle.h:103
Double_t fVt
Definition: ShipParticle.h:111

◆ ShipParticle() [2/4]

ShipParticle::ShipParticle ( Int_t  pdg,
Int_t  status,
Int_t  mother1,
Int_t  mother2,
Int_t  daughter1,
Int_t  daughter2,
Double_t  px,
Double_t  py,
Double_t  pz,
Double_t  etot,
Double_t  vx,
Double_t  vy,
Double_t  vz,
Double_t  time 
)

Definition at line 35 of file ShipParticle.cxx.

39 : TObject(),
40 fPdgCode(pdg),
41 fStatusCode(status),
42 fMother{mother1, mother2},
43 fDaughter{daughter1, daughter2},
44 fPx(px),
45 fPy(py),
46 fPz(pz),
47 fE(etot),
48 fVx(vx),
49 fVy(vy),
50 fVz(vz),
51 fVt(time),
52 fCovP{0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
53 fCovV{0., 0., 0., 0., 0., 0.},
54 fDoca(0.) {}

◆ ShipParticle() [3/4]

ShipParticle::ShipParticle ( Int_t  pdg,
Int_t  status,
Int_t  mother1,
Int_t  mother2,
Int_t  daughter1,
Int_t  daughter2,
const TLorentzVector &  p,
const TLorentzVector &  v 
)

Definition at line 58 of file ShipParticle.cxx.

61 : TObject(),
62 fPdgCode(pdg),
63 fStatusCode(status),
64 fMother{mother1, mother2},
65 fDaughter{daughter1, daughter2},
66 fPx(p.Px()),
67 fPy(p.Py()),
68 fPz(p.Pz()),
69 fE(p.E()),
70 fVx(v.X()),
71 fVy(v.Y()),
72 fVz(v.Z()),
73 fVt(v.T()),
74 fCovP{0., 0., 0., 0., 0., 0., 0., 0., 0., 0.},
75 fCovV{0., 0., 0., 0., 0., 0.},
76 fDoca(0.) {}
ROOT p
Definition: makeDecay.py:76

◆ ~ShipParticle()

ShipParticle::~ShipParticle ( )
virtual

Destructor

Definition at line 80 of file ShipParticle.cxx.

80{}

◆ ShipParticle() [4/4]

ShipParticle::ShipParticle ( const ShipParticle particle)
default

Copy constructor

Member Function Documentation

◆ ClassDefOverride()

ShipParticle::ClassDefOverride ( ShipParticle  ,
 
)
private

◆ Energy()

Double_t ShipParticle::Energy ( ) const
inline

Definition at line 56 of file ShipParticle.h.

56{ return fE; }

◆ GetCovP()

const std::array< Double_t, 10 > & ShipParticle::GetCovP ( ) const
inline

Accessors - covariance matrices

Definition at line 77 of file ShipParticle.h.

77{ return fCovP; }

◆ GetCovV()

const std::array< Double_t, 6 > & ShipParticle::GetCovV ( ) const
inline

Definition at line 84 of file ShipParticle.h.

84{ return fCovV; }

◆ GetDaughter()

Int_t ShipParticle::GetDaughter ( Int_t  i) const
inline

Definition at line 45 of file ShipParticle.h.

45{ return fDaughter[i]; }
int i
Definition: ShipAna.py:97

◆ GetDoca()

Double_t ShipParticle::GetDoca ( ) const
inline

Distance of closest approach

Definition at line 91 of file ShipParticle.h.

91{ return fDoca; }

◆ GetFirstDaughter()

Int_t ShipParticle::GetFirstDaughter ( ) const
inline

Definition at line 46 of file ShipParticle.h.

46{ return fDaughter[0]; }

◆ GetFirstMother()

Int_t ShipParticle::GetFirstMother ( ) const
inline

Definition at line 43 of file ShipParticle.h.

43{ return fMother[0]; }

◆ GetLastDaughter()

Int_t ShipParticle::GetLastDaughter ( ) const
inline

Definition at line 47 of file ShipParticle.h.

47{ return fDaughter[1]; }

◆ GetMass()

Double_t ShipParticle::GetMass ( ) const

Definition at line 126 of file ShipParticle.cxx.

126 {
127 return TMath::Sqrt(fE * fE - fPx * fPx - fPy * fPy - fPz * fPz);
128}

◆ GetMomentum() [1/2]

TLorentzVector ShipParticle::GetMomentum ( ) const
inline

Definition at line 58 of file ShipParticle.h.

58 {
59 return TLorentzVector(fPx, fPy, fPz, fE);
60 }

◆ GetMomentum() [2/2]

void ShipParticle::GetMomentum ( TLorentzVector &  momentum) const

Definition at line 114 of file ShipParticle.cxx.

114 {
115 momentum.SetPxPyPzE(fPx, fPy, fPz, fE);
116}

◆ GetMother()

Int_t ShipParticle::GetMother ( Int_t  i) const
inline

Definition at line 42 of file ShipParticle.h.

42{ return fMother[i]; }

◆ GetName()

const char * ShipParticle::GetName ( ) const
override

Definition at line 145 of file ShipParticle.cxx.

145 {
146 // Return particle name based on PDG code
147 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(fPdgCode);
148 if (particle) {
149 return particle->GetName();
150 }
151 return "Unknown";
152}

◆ GetPdgCode()

Int_t ShipParticle::GetPdgCode ( ) const
inline

Accessors - particle properties

Definition at line 40 of file ShipParticle.h.

40{ return fPdgCode; }

◆ GetSecondMother()

Int_t ShipParticle::GetSecondMother ( ) const
inline

Definition at line 44 of file ShipParticle.h.

44{ return fMother[1]; }

◆ GetStatusCode()

Int_t ShipParticle::GetStatusCode ( ) const
inline

Definition at line 41 of file ShipParticle.h.

41{ return fStatusCode; }

◆ GetVertex() [1/2]

TVector3 ShipParticle::GetVertex ( ) const
inline

Definition at line 70 of file ShipParticle.h.

70{ return TVector3(fVx, fVy, fVz); }

◆ GetVertex() [2/2]

void ShipParticle::GetVertex ( TVector3 &  vertex) const

Definition at line 120 of file ShipParticle.cxx.

120 {
121 vertex.SetXYZ(fVx, fVy, fVz);
122}

◆ Momentum()

void ShipParticle::Momentum ( TLorentzVector &  momentum) const
inline

Definition at line 61 of file ShipParticle.h.

61{ GetMomentum(momentum); }
TLorentzVector GetMomentum() const
Definition: ShipParticle.h:58

◆ operator=()

ShipParticle & ShipParticle::operator= ( const ShipParticle particle)
default

◆ P()

Double_t ShipParticle::P ( ) const
inline

Definition at line 54 of file ShipParticle.h.

54{ return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz); }

◆ Print()

void ShipParticle::Print ( Int_t  iTrack = 0) const

Output to screen

Definition at line 132 of file ShipParticle.cxx.

132 {
133 LOG(info) << "ShipParticle " << iTrack << ":";
134 LOG(info) << " PDG code: " << fPdgCode << ", Status: " << fStatusCode;
135 LOG(info) << " Mothers: " << fMother[0] << ", " << fMother[1];
136 LOG(info) << " Daughters: " << fDaughter[0] << ", " << fDaughter[1];
137 LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ", " << fE
138 << ") GeV";
139 LOG(info) << " Vertex (" << fVx << ", " << fVy << ", " << fVz
140 << ") cm, t = " << fVt << " ns";
141 LOG(info) << " DOCA: " << fDoca << " cm";
142}

◆ ProductionVertex()

void ShipParticle::ProductionVertex ( TLorentzVector &  vertex) const
inline

Definition at line 71 of file ShipParticle.h.

71 {
72 vertex.SetXYZT(fVx, fVy, fVz, fVt);
73 }

◆ Pt()

Double_t ShipParticle::Pt ( ) const
inline

Definition at line 55 of file ShipParticle.h.

55{ return TMath::Sqrt(fPx * fPx + fPy * fPy); }

◆ Px()

Double_t ShipParticle::Px ( ) const
inline

Accessors - momentum

Definition at line 51 of file ShipParticle.h.

51{ return fPx; }

◆ Py()

Double_t ShipParticle::Py ( ) const
inline

Definition at line 52 of file ShipParticle.h.

52{ return fPy; }

◆ Pz()

Double_t ShipParticle::Pz ( ) const
inline

Definition at line 53 of file ShipParticle.h.

53{ return fPz; }

◆ SetCovP() [1/2]

void ShipParticle::SetCovP ( const Double_t *  covElements)

Definition at line 84 of file ShipParticle.cxx.

84 {
85 // Set 4x4 symmetric momentum covariance matrix from 10 unique elements
86 // Order: (0,0), (0,1), (0,2), (0,3), (1,1), (1,2), (1,3), (2,2), (2,3), (3,3)
87 fCovP[0] = covElements[0]; // (0,0)
88 fCovP[1] = covElements[1]; // (0,1)
89 fCovP[2] = covElements[2]; // (0,2)
90 fCovP[3] = covElements[3]; // (0,3)
91 fCovP[4] = covElements[4]; // (1,1)
92 fCovP[5] = covElements[5]; // (1,2)
93 fCovP[6] = covElements[6]; // (1,3)
94 fCovP[7] = covElements[7]; // (2,2)
95 fCovP[8] = covElements[8]; // (2,3)
96 fCovP[9] = covElements[9]; // (3,3)
97}

◆ SetCovP() [2/2]

void ShipParticle::SetCovP ( const std::array< Double_t, 10 > &  covElements)
inline

Definition at line 79 of file ShipParticle.h.

79 {
80 fCovP = covElements;
81 }

◆ SetCovV() [1/2]

void ShipParticle::SetCovV ( const Double_t *  covElements)

Definition at line 101 of file ShipParticle.cxx.

101 {
102 // Set 3x3 symmetric vertex covariance matrix from 6 unique elements
103 // Order: (0,0), (0,1), (0,2), (1,1), (1,2), (2,2)
104 fCovV[0] = covElements[0]; // (0,0)
105 fCovV[1] = covElements[1]; // (0,1)
106 fCovV[2] = covElements[2]; // (0,2)
107 fCovV[3] = covElements[3]; // (1,1)
108 fCovV[4] = covElements[4]; // (1,2)
109 fCovV[5] = covElements[5]; // (2,2)
110}

◆ SetCovV() [2/2]

void ShipParticle::SetCovV ( const std::array< Double_t, 6 > &  covElements)
inline

Definition at line 86 of file ShipParticle.h.

86 {
87 fCovV = covElements;
88 }

◆ SetDoca()

void ShipParticle::SetDoca ( Double_t  x)
inline

Definition at line 92 of file ShipParticle.h.

92{ fDoca = x; }

◆ T()

Double_t ShipParticle::T ( ) const
inline

Definition at line 68 of file ShipParticle.h.

68{ return fVt; }

◆ Vx()

Double_t ShipParticle::Vx ( ) const
inline

Accessors - vertex

Definition at line 65 of file ShipParticle.h.

65{ return fVx; }

◆ Vy()

Double_t ShipParticle::Vy ( ) const
inline

Definition at line 66 of file ShipParticle.h.

66{ return fVy; }

◆ Vz()

Double_t ShipParticle::Vz ( ) const
inline

Definition at line 67 of file ShipParticle.h.

67{ return fVz; }

Member Data Documentation

◆ fCovP

std::array<Double_t, 10> ShipParticle::fCovP
private

Definition at line 116 of file ShipParticle.h.

◆ fCovV

std::array<Double_t, 6> ShipParticle::fCovV
private

Definition at line 119 of file ShipParticle.h.

◆ fDaughter

Int_t ShipParticle::fDaughter[2]
private

Definition at line 99 of file ShipParticle.h.

◆ fDoca

Double_t ShipParticle::fDoca
private

Definition at line 122 of file ShipParticle.h.

◆ fE

Double_t ShipParticle::fE
private

Definition at line 105 of file ShipParticle.h.

◆ fMother

Int_t ShipParticle::fMother[2]
private

Definition at line 98 of file ShipParticle.h.

◆ fPdgCode

Int_t ShipParticle::fPdgCode
private

Definition at line 96 of file ShipParticle.h.

◆ fPx

Double_t ShipParticle::fPx
private

Definition at line 102 of file ShipParticle.h.

◆ fPy

Double_t ShipParticle::fPy
private

Definition at line 103 of file ShipParticle.h.

◆ fPz

Double_t ShipParticle::fPz
private

Definition at line 104 of file ShipParticle.h.

◆ fStatusCode

Int_t ShipParticle::fStatusCode
private

Definition at line 97 of file ShipParticle.h.

◆ fVt

Double_t ShipParticle::fVt
private

Definition at line 111 of file ShipParticle.h.

◆ fVx

Double_t ShipParticle::fVx
private

Definition at line 108 of file ShipParticle.h.

◆ fVy

Double_t ShipParticle::fVy
private

Definition at line 109 of file ShipParticle.h.

◆ fVz

Double_t ShipParticle::fVz
private

Definition at line 110 of file ShipParticle.h.


The documentation for this class was generated from the following files: