BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmKFParticle.h
Go to the documentation of this file.
1/** The CbmKFParticle class
2 *
3 * @author S.Gorbunov, I.Kisel
4 * @version 1.0
5 * @since 24.11.06
6 *
7 * Class to fit decayed particle with the Kalman Filter method
8 *
9 */
10#ifndef CBMKFPARTICLE_H
11#define CBMKFPARTICLE_H
12
13#include "CbmKFTrackInterface.h"
15
16#include <vector>
17using namespace std;
18
19class CbmKFParticle : public TObject
20{
21
22 public:
23 int Id() const { return fId; };
24 int NDaughters() const { return fDaughtersIds.size(); };
25 const vector<int>& DaughterIds() const { return fDaughtersIds; };
26
27 void SetId(int id) { fId = id; } // should be always used (manualy)
28 void SetNDaughters(int n) { fDaughtersIds.reserve(n); }
29 void AddDaughter(int id) { fDaughtersIds.push_back(id); }
30 void CleanDaughtersId() { fDaughtersIds.clear(); }
31
32 private:
33 int fId; // id of particle
34 vector<int> fDaughtersIds; // id of particles it created from. if size == 1 then this is id of track. TODO use in
35 // functions. why unsigned short int doesn't work???
36
37 int fPDG; // pdg hypothesis
38
39 public:
40 Double_t r[8], C[36];
44
45 float fieldRegion[10];
46
48 : fId(-1)
50 , fPDG(0)
51 , NDF(0)
52 , Chi2(0)
53 , Q(0)
54 , AtProductionVertex(0) {};
55 CbmKFParticle(CbmKFTrackInterface* Track, Double_t* z0 = 0, Int_t* qHypo = 0, Int_t* pdg = 0);
56
58
59 // Construction
60
61 void Construct(vector<CbmKFTrackInterface*>& vDaughters,
62 CbmKFVertexInterface* Parent = 0,
63 Double_t Mass = -1,
64 Double_t CutChi2 = -1);
65
66 void ConstructFromKFParticle(vector<CbmKFParticle*>& vDaughters,
67 CbmKFVertexInterface* Parent = 0,
68 Double_t Mass = -1,
69 Double_t CutChi2 = -1);
70
71 // Transportation
72
75
76 Double_t GetDStoPoint(const Double_t xyz[]) const;
77
78 // Accessors ?
79
80 //* Simple accessors
81 Double_t GetX() const { return r[0]; }
82 Double_t GetY() const { return r[1]; }
83 Double_t GetZ() const { return r[2]; }
84 Double_t GetPx() const { return r[3]; }
85 Double_t GetPy() const { return r[4]; }
86 Double_t GetPz() const { return r[5]; }
87 Double_t GetE() const { return r[6]; }
88 Double_t GetS() const { return r[7]; }
89 Double_t GetQ() const { return Q; }
90 Double_t GetChi2() const { return Chi2; }
91 Int_t GetNDF() const { return NDF; }
92 Double_t* GetParameters() { return r; }
93 Double_t* GetCovMatrix() { return C; }
94
96
97 Double_t GetParameter(Int_t i) const { return r[i]; }
98 Double_t GetCovariance(Int_t i) const { return C[i]; }
99 Double_t GetCovariance(Int_t i, Int_t j) const { return C[IJ(i, j)]; }
100
101 //*
102 //* MODIFIERS
103 //*
104
105 Double_t& rX() { return r[0]; }
106 Double_t& rY() { return r[1]; }
107 Double_t& rZ() { return r[2]; }
108 Double_t& rPx() { return r[3]; }
109 Double_t& rPy() { return r[4]; }
110 Double_t& rPz() { return r[5]; }
111 Double_t& rE() { return r[6]; }
112 Double_t& rS() { return r[7]; }
113 Double_t& rQ() { return Q; }
114 Double_t& rChi2() { return Chi2; }
115 Int_t& rNDF() { return NDF; }
116
117 Double_t& rParameter(Int_t i) { return r[i]; }
118 Double_t& rCovariance(Int_t i) { return C[i]; }
119 Double_t& rCovariance(Int_t i, Int_t j) { return C[IJ(i, j)]; }
120
121 //* Accessor with calculations
122
123 void GetKFTrack(CbmKFTrackInterface* Track);
126 void GetMass(Double_t& M, Double_t& Error);
129
130 Double_t GetRapidity() const;
131 Double_t GetPt() const;
132 Double_t GetTheta() const;
133 Double_t GetPhi() const;
134
135 void Extrapolate(Double_t r0[], double T);
136 void ExtrapolateLine(Double_t r0[], double T);
137
138 void SetPDG(int pdg) { fPDG = pdg; }
139 int GetPDG() const { return fPDG; }
140
141 protected:
142 Double_t& Cij(Int_t i, Int_t j) { return C[(j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i]; }
143 static Int_t IJ(Int_t i, Int_t j) { return (j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i; }
144
145 void MeasureMass(Double_t r0[], Double_t Mass);
147 void Convert(Double_t r0[], bool ToProduction);
148
150};
151#endif /* !CBMKFPARTICLE_H */
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
double Double_t
#define ClassDef(name, id)
void Error(const char *location, const char *msgfmt,...)
void SetNDaughters(int n)
void GetMomentum(Double_t &P, Double_t &Error)
int NDaughters() const
void Extrapolate(Double_t r0[], double T)
Double_t & rQ()
Double_t & rCovariance(Int_t i, Int_t j)
void GetMass(Double_t &M, Double_t &Error)
Double_t & rS()
Double_t * GetParameters()
void SetId(int id)
void CleanDaughtersId()
Double_t r[8]
Double_t & rCovariance(Int_t i)
Double_t GetPt() const
Double_t GetPz() const
void ExtrapolateLine(Double_t r0[], double T)
Int_t GetNDF() const
Double_t GetE() const
void GetLifeTime(Double_t &T, Double_t &Error)
void GetDecayLength(Double_t &L, Double_t &Error)
Double_t GetRapidity() const
static Int_t IJ(Int_t i, Int_t j)
Double_t & rZ()
Double_t GetPx() const
vector< int > fDaughtersIds
Double_t & rX()
Double_t GetParameter(Int_t i) const
Double_t GetChi2() const
Double_t & Cij(Int_t i, Int_t j)
int GetPDG() const
Double_t GetS() const
Double_t & rY()
Double_t GetY() const
Double_t GetZ() const
void GetKFVertex(CbmKFVertexInterface &vtx)
void SetPDG(int pdg)
void TransportToProductionVertex()
Double_t GetTheta() const
Double_t GetCovariance(Int_t i) const
Double_t GetX() const
Bool_t GetAtProductionVertex() const
int Id() const
const vector< int > & DaughterIds() const
Double_t & rPy()
Double_t C[36]
Double_t & rPz()
Double_t GetQ() const
void MeasureProductionVertex(Double_t r0[], CbmKFVertexInterface *Parent)
float fieldRegion[10]
Bool_t AtProductionVertex
Double_t & rE()
void TransportToDecayVertex()
void AddDaughter(int id)
Double_t GetPy() const
Double_t GetDStoPoint(const Double_t xyz[]) const
Double_t & rChi2()
Double_t & rPx()
void MeasureMass(Double_t r0[], Double_t Mass)
void GetKFTrack(CbmKFTrackInterface *Track)
Double_t GetCovariance(Int_t i, Int_t j) const
Double_t & rParameter(Int_t i)
Double_t * GetCovMatrix()
void Convert(Double_t r0[], bool ToProduction)
void ConstructFromKFParticle(vector< CbmKFParticle * > &vDaughters, CbmKFVertexInterface *Parent=0, Double_t Mass=-1, Double_t CutChi2=-1)
Double_t GetPhi() const
void Construct(vector< CbmKFTrackInterface * > &vDaughters, CbmKFVertexInterface *Parent=0, Double_t Mass=-1, Double_t CutChi2=-1)
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362
Definition json.hpp:4446