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