BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmKFParticleInterface.h
Go to the documentation of this file.
1#ifndef CbmKFParticleInterface_h
2#define CbmKFParticleInterface_h
3
4#include "CbmKFParticle.h"
6#include "CbmKFTrack.h"
8#include "CbmKFVertex.h"
10
11class L1FieldRegion;
12class CbmL1Track;
14
16{
17 public:
20 CbmKFParticleInterface(CbmKFParticle* part[], const int nPart = 0);
22
25
26 void SetField(const L1FieldRegion& field, bool isOneEntry = 0, const int iVec = 0)
27 {
28 KFPart.SetField(field, isOneEntry, iVec);
29 }
30
31 void Construct(CbmKFTrackInterface* vDaughters[][fvecLen],
32 int NDaughters,
33 CbmKFVertexInterface* Parent = 0,
34 float Mass = -1,
35 float CutChi2 = -1);
36 void Construct(CbmKFParticle_simd vDaughters[],
37 int NDaughters,
38 CbmKFVertexInterface* Parent = 0,
39 float Mass = -1,
40 float CutChi2 = -1,
41 bool isAtVtxGuess = 0);
42
45
46 void Extrapolate(CbmKFParticle_simd* Particle, fvec r0[], fvec T);
47 void Extrapolate(fvec r0[], fvec T);
48 void ExtrapolateLine(CbmKFParticle_simd* Particle, fvec r0[], fvec T);
49
50 fvec GetDStoPoint(const CbmKFParticle_simd& Particle, const fvec xyz[]) const;
51 fvec GetDStoPoint(const fvec xyz[]) const;
52
53 void SetVtxGuess(fvec& x, fvec& y, fvec& z);
54 void SetVtxErrGuess(fvec& d_x, fvec& d_y, fvec& d_z);
55
56 //* Simple accessors
57 fvec GetX() const { return KFPart.r[0]; }
58 fvec GetY() const { return KFPart.r[1]; }
59 fvec GetZ() const { return KFPart.r[2]; }
60 fvec GetPx() const { return KFPart.r[3]; }
61 fvec GetPy() const { return KFPart.r[4]; }
62 fvec GetPz() const { return KFPart.r[5]; }
63 fvec GetE() const { return KFPart.r[6]; }
64 fvec GetS() const { return KFPart.r[7]; }
65 fvec GetQ() const { return KFPart.GetQ(); }
66 fvec GetChi2() const { return KFPart.GetChi2(); }
67 fvec GetNDF() const { return KFPart.GetNDF(); }
68 fvec* GetParameters() { return KFPart.GetParameters(); }
69 const fvec* GetParameters() const { return KFPart.GetParameters(); }
70 fvec* GetCovMatrix() { return KFPart.GetCovMatrix(); }
71
72 fvec GetParameter(Int_t i) const { return KFPart.r[i]; }
73 fvec GetCovariance(Int_t i) const { return KFPart.C[i]; }
74 fvec GetCovariance(Int_t i, Int_t j) const { return KFPart.C[IJ(i, j)]; }
75
76 //*
77 //* MODIFIERS
78 //*
79
80 fvec& rX() { return KFPart.rX(); }
81 fvec& rY() { return KFPart.rY(); }
82 fvec& rZ() { return KFPart.rZ(); }
83 fvec& rPx() { return KFPart.rPx(); }
84 fvec& rPy() { return KFPart.rPy(); }
85 fvec& rPz() { return KFPart.rPz(); }
86 fvec& rE() { return KFPart.rE(); }
87 fvec& rS() { return KFPart.rS(); }
88 fvec& rQ() { return KFPart.rQ(); }
89 fvec& rChi2() { return KFPart.rChi2(); }
90 fvec& rNDF() { return KFPart.rNDF(); }
91
92 fvec& rParameter(Int_t i) { return KFPart.r[i]; }
93 fvec& rCovariance(Int_t i) { return KFPart.C[i]; }
94 fvec& rCovariance(Int_t i, Int_t j) { return KFPart.C[IJ(i, j)]; }
95
96 void GetMomentum(fvec& P, fvec& Error);
97 void GetMass(fvec& M, fvec& Error);
98
99 fvec GetTx() const { return KFPart.GetTx(); }
100 fvec GetTy() const { return KFPart.GetTy(); }
101
102 void MeasureMass(CbmKFParticle_simd* Particle, fvec r0[], fvec Mass);
104 void Convert(CbmKFParticle_simd* Particle, fvec r0[], bool ToProduction);
105 void multQSQt(const fvec Q[], fvec S[]);
106
107 void multQSQt1(const fvec J[11], fvec S[]);
108
109 void GetKFVertex(CbmKFVertex* vtx);
110 void GetKFParticle(CbmKFParticle& Part, int iPart = 0);
111 void GetKFParticle(CbmKFParticle* Part, int nPart = 0);
113
114 void GetKFVertexJ(int j, CbmKFVertex* vtx);
115
116 void SetPDG(fvec pdg) { KFPart.SetPDG(pdg); }
117 const fvec& GetPDG() const { return KFPart.GetPDG(); }
118
119 // functions for particle finding
120
121 /// Find particles with 2-body decay channel from input tracks vRTracks with primary vertex PrimVtx:
122 /// 1. K0s->pi+ pi-
123 /// 2. Lambda->p pi-
124 /// All particles are put into the Particles array. 3 cuts for each particle are required.
125 /// First index in the cuts array sets a particle number (see table above), second index - a cut number:
126 /// cut[0][0] - chi to a primary vertex of a track (sqare root from a normalized on a total error of
127 /// the track and the vertex distance between the track and the primary vertex), only
128 /// element cut[0][0] is used to select tracks, all other elements cut[*][0] are not used;
129 /// cut[*][1] - chi2/ndf of the reconstructed particle;
130 /// cut[*][2] - z coordinate of the reconstructed particle.
131 /// cut[*][3] - chi2/ndf of the reconstructed particle fitted to the PV;
132
133 // template<class T>
134 static void FindParticles(vector<CbmKFTrack>& vRTracks,
135 vector<float>& ChiToPrimVtx,
136 vector<L1FieldRegion>& vField,
137 vector<CbmKFParticle>& Particles,
138 CbmKFVertex& PrimVtx,
139 const vector<int>& vTrackPDG,
140 const float cuts[2][3] = DefaultCuts);
141
142 // static void FindParticles(vector<CbmL1Track>& vRTracks, vector<CbmKFParticle>& Particles, CbmKFVertex& PrimVtx,
143 // const vector<int>& vTrackPDG, const float cuts[2][3] = DefaultCuts);
144 // static void FindParticles(vector<CbmStsTrack>& vRTracks, vector<CbmKFParticle>& Particles, CbmKFVertex&
145 // PrimVtx,
146 // const vector<int>& vTrackPDG, const float cuts[2][3] = DefaultCuts);
147
148 static void ExtrapolateToPV(vector<CbmKFParticle>& vParticles, CbmKFVertex& PrimVtx);
150 // template<class T>
151 static void Find2DaughterDecay(vector<CbmKFTrack>& vTracks,
152 const vector<L1FieldRegion>& vField,
153 vector<CbmKFParticle>& Particles,
154 const int DaughterNegPDG,
155 const int DaughterPosPDG,
156 const int MotherPDG,
157 vector<short>& idNeg,
158 vector<short>& idPos,
159 CbmKFVertex& PrimVtx,
160 const float* cuts = 0,
161 bool isPrimary = 0,
162 vector<float>* vMotherTopoChi2Ndf = 0,
163 const float* secCuts = 0,
164 const float massMotherPDG = 0,
165 const float massMotherPDGSigma = 0,
166 vector<CbmKFParticle>* vMotherPrim = 0,
167 vector<CbmKFParticle>* vMotherSec = 0);
168 // template<class T>
169 static void Find2DaughterDecay(vector<CbmKFTrack>& vTracks,
170 const vector<L1FieldRegion>& vField,
171 vector<CbmKFParticle>& Particles,
172 const int DaughterNegPDG,
173 const int DaughterPosPDG,
174 const int MotherPDG,
175 vector<short>& idNeg,
176 vector<short>& idPos,
177 CbmKFVertex& PrimVtx,
178 const float* cuts,
179 bool isPrimary,
180 const float PtCut,
181 const float Chi2PrimCut = -100.f,
182 vector<float>* ChiToPrimVtx = 0,
183 const float* PCut = 0);
184 // template<class T>
185 static void FindTrackV0Decay(const int MotherPDG,
186 vector<CbmKFParticle>& Particles,
187 vector<CbmKFParticle>& vV0,
188 vector<CbmKFTrack>& vTracks,
189 const vector<L1FieldRegion>& field,
190 const int DaughterPDG,
191 vector<short>& idTrack,
192 CbmKFVertex& PrimVtx,
193 const float* cuts = 0,
194 bool isPrimary = 0,
195 vector<float>* ChiToPrimVtx = 0,
196 vector<CbmKFParticle>* vHyperonPrim = 0,
197 float hyperonPrimMass = 0,
198 float hyperonPrimMassErr = 0,
199 vector<CbmKFParticle>* vHyperonSec = 0);
200
201 static void FindHyperons(int PDG,
202 CbmKFParticle_simd vDaughters[2],
203 vector<int>& daughterIds,
204 vector<CbmKFParticle>& vLambdaSec,
205 vector<CbmKFParticle>& vHyperon,
206 CbmKFVertex& PrimVtx,
207 const float* cuts = 0,
208 int startIndex = 0);
209
210 // template<class T>
211 static void FindDMesLambdac(vector<CbmKFTrack>& vTracks,
212 const vector<L1FieldRegion>& vField,
213 vector<CbmKFParticle>& Particles,
214 const int DaughterPDG[5], // pi, K_b, pi_b, K, p
215 const int MotherPDG[8],
216 vector<short>* idTrack[5], // pi, K_b, pi_b, K, p
217 CbmKFVertex& PrimVtx,
218 const float cuts[8][8],
219 vector<float> ChiToPrimVtx);
220
221 // template<class T>
222 static void CombineTrackPart(vector<CbmKFTrack>& vTracks,
223 const vector<L1FieldRegion>& vField,
224 vector<CbmKFParticle>& Particles,
225 CbmKFParticle& part,
226 const int DaughterPDG,
227 const int MotherPDG,
228 vector<short>& id,
229 const float* cuts,
230 const unsigned short startIndex = 0,
231 const bool IsSamePart = 0);
232
233 static void SelectParticleCandidates(vector<CbmKFParticle>& Particles,
234 vector<CbmKFParticle>& vCandidates,
235 CbmKFVertex& PrimVtx,
236 const float cuts[5]);
237
238 // template<class T>
239 void ConstructPVT(vector<CbmKFTrack>& vRTracks);
240
241 // void ConstructPV(vector<CbmL1Track>& vRTracks);
242 // void ConstructPV(vector<CbmStsTrack>& vRTracks);
243
244 protected:
245 fvec& Cij(Int_t i, Int_t j) { return KFPart.C[(j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i]; }
246
247 public:
248 static Int_t IJ(Int_t i, Int_t j) { return (j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i; }
249
250 public:
252
253 private:
254 static const float DefaultCuts[2][3];
255};
256
257#endif /* !CbmKFParticleInterface_h */
const int fvecLen
Definition P4_F32vec4.h:233
int i
Definition P4_F32vec4.h:22
F32vec4 fvec
Definition P4_F32vec4.h:231
int Int_t
void Error(const char *location, const char *msgfmt,...)
void multQSQt(const fvec Q[], fvec S[])
const fvec * GetParameters() const
void MeasureMass(CbmKFParticle_simd *Particle, fvec r0[], fvec Mass)
void GetKFVertex(CbmKFVertex *vtx)
static void Find2DaughterDecay(vector< CbmKFTrack > &vTracks, const vector< L1FieldRegion > &vField, vector< CbmKFParticle > &Particles, const int DaughterNegPDG, const int DaughterPosPDG, const int MotherPDG, vector< short > &idNeg, vector< short > &idPos, CbmKFVertex &PrimVtx, const float *cuts=0, bool isPrimary=0, vector< float > *vMotherTopoChi2Ndf=0, const float *secCuts=0, const float massMotherPDG=0, const float massMotherPDGSigma=0, vector< CbmKFParticle > *vMotherPrim=0, vector< CbmKFParticle > *vMotherSec=0)
static void FindParticles(vector< CbmKFTrack > &vRTracks, vector< float > &ChiToPrimVtx, vector< L1FieldRegion > &vField, vector< CbmKFParticle > &Particles, CbmKFVertex &PrimVtx, const vector< int > &vTrackPDG, const float cuts[2][3]=DefaultCuts)
Find particles with 2-body decay channel from input tracks vRTracks with primary vertex PrimVtx:
void Construct(CbmKFTrackInterface *vDaughters[][fvecLen], int NDaughters, CbmKFVertexInterface *Parent=0, float Mass=-1, float CutChi2=-1)
fvec GetCovariance(Int_t i) const
static fvec GetChi2BetweenParticles(CbmKFParticle_simd &p1, CbmKFParticle_simd &p2)
fvec GetCovariance(Int_t i, Int_t j) const
fvec & Cij(Int_t i, Int_t j)
void SetField(const L1FieldRegion &field, bool isOneEntry=0, const int iVec=0)
fvec & rCovariance(Int_t i, Int_t j)
void SetVtxErrGuess(fvec &d_x, fvec &d_y, fvec &d_z)
void GetMomentum(fvec &P, fvec &Error)
static void SelectParticleCandidates(vector< CbmKFParticle > &Particles, vector< CbmKFParticle > &vCandidates, CbmKFVertex &PrimVtx, const float cuts[5])
static void FindTrackV0Decay(const int MotherPDG, vector< CbmKFParticle > &Particles, vector< CbmKFParticle > &vV0, vector< CbmKFTrack > &vTracks, const vector< L1FieldRegion > &field, const int DaughterPDG, vector< short > &idTrack, CbmKFVertex &PrimVtx, const float *cuts=0, bool isPrimary=0, vector< float > *ChiToPrimVtx=0, vector< CbmKFParticle > *vHyperonPrim=0, float hyperonPrimMass=0, float hyperonPrimMassErr=0, vector< CbmKFParticle > *vHyperonSec=0)
void GetKFParticle(CbmKFParticle &Part, int iPart=0)
fvec GetParameter(Int_t i) const
void multQSQt1(const fvec J[11], fvec S[])
static void FindHyperons(int PDG, CbmKFParticle_simd vDaughters[2], vector< int > &daughterIds, vector< CbmKFParticle > &vLambdaSec, vector< CbmKFParticle > &vHyperon, CbmKFVertex &PrimVtx, const float *cuts=0, int startIndex=0)
CbmKFParticleInterface operator=(const CbmKFParticleInterface &c)
void GetMass(fvec &M, fvec &Error)
void ExtrapolateLine(CbmKFParticle_simd *Particle, fvec r0[], fvec T)
static Int_t IJ(Int_t i, Int_t j)
static const float DefaultCuts[2][3]
void Construct(CbmKFParticle_simd vDaughters[], int NDaughters, CbmKFVertexInterface *Parent=0, float Mass=-1, float CutChi2=-1, bool isAtVtxGuess=0)
static void ExtrapolateToPV(vector< CbmKFParticle > &vParticles, CbmKFVertex &PrimVtx)
static void CombineTrackPart(vector< CbmKFTrack > &vTracks, const vector< L1FieldRegion > &vField, vector< CbmKFParticle > &Particles, CbmKFParticle &part, const int DaughterPDG, const int MotherPDG, vector< short > &id, const float *cuts, const unsigned short startIndex=0, const bool IsSamePart=0)
void Convert(CbmKFParticle_simd *Particle, fvec r0[], bool ToProduction)
void ConstructPVT(vector< CbmKFTrack > &vRTracks)
void MeasureProductionVertex(CbmKFParticle_simd *Particle, fvec r0[], CbmKFVertexInterface *Parent)
void SetVtxGuess(fvec &x, fvec &y, fvec &z)
fvec GetDStoPoint(const CbmKFParticle_simd &Particle, const fvec xyz[]) const
static void FindDMesLambdac(vector< CbmKFTrack > &vTracks, const vector< L1FieldRegion > &vField, vector< CbmKFParticle > &Particles, const int DaughterPDG[5], const int MotherPDG[8], vector< short > *idTrack[5], CbmKFVertex &PrimVtx, const float cuts[8][8], vector< float > ChiToPrimVtx)
void Extrapolate(CbmKFParticle_simd *Particle, fvec r0[], fvec T)