CbmRoot
CbmKFParticle.h
Go to the documentation of this file.
1 
10 #ifndef CBMKFPARTICLE_H
11 #define CBMKFPARTICLE_H
12 
13 #include "CbmKFTrackInterface.h"
14 #include "CbmKFVertexInterface.h"
15 
16 #include <vector>
17 
18 class CbmKFParticle : public TObject {
19 
20 public:
21  int Id() const { return fId; };
22  int NDaughters() const { return fDaughtersIds.size(); };
23  const std::vector<int>& DaughterIds() const { return fDaughtersIds; };
24 
25  void SetId(int id) { fId = id; } // should be always used (manualy)
26  void SetNDaughters(int n) { fDaughtersIds.reserve(n); }
27  void AddDaughter(int id) { fDaughtersIds.push_back(id); }
28  void CleanDaughtersId() { fDaughtersIds.clear(); }
29 
30 private:
31  int fId; // id of particle
32  std::vector<int>
33  fDaughtersIds; // id of particles it created from. if size == 1 then this is id of track. TODO use in functions. why unsigned short int doesn't work???
34 
35  int fPDG; // pdg hypothesis
36 
37 public:
38  Double_t r[8], C[36];
39  Int_t NDF;
40  Double_t Chi2, Q;
42 
43  float fieldRegion[10];
44 
46  : fId(-1)
47  , fDaughtersIds()
48  , fPDG(0)
49  , NDF(0)
50  , Chi2(0)
51  , Q(0)
52  , AtProductionVertex(0) {};
54  Double_t* z0 = 0,
55  Int_t* qHypo = 0,
56  Int_t* pdg = 0);
57 
59 
60  // Construction
61 
62  void Construct(std::vector<CbmKFTrackInterface*>& vDaughters,
63  CbmKFVertexInterface* Parent = 0,
64  Double_t Mass = -1,
65  Double_t CutChi2 = -1);
66 
67  void ConstructFromKFParticle(std::vector<CbmKFParticle*>& vDaughters,
68  CbmKFVertexInterface* Parent = 0,
69  Double_t Mass = -1,
70  Double_t CutChi2 = -1);
71 
72  // Transportation
73 
76 
77  Double_t GetDStoPoint(const Double_t xyz[]) const;
78 
79  // Accessors ?
80 
81  //* Simple accessors
82  Double_t GetX() const { return r[0]; }
83  Double_t GetY() const { return r[1]; }
84  Double_t GetZ() const { return r[2]; }
85  Double_t GetPx() const { return r[3]; }
86  Double_t GetPy() const { return r[4]; }
87  Double_t GetPz() const { return r[5]; }
88  Double_t GetE() const { return r[6]; }
89  Double_t GetS() const { return r[7]; }
90  Double_t GetQ() const { return Q; }
91  Double_t GetChi2() const { return Chi2; }
92  Int_t GetNDF() const { return NDF; }
93  Double_t* GetParameters() { return r; }
94  Double_t* GetCovMatrix() { return C; }
95 
96  Bool_t GetAtProductionVertex() const { return AtProductionVertex; }
97 
98 
99  Double_t GetParameter(Int_t i) const { return r[i]; }
100  Double_t GetCovariance(Int_t i) const { return C[i]; }
101  Double_t GetCovariance(Int_t i, Int_t j) const { return C[IJ(i, j)]; }
102 
103  //*
104  //* MODIFIERS
105  //*
106 
107  Double_t& rX() { return r[0]; }
108  Double_t& rY() { return r[1]; }
109  Double_t& rZ() { return r[2]; }
110  Double_t& rPx() { return r[3]; }
111  Double_t& rPy() { return r[4]; }
112  Double_t& rPz() { return r[5]; }
113  Double_t& rE() { return r[6]; }
114  Double_t& rS() { return r[7]; }
115  Double_t& rQ() { return Q; }
116  Double_t& rChi2() { return Chi2; }
117  Int_t& rNDF() { return NDF; }
118 
119  Double_t& rParameter(Int_t i) { return r[i]; }
120  Double_t& rCovariance(Int_t i) { return C[i]; }
121  Double_t& rCovariance(Int_t i, Int_t j) { return C[IJ(i, j)]; }
122 
123  //* Accessor with calculations
124 
125  void GetKFTrack(CbmKFTrackInterface* Track);
127  void GetMomentum(Double_t& P, Double_t& Error);
128  void GetMass(Double_t& M, Double_t& Error);
129  void GetDecayLength(Double_t& L, Double_t& Error);
130  void GetLifeTime(Double_t& T, Double_t& Error);
131 
132  Double_t GetRapidity() const;
133  Double_t GetPt() const;
134  Double_t GetTheta() const;
135  Double_t GetPhi() const;
136 
137  void Extrapolate(Double_t r0[], double T);
138  void ExtrapolateLine(Double_t r0[], double T);
139 
140 
141  void SetPDG(int pdg) { fPDG = pdg; }
142  int GetPDG() const { return fPDG; }
143 
144 protected:
145  Double_t& Cij(Int_t i, Int_t j) {
146  return C[(j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i];
147  }
148  static Int_t IJ(Int_t i, Int_t j) {
149  return (j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i;
150  }
151 
152  void MeasureMass(Double_t r0[], Double_t Mass);
153  void MeasureProductionVertex(Double_t r0[], CbmKFVertexInterface* Parent);
154  void Convert(Double_t r0[], bool ToProduction);
155 
156 
158 };
159 #endif /* !CBMKFPARTICLE_H */
CbmKFParticle::NDF
Int_t NDF
Definition: CbmKFParticle.h:39
CbmKFParticle::GetLifeTime
void GetLifeTime(Double_t &T, Double_t &Error)
Definition: CbmKFParticle.cxx:1528
CbmKFParticle::CbmKFParticle
CbmKFParticle()
Definition: CbmKFParticle.h:45
CbmKFParticle::NDaughters
int NDaughters() const
Definition: CbmKFParticle.h:22
CbmKFParticle::GetDecayLength
void GetDecayLength(Double_t &L, Double_t &Error)
Definition: CbmKFParticle.cxx:1511
CbmKFParticle::GetKFTrack
void GetKFTrack(CbmKFTrackInterface *Track)
Definition: CbmKFParticle.cxx:1425
CbmKFParticle::GetZ
Double_t GetZ() const
Definition: CbmKFParticle.h:84
CbmKFParticle::rPy
Double_t & rPy()
Definition: CbmKFParticle.h:111
CbmKFVertexInterface.h
CbmKFParticle::GetCovMatrix
Double_t * GetCovMatrix()
Definition: CbmKFParticle.h:94
CbmKFParticle::Convert
void Convert(Double_t r0[], bool ToProduction)
Definition: CbmKFParticle.cxx:1122
CbmKFParticle::Extrapolate
void Extrapolate(Double_t r0[], double T)
Definition: CbmKFParticle.cxx:1242
CbmKFParticle::rChi2
Double_t & rChi2()
Definition: CbmKFParticle.h:116
CbmKFParticle::DaughterIds
const std::vector< int > & DaughterIds() const
Definition: CbmKFParticle.h:23
CbmKFParticle::SetPDG
void SetPDG(int pdg)
Definition: CbmKFParticle.h:141
CbmKFParticle::TransportToDecayVertex
void TransportToDecayVertex()
Definition: CbmKFParticle.cxx:1414
CbmKFParticle::MeasureProductionVertex
void MeasureProductionVertex(Double_t r0[], CbmKFVertexInterface *Parent)
Definition: CbmKFParticle.cxx:970
CbmKFParticle::r
Double_t r[8]
Definition: CbmKFParticle.h:38
CbmKFParticle::GetPhi
Double_t GetPhi() const
Definition: CbmKFParticle.cxx:1543
CbmKFParticle::rZ
Double_t & rZ()
Definition: CbmKFParticle.h:109
CbmKFParticle::fPDG
int fPDG
Definition: CbmKFParticle.h:35
CbmKFParticle::Construct
void Construct(std::vector< CbmKFTrackInterface * > &vDaughters, CbmKFVertexInterface *Parent=0, Double_t Mass=-1, Double_t CutChi2=-1)
Definition: CbmKFParticle.cxx:144
CbmKFParticle::AddDaughter
void AddDaughter(int id)
Definition: CbmKFParticle.h:27
CbmKFParticle::IJ
static Int_t IJ(Int_t i, Int_t j)
Definition: CbmKFParticle.h:148
CbmKFParticle::GetChi2
Double_t GetChi2() const
Definition: CbmKFParticle.h:91
CbmKFParticle::GetPx
Double_t GetPx() const
Definition: CbmKFParticle.h:85
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmKFParticle::GetX
Double_t GetX() const
Definition: CbmKFParticle.h:82
CbmKFParticle::ConstructFromKFParticle
void ConstructFromKFParticle(std::vector< CbmKFParticle * > &vDaughters, CbmKFVertexInterface *Parent=0, Double_t Mass=-1, Double_t CutChi2=-1)
Definition: CbmKFParticle.cxx:533
CbmKFParticle::rParameter
Double_t & rParameter(Int_t i)
Definition: CbmKFParticle.h:119
CbmKFParticle::GetKFVertex
void GetKFVertex(CbmKFVertexInterface &vtx)
Definition: CbmKFParticle.cxx:1472
CbmKFParticle::rS
Double_t & rS()
Definition: CbmKFParticle.h:114
CbmKFParticle::GetMass
void GetMass(Double_t &M, Double_t &Error)
Definition: CbmKFParticle.cxx:1496
CbmKFParticle::GetCovariance
Double_t GetCovariance(Int_t i, Int_t j) const
Definition: CbmKFParticle.h:101
CbmKFParticle::rX
Double_t & rX()
Definition: CbmKFParticle.h:107
CbmKFParticle::ClassDef
ClassDef(CbmKFParticle, 1)
CbmKFParticle::GetPt
Double_t GetPt() const
Definition: CbmKFParticle.cxx:1539
CbmKFParticle::GetNDF
Int_t GetNDF() const
Definition: CbmKFParticle.h:92
CbmKFParticle::rPx
Double_t & rPx()
Definition: CbmKFParticle.h:110
CbmKFParticle::GetDStoPoint
Double_t GetDStoPoint(const Double_t xyz[]) const
Definition: CbmKFParticle.cxx:1546
CbmKFTrackInterface.h
CbmKFParticle::GetParameters
Double_t * GetParameters()
Definition: CbmKFParticle.h:93
CbmKFParticle::GetPy
Double_t GetPy() const
Definition: CbmKFParticle.h:86
CbmKFParticle::TransportToProductionVertex
void TransportToProductionVertex()
Definition: CbmKFParticle.cxx:1404
CbmKFParticle::SetId
void SetId(int id)
Definition: CbmKFParticle.h:25
CbmKFParticle::rCovariance
Double_t & rCovariance(Int_t i)
Definition: CbmKFParticle.h:120
CbmKFParticle::ExtrapolateLine
void ExtrapolateLine(Double_t r0[], double T)
Definition: CbmKFParticle.cxx:1197
CbmKFParticle::rE
Double_t & rE()
Definition: CbmKFParticle.h:113
CbmKFParticle::Cij
Double_t & Cij(Int_t i, Int_t j)
Definition: CbmKFParticle.h:145
CbmKFVertexInterface
Definition: CbmKFVertexInterface.h:24
CbmKFParticle::GetPDG
int GetPDG() const
Definition: CbmKFParticle.h:142
CbmKFParticle::Id
int Id() const
Definition: CbmKFParticle.h:21
CbmKFParticle::AtProductionVertex
Bool_t AtProductionVertex
Definition: CbmKFParticle.h:41
CbmKFParticle::Chi2
Double_t Chi2
Definition: CbmKFParticle.h:40
CbmKFParticle::GetAtProductionVertex
Bool_t GetAtProductionVertex() const
Definition: CbmKFParticle.h:96
CbmKFTrackInterface
Definition: CbmKFTrackInterface.h:26
CbmKFParticle::GetCovariance
Double_t GetCovariance(Int_t i) const
Definition: CbmKFParticle.h:100
CbmKFParticle::Q
Double_t Q
Definition: CbmKFParticle.h:40
CbmKFParticle::CleanDaughtersId
void CleanDaughtersId()
Definition: CbmKFParticle.h:28
CbmKFParticle::C
Double_t C[36]
Definition: CbmKFParticle.h:38
CbmKFParticle::SetNDaughters
void SetNDaughters(int n)
Definition: CbmKFParticle.h:26
CbmKFParticle::fieldRegion
float fieldRegion[10]
Definition: CbmKFParticle.h:43
CbmKFParticle
Definition: CbmKFParticle.h:18
CbmKFParticle::GetRapidity
Double_t GetRapidity() const
Definition: CbmKFParticle.cxx:1536
CbmKFParticle::~CbmKFParticle
~CbmKFParticle()
Definition: CbmKFParticle.h:58
CbmKFParticle::GetQ
Double_t GetQ() const
Definition: CbmKFParticle.h:90
CbmKFParticle::rNDF
Int_t & rNDF()
Definition: CbmKFParticle.h:117
CbmKFParticle::rPz
Double_t & rPz()
Definition: CbmKFParticle.h:112
CbmKFParticle::GetMomentum
void GetMomentum(Double_t &P, Double_t &Error)
Definition: CbmKFParticle.cxx:1482
CbmKFParticle::fDaughtersIds
std::vector< int > fDaughtersIds
Definition: CbmKFParticle.h:33
CbmKFParticle::rCovariance
Double_t & rCovariance(Int_t i, Int_t j)
Definition: CbmKFParticle.h:121
CbmKFParticle::MeasureMass
void MeasureMass(Double_t r0[], Double_t Mass)
Definition: CbmKFParticle.cxx:934
CbmKFParticle::rQ
Double_t & rQ()
Definition: CbmKFParticle.h:115
CbmKFParticle::GetE
Double_t GetE() const
Definition: CbmKFParticle.h:88
CbmKFParticle::GetTheta
Double_t GetTheta() const
Definition: CbmKFParticle.cxx:1542
CbmKFParticle::GetParameter
Double_t GetParameter(Int_t i) const
Definition: CbmKFParticle.h:99
CbmKFParticle::rY
Double_t & rY()
Definition: CbmKFParticle.h:108
CbmKFParticle::CbmKFParticle
CbmKFParticle(CbmKFTrackInterface *Track, Double_t *z0=0, Int_t *qHypo=0, Int_t *pdg=0)
CbmKFParticle::GetPz
Double_t GetPz() const
Definition: CbmKFParticle.h:87
CbmKFParticle::fId
int fId
Definition: CbmKFParticle.h:31
CbmKFParticle::GetY
Double_t GetY() const
Definition: CbmKFParticle.h:83
CbmKFParticle::GetS
Double_t GetS() const
Definition: CbmKFParticle.h:89