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