PandaRoot
KFParticle.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------
2 // The KFParticle class
3 // .
4 // @author S.Gorbunov, I.Kisel
5 // @version 1.0
6 // @since 13.05.07
7 //
8 // Class to reconstruct and store the decayed particle parameters.
9 // The method is described in CBM-SOFT note 2007-003,
10 // ``Reconstruction of decayed particles based on the Kalman filter'',
11 // http://www.gsi.de/documents/DOC-2007-May-14-1.pdf
12 //
13 // This class is ALICE interface to general mathematics in KFParticleBase
14 //
15 // -= Copyright &copy ALICE HLT and CBM L1 Groups =-
16 //_________________________________________________________________________________
17 
18 //#define NonhomogeneousField
19 #define HomogeneousField
20 
21 #ifndef ALIKFPARTICLE_H
22 #define ALIKFPARTICLE_H
23 
24 #include "KFParticleBase.h"
25 // #include "TMath.h"
26 #include <cmath>
27 
28 #ifdef HomogeneousField
29 class KFPTrack;
30 class KFPVertex;
31 #endif
32 
33 #ifdef NonhomogeneousField
34 class CbmKFTrackInterface;
35 class CbmKFVertexInterface;
36 #endif
37 
38 class KFParticle : public KFParticleBase {
39 
40  public:
41  //*
42  //* INITIALIZATION
43  //*
44 
45  //* Set magnetic field for all particles
46 #ifdef HomogeneousField
47  static void SetField(Double_t Bz);
48 #endif
49  //* Constructor (empty)
50 
52 
53  //* Destructor (empty)
54 
55  ~KFParticle() { ; }
56 
57  //* Construction of mother particle by its 2-3-4 daughters
58 
59  KFParticle(const KFParticle &d1, const KFParticle &d2, Bool_t gamma = false);
60 
61  KFParticle(const KFParticle &d1, const KFParticle &d2, const KFParticle &d3);
62 
63  KFParticle(const KFParticle &d1, const KFParticle &d2, const KFParticle &d3, const KFParticle &d4);
64 
65  //* Initialisation from "cartesian" coordinates ( X Y Z Px Py Pz )
66  //* Parameters, covariance matrix, charge and PID hypothesis should be provided
67 
68  void Create(const Double_t Param[], const Double_t Cov[], Int_t Charge, Double_t mass /*Int_t PID*/);
69 
70 #ifdef HomogeneousField
71  //* Initialisation from ALICE track, PID hypothesis shoould be provided
72 
73  KFParticle(const KFPTrack &track, Int_t PID);
74 
75  //* Initialisation from VVertex
76 
77  KFParticle(const KFPVertex &vertex);
78 #endif
79 
80 #ifdef NonhomogeneousField
81  KFParticle(CbmKFTrackInterface *Track, Double_t *z0 = 0, Int_t *qHypo = 0, Int_t *PID = 0);
82  KFParticle(CbmKFVertexInterface &vertex);
83 #endif
84 
85  void CleanDaughtersId() { fDaughtersIds.clear(); }
86  void SetNDaughters(int n) { fDaughtersIds.reserve(n); }
87  void AddDaughter(int id) { fDaughtersIds.push_back(id); }
88 
89  //* Initialise covariance matrix and set current parameters to 0.0
90 
91  void Initialize();
92 
93  //* Set decay vertex parameters for linearisation
94 
95  void SetVtxGuess(Double_t x, Double_t y, Double_t z);
96 
97  //*
98  //* ACCESSORS
99  //*
100 
101  //* Simple accessors
102 
103  Double_t GetX() const; //* x of current position
104  Double_t GetY() const; //* y of current position
105  Double_t GetZ() const; //* z of current position
106  Double_t GetPx() const; //* x-compoment of 3-momentum
107  Double_t GetPy() const; //* y-compoment of 3-momentum
108  Double_t GetPz() const; //* z-compoment of 3-momentum
109  Double_t GetE() const; //* energy
110  Double_t GetS() const; //* decay length / momentum
111  Int_t GetQ() const; //* charge
112  Double_t GetChi2() const; //* chi^2
113  Int_t GetNDF() const; //* Number of Degrees of Freedom
114 
115  Bool_t GetAtProductionVertex() const { return fAtProductionVertex; }
117 
118 #ifdef NonhomogeneousField
119  float *GetFieldCoeff() { return fieldRegion; }
120  void SetFieldCoeff(float c, int i) { fieldRegion[i] = c; }
121 #endif
122 
123  const Double_t &X() const { return fP[0]; }
124  const Double_t &Y() const { return fP[1]; }
125  const Double_t &Z() const { return fP[2]; }
126  const Double_t &Px() const { return fP[3]; }
127  const Double_t &Py() const { return fP[4]; }
128  const Double_t &Pz() const { return fP[5]; }
129  const Double_t &E() const { return fP[6]; }
130  const Double_t &S() const { return fP[7]; }
131  const Int_t &Q() const { return fQ; }
132  const Double_t &Chi2() const { return fChi2; }
133  const Int_t &NDF() const { return fNDF; }
134 
135  Double_t GetParameter(int i) const;
136  Double_t GetCovariance(int i) const;
137  Double_t GetCovariance(int i, int j) const;
138 
139  //* Accessors with calculations, value returned w/o error flag
140 
141  Double_t GetP() const; //* momentum
142  Double_t GetPt() const; //* transverse momentum
143  Double_t GetEta() const; //* pseudorapidity
144  Double_t GetPhi() const; //* phi
145  Double_t GetMomentum() const; //* momentum (same as GetP() )
146  Double_t GetMass() const; //* mass
147  Double_t GetDecayLength() const; //* decay length
148  Double_t GetDecayLengthXY() const; //* decay length in XY
149  Double_t GetLifeTime() const; //* life time
150  Double_t GetR() const; //* distance to the origin
151 
152  //* Accessors to estimated errors
153 
154  Double_t GetErrX() const; //* x of current position
155  Double_t GetErrY() const; //* y of current position
156  Double_t GetErrZ() const; //* z of current position
157  Double_t GetErrPx() const; //* x-compoment of 3-momentum
158  Double_t GetErrPy() const; //* y-compoment of 3-momentum
159  Double_t GetErrPz() const; //* z-compoment of 3-momentum
160  Double_t GetErrE() const; //* energy
161  Double_t GetErrS() const; //* decay length / momentum
162  Double_t GetErrP() const; //* momentum
163  Double_t GetErrPt() const; //* transverse momentum
164  Double_t GetErrEta() const; //* pseudorapidity
165  Double_t GetErrPhi() const; //* phi
166  Double_t GetErrMomentum() const; //* momentum
167  Double_t GetErrMass() const; //* mass
168  Double_t GetErrDecayLength() const; //* decay length
169  Double_t GetErrDecayLengthXY() const; //* decay length in XY
170  Double_t GetErrLifeTime() const; //* life time
171  Double_t GetErrR() const; //* distance to the origin
172 
173  //* Accessors with calculations( &value, &estimated sigma )
174  //* error flag returned (0 means no error during calculations)
175 
176  int GetP(Double_t &P, Double_t &SigmaP) const; //* momentum
177  int GetPt(Double_t &Pt, Double_t &SigmaPt) const; //* transverse momentum
178  int GetEta(Double_t &Eta, Double_t &SigmaEta) const; //* pseudorapidity
179  int GetPhi(Double_t &Phi, Double_t &SigmaPhi) const; //* phi
180  int GetMomentum(Double_t &P, Double_t &SigmaP) const; //* momentum
181  int GetMass(Double_t &M, Double_t &SigmaM) const; //* mass
182  int GetDecayLength(Double_t &L, Double_t &SigmaL) const; //* decay length
183  int GetDecayLengthXY(Double_t &L, Double_t &SigmaL) const; //* decay length in XY
184  int GetLifeTime(Double_t &T, Double_t &SigmaT) const; //* life time
185  int GetR(Double_t &R, Double_t &SigmaR) const; //* R
186  Double_t GetRapidity() const { return 0.5 * log((fP[6] + fP[5]) / (fP[6] - fP[5])); }
187  Double_t GetTheta() const { return atan2(GetPt(), fP[5]); }
188 
189  //*
190  //* MODIFIERS
191  //*
192 
193  Double_t &X();
194  Double_t &Y();
195  Double_t &Z();
196  Double_t &Px();
197  Double_t &Py();
198  Double_t &Pz();
199  Double_t &E();
200  Double_t &S();
201  Int_t &Q();
202  Double_t &Chi2();
203  Int_t &NDF();
204 
205  Double_t &Parameter(int i);
206  Double_t &Covariance(int i);
207  Double_t &Covariance(int i, int j);
208  Double_t *Parameters();
209  Double_t *CovarianceMatrix();
210 
211  //*
212  //* CONSTRUCTION OF THE PARTICLE BY ITS DAUGHTERS AND MOTHER
213  //* USING THE KALMAN FILTER METHOD
214  //*
215 
216  //* Add daughter to the particle
217 
218  void AddDaughter(const KFParticle &Daughter);
219 
220  //* Add daughter via += operator: ex.{ D0; D0+=Pion; D0+= Kaon; }
221 
222  void operator+=(const KFParticle &Daughter);
223 
224  //* Set production vertex
225 
226  void SetProductionVertex(const KFParticle &Vtx);
227 
228  //* Set mass constraint
229 
230  void SetMassConstraint(Double_t Mass, Double_t SigmaMass = 0);
231 
232  //* Set no decay length for resonances
233 
234  void SetNoDecayLength();
235 
236  //* Everything in one go
237 
238  void Construct(const KFParticle *vDaughters[], int nDaughters, const KFParticle *ProdVtx = nullptr, Double_t Mass = -1, Bool_t IsConstrained = 0);
239 
240  //*
241  //* TRANSPORT
242  //*
243  //* ( main transportation parameter is S = SignedPath/Momentum )
244  //* ( parameters of decay & production vertices are stored locally )
245  //*
246 
247  //* Transport the particle to its decay vertex
248 
249  void TransportToDecayVertex();
250 
251  //* Transport the particle to its production vertex
252 
254 
255  //* Transport the particle close to xyz[] point
256 
257  void TransportToPoint(const Double_t xyz[]);
258 
259  //* Transport the particle close to VVertex
260 #ifdef HomogeneousField
261  void TransportToVertex(const KFPVertex &v);
262 #endif
263  //* Transport the particle close to another particle p
264 
265  void TransportToParticle(const KFParticle &p);
266 
267  //* Transport the particle on dS parameter (SignedPath/Momentum)
268 
269  void TransportToDS(Double_t dS);
270 
271  //* Get dS to a certain space point
272 
273  Double_t GetDStoPoint(const Double_t xyz[]) const;
274 
275  //* Get dS to other particle p (dSp for particle p also returned)
276 
277  void GetDStoParticle(const KFParticle &p, Double_t &DS, Double_t &DSp) const;
278 
279  //* Get dS to other particle p in XY-plane
280 
281  void GetDStoParticleXY(const KFParticleBase &p, Double_t &DS, Double_t &DSp) const;
282 
283  //*
284  //* OTHER UTILITIES
285  //*
286 
287  //* Calculate distance from another object [cm]
288 
289  Double_t GetDistanceFromVertex(const Double_t vtx[]) const;
290  Double_t GetDistanceFromVertex(const KFParticle &Vtx) const;
291 #ifdef HomogeneousField
292  Double_t GetDistanceFromVertex(const KFPVertex &Vtx) const;
293 #endif
294  Double_t GetDistanceFromParticle(const KFParticle &p) const;
295 
296  //* Calculate sqrt(Chi2/ndf) deviation from another object
297  //* ( v = [xyz]-vertex, Cv=[Cxx,Cxy,Cyy,Cxz,Cyz,Czz]-covariance matrix )
298 
299  Double_t GetDeviationFromVertex(const Double_t v[], const Double_t Cv[] = 0) const;
300  Double_t GetDeviationFromVertex(const KFParticle &Vtx) const;
301 #ifdef HomogeneousField
302  Double_t GetDeviationFromVertex(const KFPVertex &Vtx) const;
303 #endif
304  Double_t GetDeviationFromParticle(const KFParticle &p) const;
305 
306  //* Calculate distance from another object [cm] in XY-plane
307 
308  Bool_t GetDistanceFromVertexXY(const Double_t vtx[], Double_t &val, Double_t &err) const;
309  Bool_t GetDistanceFromVertexXY(const Double_t vtx[], const Double_t Cv[], Double_t &val, Double_t &err) const;
310  Bool_t GetDistanceFromVertexXY(const KFParticle &Vtx, Double_t &val, Double_t &err) const;
311 #ifdef HomogeneousField
312  Bool_t GetDistanceFromVertexXY(const KFPVertex &Vtx, Double_t &val, Double_t &err) const;
313 #endif
314 
315  Double_t GetDistanceFromVertexXY(const Double_t vtx[]) const;
316  Double_t GetDistanceFromVertexXY(const KFParticle &Vtx) const;
317 #ifdef HomogeneousField
318  Double_t GetDistanceFromVertexXY(const KFPVertex &Vtx) const;
319 #endif
320  Double_t GetDistanceFromParticleXY(const KFParticle &p) const;
321 
322  //* Calculate sqrt(Chi2/ndf) deviation from another object in XY plane
323  //* ( v = [xyz]-vertex, Cv=[Cxx,Cxy,Cyy,Cxz,Cyz,Czz]-covariance matrix )
324 
325  Double_t GetDeviationFromVertexXY(const Double_t v[], const Double_t Cv[] = 0) const;
326  Double_t GetDeviationFromVertexXY(const KFParticle &Vtx) const;
327 #ifdef HomogeneousField
328  Double_t GetDeviationFromVertexXY(const KFPVertex &Vtx) const;
329 #endif
330  Double_t GetDeviationFromParticleXY(const KFParticle &p) const;
331 
332  //* Calculate opennig angle between two particles
333 
334  Double_t GetAngle(const KFParticle &p) const;
335  Double_t GetAngleXY(const KFParticle &p) const;
336  Double_t GetAngleRZ(const KFParticle &p) const;
337 
338  //* Subtract the particle from the vertex
339 
340  void SubtractFromVertex(KFParticle &v) const;
341 
342  //* Special method for creating gammas
343 
344  void ConstructGamma(const KFParticle &daughter1, const KFParticle &daughter2);
345 
346  // * Pseudo Proper Time of decay = (r*pt) / |pt| * M/|pt|
347  // @primVertex - primary vertex
348  // @mass - mass of the mother particle (in the case of "Hb -> JPsi" it would be JPsi mass)
349  // @*timeErr2 - squared error of the decay time. If timeErr2 = 0 it isn't calculated
350  Double_t GetPseudoProperDecayTime(const KFParticle &primVertex, const Double_t &mass, Double_t *timeErr2 = 0) const;
351 
352  void GetFieldValue(const Double_t xyz[], Double_t B[]) const;
353 
354  protected:
355  //*
356  //* INTERNAL STUFF
357  //*
358 
359  //* Method to access ALICE field
360 #ifdef HomogeneousField
361  static Double_t GetFieldAlice();
362 #endif
363  //* Other methods required by the abstract KFParticleBase class
364 
365  void GetDStoParticle(const KFParticleBase &p, Double_t &DS, Double_t &DSp) const;
366  void Transport(Double_t dS, Double_t P[], Double_t C[]) const;
367  static void GetExternalTrackParam(const KFParticleBase &p, Double_t &X, Double_t &Alpha, Double_t P[5]);
368 
369  // void GetDStoParticleALICE( const KFParticleBase &p, Double_t &DS, Double_t &DS1 ) const;
370 
371  private:
372 #ifdef HomogeneousField
373  static Double_t fgBz; //* Bz compoment of the magnetic field
374 #endif
375 #ifdef NonhomogeneousField
376  float fieldRegion[10];
377 #endif
378 
379  // ClassDef( KFParticle, 1 );
380 };
381 
382 //---------------------------------------------------------------------
383 //
384 // Inline implementation of the KFParticle methods
385 //
386 //---------------------------------------------------------------------
387 
388 #ifdef HomogeneousField
389 inline void KFParticle::SetField(Double_t Bz)
390 {
391  fgBz = Bz;
392 }
393 #endif
394 
395 inline KFParticle::KFParticle(const KFParticle &d1, const KFParticle &d2, const KFParticle &d3)
396 {
397  KFParticle mother;
398  mother += d1;
399  mother += d2;
400  mother += d3;
401  *this = mother;
402 }
403 
404 inline KFParticle::KFParticle(const KFParticle &d1, const KFParticle &d2, const KFParticle &d3, const KFParticle &d4)
405 {
406  KFParticle mother;
407  mother += d1;
408  mother += d2;
409  mother += d3;
410  mother += d4;
411  *this = mother;
412 }
413 
415 {
417 }
418 
419 inline void KFParticle::SetVtxGuess(Double_t x, Double_t y, Double_t z)
420 {
422 }
423 
424 inline Double_t KFParticle::GetX() const
425 {
426  return KFParticleBase::GetX();
427 }
428 
429 inline Double_t KFParticle::GetY() const
430 {
431  return KFParticleBase::GetY();
432 }
433 
434 inline Double_t KFParticle::GetZ() const
435 {
436  return KFParticleBase::GetZ();
437 }
438 
439 inline Double_t KFParticle::GetPx() const
440 {
441  return KFParticleBase::GetPx();
442 }
443 
444 inline Double_t KFParticle::GetPy() const
445 {
446  return KFParticleBase::GetPy();
447 }
448 
449 inline Double_t KFParticle::GetPz() const
450 {
451  return KFParticleBase::GetPz();
452 }
453 
454 inline Double_t KFParticle::GetE() const
455 {
456  return KFParticleBase::GetE();
457 }
458 
459 inline Double_t KFParticle::GetS() const
460 {
461  return KFParticleBase::GetS();
462 }
463 
464 inline Int_t KFParticle::GetQ() const
465 {
466  return KFParticleBase::GetQ();
467 }
468 
469 inline Double_t KFParticle::GetChi2() const
470 {
471  return KFParticleBase::GetChi2();
472 }
473 
474 inline Int_t KFParticle::GetNDF() const
475 {
476  return KFParticleBase::GetNDF();
477 }
478 
479 inline Double_t KFParticle::GetParameter(int i) const
480 {
482 }
483 
484 inline Double_t KFParticle::GetCovariance(int i) const
485 {
487 }
488 
489 inline Double_t KFParticle::GetCovariance(int i, int j) const
490 {
491  return KFParticleBase::GetCovariance(i, j);
492 }
493 
494 inline Double_t KFParticle::GetP() const
495 {
496  Double_t par, err;
497  if (KFParticleBase::GetMomentum(par, err))
498  return 0;
499  else
500  return par;
501 }
502 
503 inline Double_t KFParticle::GetPt() const
504 {
505  Double_t par, err;
506  if (KFParticleBase::GetPt(par, err))
507  return 0;
508  else
509  return par;
510 }
511 
512 inline Double_t KFParticle::GetEta() const
513 {
514  Double_t par, err;
515  if (KFParticleBase::GetEta(par, err))
516  return 0;
517  else
518  return par;
519 }
520 
521 inline Double_t KFParticle::GetPhi() const
522 {
523  Double_t par, err;
524  if (KFParticleBase::GetPhi(par, err))
525  return 0;
526  else
527  return par;
528 }
529 
530 inline Double_t KFParticle::GetMomentum() const
531 {
532  Double_t par, err;
533  if (KFParticleBase::GetMomentum(par, err))
534  return 0;
535  else
536  return par;
537 }
538 
539 inline Double_t KFParticle::GetMass() const
540 {
541  Double_t par, err;
542  if (KFParticleBase::GetMass(par, err))
543  return 0;
544  else
545  return par;
546 }
547 
548 inline Double_t KFParticle::GetDecayLength() const
549 {
550  Double_t par, err;
551  if (KFParticleBase::GetDecayLength(par, err))
552  return 0;
553  else
554  return par;
555 }
556 
557 inline Double_t KFParticle::GetDecayLengthXY() const
558 {
559  Double_t par, err;
560  if (KFParticleBase::GetDecayLengthXY(par, err))
561  return 0;
562  else
563  return par;
564 }
565 
566 inline Double_t KFParticle::GetLifeTime() const
567 {
568  Double_t par, err;
569  if (KFParticleBase::GetLifeTime(par, err))
570  return 0;
571  else
572  return par;
573 }
574 
575 inline Double_t KFParticle::GetR() const
576 {
577  Double_t par, err;
578  if (KFParticleBase::GetR(par, err))
579  return 0;
580  else
581  return par;
582 }
583 
584 inline Double_t KFParticle::GetErrX() const
585 {
586  return sqrt(fabs(GetCovariance(0, 0)));
587 }
588 
589 inline Double_t KFParticle::GetErrY() const
590 {
591  return sqrt(fabs(GetCovariance(1, 1)));
592 }
593 
594 inline Double_t KFParticle::GetErrZ() const
595 {
596  return sqrt(fabs(GetCovariance(2, 2)));
597 }
598 
599 inline Double_t KFParticle::GetErrPx() const
600 {
601  return sqrt(fabs(GetCovariance(3, 3)));
602 }
603 
604 inline Double_t KFParticle::GetErrPy() const
605 {
606  return sqrt(fabs(GetCovariance(4, 4)));
607 }
608 
609 inline Double_t KFParticle::GetErrPz() const
610 {
611  return sqrt(fabs(GetCovariance(5, 5)));
612 }
613 
614 inline Double_t KFParticle::GetErrE() const
615 {
616  return sqrt(fabs(GetCovariance(6, 6)));
617 }
618 
619 inline Double_t KFParticle::GetErrS() const
620 {
621  return sqrt(fabs(GetCovariance(7, 7)));
622 }
623 
624 inline Double_t KFParticle::GetErrP() const
625 {
626  Double_t par, err;
627  if (KFParticleBase::GetMomentum(par, err))
628  return 1.e10;
629  else
630  return err;
631 }
632 
633 inline Double_t KFParticle::GetErrPt() const
634 {
635  Double_t par, err;
636  if (KFParticleBase::GetPt(par, err))
637  return 1.e10;
638  else
639  return err;
640 }
641 
642 inline Double_t KFParticle::GetErrEta() const
643 {
644  Double_t par, err;
645  if (KFParticleBase::GetEta(par, err))
646  return 1.e10;
647  else
648  return err;
649 }
650 
651 inline Double_t KFParticle::GetErrPhi() const
652 {
653  Double_t par, err;
654  if (KFParticleBase::GetPhi(par, err))
655  return 1.e10;
656  else
657  return err;
658 }
659 
660 inline Double_t KFParticle::GetErrMomentum() const
661 {
662  Double_t par, err;
663  if (KFParticleBase::GetMomentum(par, err))
664  return 1.e10;
665  else
666  return err;
667 }
668 
669 inline Double_t KFParticle::GetErrMass() const
670 {
671  Double_t par, err;
672  if (KFParticleBase::GetMass(par, err))
673  return 1.e10;
674  else
675  return err;
676 }
677 
678 inline Double_t KFParticle::GetErrDecayLength() const
679 {
680  Double_t par, err;
681  if (KFParticleBase::GetDecayLength(par, err))
682  return 1.e10;
683  else
684  return err;
685 }
686 
687 inline Double_t KFParticle::GetErrDecayLengthXY() const
688 {
689  Double_t par, err;
690  if (KFParticleBase::GetDecayLengthXY(par, err))
691  return 1.e10;
692  else
693  return err;
694 }
695 
696 inline Double_t KFParticle::GetErrLifeTime() const
697 {
698  Double_t par, err;
699  if (KFParticleBase::GetLifeTime(par, err))
700  return 1.e10;
701  else
702  return err;
703 }
704 
705 inline Double_t KFParticle::GetErrR() const
706 {
707  Double_t par, err;
708  if (KFParticleBase::GetR(par, err))
709  return 1.e10;
710  else
711  return err;
712 }
713 
714 inline int KFParticle::GetP(Double_t &P, Double_t &SigmaP) const
715 {
716  return KFParticleBase::GetMomentum(P, SigmaP);
717 }
718 
719 inline int KFParticle::GetPt(Double_t &Pt, Double_t &SigmaPt) const
720 {
721  return KFParticleBase::GetPt(Pt, SigmaPt);
722 }
723 
724 inline int KFParticle::GetEta(Double_t &Eta, Double_t &SigmaEta) const
725 {
726  return KFParticleBase::GetEta(Eta, SigmaEta);
727 }
728 
729 inline int KFParticle::GetPhi(Double_t &Phi, Double_t &SigmaPhi) const
730 {
731  return KFParticleBase::GetPhi(Phi, SigmaPhi);
732 }
733 
734 inline int KFParticle::GetMomentum(Double_t &P, Double_t &SigmaP) const
735 {
736  return KFParticleBase::GetMomentum(P, SigmaP);
737 }
738 
739 inline int KFParticle::GetMass(Double_t &M, Double_t &SigmaM) const
740 {
741  return KFParticleBase::GetMass(M, SigmaM);
742 }
743 
744 inline int KFParticle::GetDecayLength(Double_t &L, Double_t &SigmaL) const
745 {
746  return KFParticleBase::GetDecayLength(L, SigmaL);
747 }
748 
749 inline int KFParticle::GetDecayLengthXY(Double_t &L, Double_t &SigmaL) const
750 {
751  return KFParticleBase::GetDecayLengthXY(L, SigmaL);
752 }
753 
754 inline int KFParticle::GetLifeTime(Double_t &T, Double_t &SigmaT) const
755 {
756  return KFParticleBase::GetLifeTime(T, SigmaT);
757 }
758 
759 inline int KFParticle::GetR(Double_t &R, Double_t &SigmaR) const
760 {
761  return KFParticleBase::GetR(R, SigmaR);
762 }
763 
764 inline Double_t &KFParticle::X()
765 {
766  return KFParticleBase::X();
767 }
768 
769 inline Double_t &KFParticle::Y()
770 {
771  return KFParticleBase::Y();
772 }
773 
774 inline Double_t &KFParticle::Z()
775 {
776  return KFParticleBase::Z();
777 }
778 
779 inline Double_t &KFParticle::Px()
780 {
781  return KFParticleBase::Px();
782 }
783 
784 inline Double_t &KFParticle::Py()
785 {
786  return KFParticleBase::Py();
787 }
788 
789 inline Double_t &KFParticle::Pz()
790 {
791  return KFParticleBase::Pz();
792 }
793 
794 inline Double_t &KFParticle::E()
795 {
796  return KFParticleBase::E();
797 }
798 
799 inline Double_t &KFParticle::S()
800 {
801  return KFParticleBase::S();
802 }
803 
804 inline Int_t &KFParticle::Q()
805 {
806  return KFParticleBase::Q();
807 }
808 
809 inline Double_t &KFParticle::Chi2()
810 {
811  return KFParticleBase::Chi2();
812 }
813 
814 inline Int_t &KFParticle::NDF()
815 {
816  return KFParticleBase::NDF();
817 }
818 
819 inline Double_t &KFParticle::Parameter(int i)
820 {
821  return KFParticleBase::Parameter(i);
822 }
823 
824 inline Double_t &KFParticle::Covariance(int i)
825 {
826  return KFParticleBase::Covariance(i);
827 }
828 
829 inline Double_t &KFParticle::Covariance(int i, int j)
830 {
831  return KFParticleBase::Covariance(i, j);
832 }
833 
834 inline Double_t *KFParticle::Parameters()
835 {
836  return fP;
837 }
838 
840 {
841  return fC;
842 }
843 
844 inline void KFParticle::operator+=(const KFParticle &Daughter)
845 {
846  KFParticleBase::operator+=(Daughter);
847 }
848 
849 inline void KFParticle::AddDaughter(const KFParticle &Daughter)
850 {
851  KFParticleBase::AddDaughter(Daughter);
852 }
853 
855 {
857 }
858 
859 inline void KFParticle::SetMassConstraint(Double_t Mass, Double_t SigmaMass)
860 {
861  KFParticleBase::SetMassConstraint(Mass, SigmaMass);
862 }
863 
865 {
867 }
868 
869 inline void KFParticle::Construct(const KFParticle *vDaughters[], int nDaughters, const KFParticle *ProdVtx, Double_t Mass, Bool_t IsConstrained)
870 {
871  KFParticleBase::Construct((const KFParticleBase **)vDaughters, nDaughters, (const KFParticleBase *)ProdVtx, Mass, IsConstrained);
872 }
873 
875 {
877 }
878 
880 {
882 }
883 
884 inline void KFParticle::TransportToPoint(const Double_t xyz[])
885 {
887 }
888 #ifdef HomogeneousField
890 {
892 }
893 #endif
895 {
896  Double_t dS, dSp;
897  GetDStoParticle(p, dS, dSp);
898  TransportToDS(dS);
899 }
900 
901 inline void KFParticle::TransportToDS(Double_t dS)
902 {
904 }
905 
906 inline Double_t KFParticle::GetDStoPoint(const Double_t xyz[]) const
907 {
908 #ifdef HomogeneousField
910 #endif
911 #ifdef NonhomogeneousField
913 #endif
914 }
915 
916 inline void KFParticle::GetDStoParticle(const KFParticle &p, Double_t &DS, Double_t &DSp) const
917 {
918  GetDStoParticleXY(p, DS, DSp);
919 }
920 
921 inline Double_t KFParticle::GetDistanceFromVertex(const Double_t vtx[]) const
922 {
924 }
925 
926 inline Double_t KFParticle::GetDeviationFromVertex(const Double_t v[], const Double_t Cv[]) const
927 {
929 }
930 
931 inline Double_t KFParticle::GetDistanceFromVertex(const KFParticle &Vtx) const
932 {
934 }
935 
936 inline Double_t KFParticle::GetDeviationFromVertex(const KFParticle &Vtx) const
937 {
939 }
940 #ifdef HomogeneousField
941 inline Double_t KFParticle::GetDistanceFromVertex(const KFPVertex &Vtx) const
942 {
943  return GetDistanceFromVertex(KFParticle(Vtx));
944 }
945 
946 inline Double_t KFParticle::GetDeviationFromVertex(const KFPVertex &Vtx) const
947 {
948  return GetDeviationFromVertex(KFParticle(Vtx));
949 }
950 #endif
951 inline Double_t KFParticle::GetDistanceFromParticle(const KFParticle &p) const
952 {
954 }
955 
956 inline Double_t KFParticle::GetDeviationFromParticle(const KFParticle &p) const
957 {
959 }
960 
962 {
964 }
965 
966 #ifdef HomogeneousField
967 inline Double_t KFParticle::GetFieldAlice()
968 {
969  return fgBz;
970 }
971 #endif
972 
973 #ifdef HomogeneousField
974 inline void KFParticle::GetFieldValue(const Double_t * /*xyz*/, Double_t B[]) const
975 {
976  B[0] = B[1] = 0;
977  B[2] = GetFieldAlice();
978 }
979 #endif
980 
981 #ifdef NonhomogeneousField
982 inline void KFParticle::GetFieldValue(const Double_t xyz[], Double_t B[]) const
983 {
984  // FairField *MF = CbmKF::Instance()->GetMagneticField();
985  // MF->GetFieldValue( xyz, B );
986 }
987 #endif
988 
989 inline void KFParticle::GetDStoParticle(const KFParticleBase &p, Double_t &DS, Double_t &DSp) const
990 {
991  GetDStoParticleXY(p, DS, DSp);
992 }
993 
994 inline void KFParticle::GetDStoParticleXY(const KFParticleBase &p, Double_t &DS, Double_t &DSp) const
995 {
996 #ifdef HomogeneousField
998 #endif
999 #ifdef NonhomogeneousField
1001 #endif
1002  // GetDStoParticleALICE( p, DS, DSp ) ;
1003 }
1004 
1005 inline void KFParticle::Transport(Double_t dS, Double_t P[], Double_t C[]) const
1006 {
1007 #ifdef HomogeneousField
1009 #endif
1010 #ifdef NonhomogeneousField
1011  KFParticleBase::TransportCBM(dS, P, C);
1012 #endif
1013 }
1014 
1015 inline void KFParticle::ConstructGamma(const KFParticle &daughter1, const KFParticle &daughter2)
1016 {
1017 #ifdef HomogeneousField
1018  KFParticleBase::ConstructGammaBz(daughter1, daughter2, GetFieldAlice());
1019 #endif
1020 }
1021 
1022 #endif
Double_t GetPy() const
void GetDStoParticleXY(const KFParticleBase &p, Double_t &DS, Double_t &DSp) const
Definition: KFParticle.h:994
Double_t GetDistanceFromVertex(const Double_t vtx[]) const
static Double_t GetFieldAlice()
Definition: KFParticle.h:967
void SetNoDecayLength()
Definition: KFParticle.h:864
Double_t GetZ() const
Double_t GetDistanceFromParticle(const KFParticle &p) const
Definition: KFParticle.h:951
Double_t GetDecayLength() const
Definition: KFParticle.h:548
Double_t GetMomentum() const
Definition: KFParticle.h:530
void TransportToProductionVertex()
Double_t GetPseudoProperDecayTime(const KFParticle &primVertex, const Double_t &mass, Double_t *timeErr2=0) const
void TransportToDecayVertex()
Double_t GetErrPx() const
Definition: KFParticle.h:599
void SetMassConstraint(Double_t Mass, Double_t SigmaMass=0)
Definition: KFParticle.h:859
void SetProductionVertex(const KFParticle &Vtx)
Definition: KFParticle.h:854
const Int_t & NDF() const
Definition: KFParticle.h:133
Double_t GetChi2() const
Definition: KFParticle.h:469
Double_t GetDecayLengthXY() const
Definition: KFParticle.h:557
Int_t GetQ() const
Double_t GetDeviationFromVertex(const Double_t v[], const Double_t Cv[]=0) const
Definition: KFParticle.h:926
Double_t GetPhi() const
Definition: KFParticle.h:521
Double_t GetPx() const
Double_t GetErrPhi() const
Definition: KFParticle.h:651
Int_t GetMomentum(Double_t &P, Double_t &SigmaP) const
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
Double_t GetPz() const
Double_t fP[8]
void TransportCBM(Double_t dS, Double_t P[], Double_t C[]) const
Double_t GetE() const
Definition: KFParticle.h:454
Double_t GetErrPz() const
Definition: KFParticle.h:609
Int_t GetPhi(Double_t &Phi, Double_t &SigmaPhi) const
const Int_t & Q() const
void ConstructGamma(const KFParticle &daughter1, const KFParticle &daughter2)
Definition: KFParticle.h:1015
Double_t GetDStoPointBz(Double_t Bz, const Double_t xyz[]) const
const Double_t & Pz() const
void SetVtxGuess(Double_t x, Double_t y, Double_t z)
Definition: KFParticle.h:419
void GetDStoParticleCBM(const KFParticleBase &p, Double_t &dS, Double_t &dS1) const
Double_t * CovarianceMatrix()
Definition: KFParticle.h:839
Int_t GetMass(Double_t &M, Double_t &SigmaM) const
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:117
Double_t GetY() const
Double_t GetPx() const
Definition: KFParticle.h:439
const Double_t & Chi2() const
Definition: KFParticle.h:132
const Double_t & Z() const
Definition: KFParticle.h:125
const Double_t & Py() const
void Transport(Double_t dS, Double_t P[], Double_t C[]) const
Definition: KFParticle.h:1005
void Initialize()
Definition: KFParticle.h:414
Double_t GetMass() const
Definition: KFParticle.h:539
Double_t GetAngle(const KFParticle &p) const
Double_t GetZ() const
Definition: KFParticle.h:434
void SubtractFromVertex(KFParticleBase &Vtx) const
Double_t & Covariance(int i)
Definition: KFParticle.h:824
Double_t GetY() const
Definition: KFParticle.h:429
Double_t GetErrLifeTime() const
Definition: KFParticle.h:696
void SetVtxGuess(Double_t x, Double_t y, Double_t z)
Double_t GetParameter(Int_t i) const
const Double_t & S() const
Definition: KFParticle.h:130
void operator+=(const KFParticleBase &Daughter)
const Double_t & Chi2() const
Double_t * Parameters()
Definition: KFParticle.h:834
const Double_t & X() const
Definition: KFParticle.h:123
Double_t GetDStoPoint(const Double_t xyz[]) const
Definition: KFParticle.h:906
Double_t GetCovariance(int i) const
Definition: KFParticle.h:484
const Double_t & Y() const
__m128 v
Definition: P4_F32vec4.h:3
unsigned int i
Definition: P4_F32vec4.h:21
Double_t GetErrEta() const
Definition: KFParticle.h:642
Int_t GetNDF() const
void TransportToPoint(const Double_t xyz[])
Definition: KFParticle.h:884
Double_t GetP() const
Definition: KFParticle.h:494
void SetNoDecayLength()
const Double_t & Y() const
Definition: KFParticle.h:124
Bool_t GetAtProductionVertex() const
Definition: KFParticle.h:115
Double_t GetX() const
Definition: KFParticle.h:424
Double_t GetErrMomentum() const
Definition: KFParticle.h:660
Double_t GetEta() const
Definition: KFParticle.h:512
void TransportToProductionVertex()
Definition: KFParticle.h:879
Int_t GetEta(Double_t &Eta, Double_t &SigmaEta) const
Int_t GetPt(Double_t &Pt, Double_t &SigmaPt) const
void SetProductionVertex(const KFParticleBase &Vtx)
Double_t GetTheta() const
Definition: KFParticle.h:187
Int_t GetQ() const
Definition: KFParticle.h:464
Double_t GetErrS() const
Definition: KFParticle.h:619
Double_t GetErrY() const
Definition: KFParticle.h:589
void GetDStoParticleBz(Double_t Bz, const KFParticleBase &p, Double_t &dS, Double_t &dS1) const
Double_t GetErrE() const
Definition: KFParticle.h:614
void SetMassConstraint(Double_t Mass, Double_t SigmaMass=0)
Int_t GetDecayLengthXY(Double_t &L, Double_t &SigmaL) const
void TransportToDS(Double_t dS)
Definition: KFParticle.h:901
void SubtractFromVertex(KFParticle &v) const
Definition: KFParticle.h:961
Double_t GetErrMass() const
Definition: KFParticle.h:669
Double_t GetErrR() const
Definition: KFParticle.h:705
Double_t GetAngleXY(const KFParticle &p) const
const Int_t & NDF() const
const Double_t & Pz() const
Definition: KFParticle.h:128
const Int_t & Q() const
Definition: KFParticle.h:131
void SetAtProductionVertex(Bool_t b)
Definition: KFParticle.h:116
void SetNDaughters(int n)
Definition: KFParticle.h:86
Double_t GetPy() const
Definition: KFParticle.h:444
Double_t GetDeviationFromVertex(const Double_t v[], const Double_t Cv[]=0) const
Double_t GetDeviationFromParticleXY(const KFParticle &p) const
Double_t fC[36]
const Double_t & Py() const
Definition: KFParticle.h:127
Double_t GetErrZ() const
Definition: KFParticle.h:594
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:46
Int_t GetNDF() const
Definition: KFParticle.h:474
Double_t GetCovariance(Int_t i) const
Int_t GetR(Double_t &R, Double_t &SigmaR) const
Double_t GetDeviationFromParticle(const KFParticle &p) const
Definition: KFParticle.h:956
Double_t GetChi2() const
void TransportToDecayVertex()
Definition: KFParticle.h:874
const Double_t & Px() const
Double_t GetDStoPointCBM(const Double_t xyz[]) const
Double_t GetParameter(int i) const
Definition: KFParticle.h:479
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: P4_F32vec4.h:124
const Double_t & E() const
Definition: KFParticle.h:129
Double_t GetPz() const
Definition: KFParticle.h:449
Double_t GetErrDecayLengthXY() const
Definition: KFParticle.h:687
Double_t GetX() const
void TransportToVertex(const KFPVertex &v)
Definition: KFParticle.h:889
Double_t GetErrPt() const
Definition: KFParticle.h:633
Double_t GetRapidity() const
Definition: KFParticle.h:186
Double_t GetDistanceFromVertex(const Double_t vtx[]) const
Definition: KFParticle.h:921
Double_t GetDistanceFromParticleXY(const KFParticle &p) const
Bool_t GetDistanceFromVertexXY(const Double_t vtx[], Double_t &val, Double_t &err) const
Double_t GetE() const
void Construct(const KFParticleBase *vDaughters[], Int_t nDaughters, const KFParticleBase *ProdVtx=nullptr, Double_t Mass=-1, Bool_t IsConstrained=0)
void Construct(const KFParticle *vDaughters[], int nDaughters, const KFParticle *ProdVtx=nullptr, Double_t Mass=-1, Bool_t IsConstrained=0)
Definition: KFParticle.h:869
void GetDStoParticle(const KFParticle &p, Double_t &DS, Double_t &DSp) const
Definition: KFParticle.h:916
const Double_t & Px() const
Definition: KFParticle.h:126
void TransportToDS(Double_t dS)
Double_t GetS() const
const Double_t & X() const
Double_t GetR() const
Definition: KFParticle.h:575
Double_t GetAngleRZ(const KFParticle &p) const
Double_t GetDeviationFromParticle(const KFParticleBase &p) const
void operator+=(const KFParticle &Daughter)
Definition: KFParticle.h:844
Double_t GetErrX() const
Definition: KFParticle.h:584
Bool_t fAtProductionVertex
Double_t GetLifeTime() const
Definition: KFParticle.h:566
Double_t GetErrDecayLength() const
Definition: KFParticle.h:678
Double_t GetErrP() const
Definition: KFParticle.h:624
void AddDaughter(const KFParticleBase &Daughter)
static void GetExternalTrackParam(const KFParticleBase &p, Double_t &X, Double_t &Alpha, Double_t P[5])
Double_t & Parameter(Int_t i)
Double_t GetS() const
Definition: KFParticle.h:459
void Create(const Double_t Param[], const Double_t Cov[], Int_t Charge, Double_t mass)
std::vector< int > fDaughtersIds
Double_t GetDistanceFromParticle(const KFParticleBase &p) const
void AddDaughter(int id)
Definition: KFParticle.h:87
static void SetField(Double_t Bz)
Definition: KFParticle.h:389
Double_t & Parameter(int i)
Definition: KFParticle.h:819
void GetFieldValue(const Double_t xyz[], Double_t B[]) const
Definition: KFParticle.h:974
const Double_t & S() const
Double_t GetDeviationFromVertexXY(const Double_t v[], const Double_t Cv[]=0) const
Int_t GetDecayLength(Double_t &L, Double_t &SigmaL) const
const Double_t & E() const
const Double_t & Z() const
void TransportToParticle(const KFParticle &p)
Definition: KFParticle.h:894
void ConstructGammaBz(const KFParticleBase &daughter1, const KFParticleBase &daughter2, double Bz)
void CleanDaughtersId()
Definition: KFParticle.h:85
Double_t GetErrPy() const
Definition: KFParticle.h:604
Double_t & Covariance(Int_t i)
void TransportBz(Double_t Bz, Double_t dS, Double_t P[], Double_t C[]) const
Int_t GetLifeTime(Double_t &T, Double_t &SigmaT) const
Double_t GetPt() const
Definition: KFParticle.h:503