Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticleSIMD.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticleSIMD.h
1 /*
2  * This file is part of KFParticle package
3  * Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4  * 2007-2019 Goethe University of Frankfurt
5  * 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6  * 2007-2019 Maksym Zyzak
7  *
8  * KFParticle is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * KFParticle is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 
23 //#define NonhomogeneousField
24 // #define HomogeneousField
25 
26 #ifndef KFPARTICLESIMD_H
27 #define KFPARTICLESIMD_H
28 
29 #include "KFParticleBaseSIMD.h"
30 
31 #include "KFPTrack.h"
32 #include "KFPTrackVector.h"
33 #include "KFPEmcCluster.h"
34 #include "KFPVertex.h"
35 
36 #ifdef NonhomogeneousField
37 #include "KFParticleField.h"
38 #endif
39 
40 class KFParticle;
41 
60 {
61 
62  public:
63 
64  void *operator new(size_t size) { return _mm_malloc(size, sizeof(float_v)); }
65  void *operator new[](size_t size) { return _mm_malloc(size, sizeof(float_v)); }
66  void *operator new(size_t size, void *ptr) { return ::operator new(size, ptr);}
67  void *operator new[](size_t size, void *ptr) { return ::operator new(size, ptr);}
68  void operator delete(void *ptr, size_t) { _mm_free(ptr); }
69  void operator delete[](void *ptr, size_t) { _mm_free(ptr); }
70  //*
71  //* INITIALIZATION
72  //*
73 
74  //* Set magnetic field for all particles
75 #ifdef HomogeneousField
76  static void SetField( float_v Bz );
77 #endif
78 #ifdef NonhomogeneousField
79  void SetField(const KFParticleFieldRegion &field)
80  {
84  fField = field;
85  }
86 #endif
87  //* Constructor (empty)
88 
90 #ifdef NonhomogeneousField
91  , fField()
92 #endif
93  { ; }
94 
95  //* Destructor (empty)
96 
98 
99  //* Construction of mother particle by its 2-3-4 daughters
100 
101  KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2 );
102  KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2, const KFParticleSIMD &d3 );
103  KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2, const KFParticleSIMD &d3, const KFParticleSIMD &d4 );
104 
105  //* Initialisation from "cartesian" coordinates ( X Y Z Px Py Pz )
106  //* Parameters, covariance matrix, charge and PID hypothesis should be provided
107 
108  void Create( const float_v Param[], const float_v Cov[], int_v Charge, float_v mass /*Int_t PID*/ );
109 
110  void SetOneEntry(int iEntry, KFParticleSIMD& part, int iEntryPart);
111 
112  KFParticleSIMD( const KFPTrack *track, Int_t PID );
113  KFParticleSIMD( KFPTrack* Track[], int NTracks, const Int_t *pdg=0 );
114  KFParticleSIMD( KFPTrackVector &track, uint_v& index, const int_v& pdg );
115 
116  void Create(KFPTrack* Track[], int NTracks, const Int_t *pdg=0);
117  void Create(KFPTrackVector &track, uint_v& index, const int_v& pdg);
118  void Load(KFPTrackVector &track, int index, const int_v& pdg);
119  void Rotate();
120 
121  KFParticleSIMD(KFPTrack &Track, const Int_t *pdg=0);
122  KFParticleSIMD(KFPTrackVector &track, int n, const Int_t *pdg=0);
123 
124  KFParticleSIMD( KFPEmcCluster &track, uint_v& index, const KFParticleSIMD& vertexGuess );
125  KFParticleSIMD( KFPEmcCluster &track, int index, const KFParticleSIMD& vertexGuess );
126  void Create( KFPEmcCluster &track, uint_v& index, const KFParticleSIMD& vertexGuess );
127  void Load( KFPEmcCluster &track, int index, const KFParticleSIMD& vertexGuess );
128 
129 
130  //* Initialisation from VVertex
131 
132  KFParticleSIMD( const KFPVertex &vertex );
133  KFParticleSIMD( KFParticle* part[], const int nPart = 0 );
134  KFParticleSIMD( KFParticle &part );
135 
136  //*
137  //* ACCESSORS
138  //*
139 
140  //* Simple accessors
141 
142  float_v GetX () const ;
143  float_v GetY () const ;
144  float_v GetZ () const ;
145  float_v GetPx () const ;
146  float_v GetPy () const ;
147  float_v GetPz () const ;
148  float_v GetE () const ;
149  float_v GetS () const ;
150  int_v GetQ () const ;
151  float_v GetChi2 () const ;
152  int_v GetNDF () const ;
153 
154  Bool_t GetAtProductionVertex() const { return fAtProductionVertex; }
155 
156  const float_v& X () const { return fP[0]; }
157  const float_v& Y () const { return fP[1]; }
158  const float_v& Z () const { return fP[2]; }
159  const float_v& Px () const { return fP[3]; }
160  const float_v& Py () const { return fP[4]; }
161  const float_v& Pz () const { return fP[5]; }
162  const float_v& E () const { return fP[6]; }
163  const float_v& S () const { return fP[7]; }
164  const int_v & Q () const { return fQ; }
165  const float_v& Chi2 () const { return fChi2; }
166  const int_v& NDF () const { return fNDF; }
167 
168  float_v GetParameter ( int i ) const ;
169  float_v GetCovariance( int i ) const ;
170  float_v GetCovariance( int i, int j ) const ;
171 
172  //* Accessors with calculations, value returned w/o error flag
173 
174  float_v GetP () const;
175  float_v GetPt () const;
176  float_v GetEta () const;
177  float_v GetPhi () const;
178  float_v GetMomentum () const;
179  float_v GetMass () const;
180  float_v GetDecayLength () const;
181  float_v GetDecayLengthXY () const;
182  float_v GetLifeTime () const;
183  float_v GetR () const;
184  float_v GetRapidity() const { return float_v(0.5f)*log((fP[6] + fP[5])/(fP[6] - fP[5])); }
185 
186  //* Accessors to estimated errors
187 
188  float_v GetErrX () const ;
189  float_v GetErrY () const ;
190  float_v GetErrZ () const ;
191  float_v GetErrPx () const ;
192  float_v GetErrPy () const ;
193  float_v GetErrPz () const ;
194  float_v GetErrE () const ;
195  float_v GetErrS () const ;
196  float_v GetErrP () const ;
197  float_v GetErrPt () const ;
198  float_v GetErrEta () const ;
199  float_v GetErrPhi () const ;
200  float_v GetErrMomentum () const ;
201  float_v GetErrMass () const ;
202  float_v GetErrDecayLength () const ;
203  float_v GetErrDecayLengthXY () const ;
204  float_v GetErrLifeTime () const ;
205  float_v GetErrR () const ;
206 
207  //* Accessors with calculations( &value, &estimated sigma )
208  //* error flag returned (0 means no error during calculations)
209 
210  float_m GetP ( float_v &P, float_v &SigmaP ) const ; //* momentum
211  float_m GetPt ( float_v &Pt, float_v &SigmaPt ) const ; //* transverse momentum
212  float_m GetEta ( float_v &Eta, float_v &SigmaEta ) const ; //* pseudorapidity
213  float_m GetPhi ( float_v &Phi, float_v &SigmaPhi ) const ; //* phi
214  float_m GetMomentum ( float_v &P, float_v &SigmaP ) const ; //* momentum
215  float_m GetMass ( float_v &M, float_v &SigmaM ) const ; //* mass
216  float_m GetDecayLength ( float_v &L, float_v &SigmaL ) const ; //* decay length
217  float_m GetDecayLengthXY ( float_v &L, float_v &SigmaL ) const ; //* decay length in XY
218  float_m GetLifeTime ( float_v &T, float_v &SigmaT ) const ; //* life time
219  float_m GetR ( float_v &R, float_v &SigmaR ) const ; //* R
220 
221 
222  //*
223  //* MODIFIERS
224  //*
225 
226  float_v & X () ;
227  float_v & Y () ;
228  float_v & Z () ;
229  float_v & Px () ;
230  float_v & Py () ;
231  float_v & Pz () ;
232  float_v & E () ;
233  float_v & S () ;
234  int_v & Q () ;
235  float_v & Chi2 () ;
236  int_v & NDF () ;
237 
238  float_v & Parameter ( int i ) ;
239  float_v & Covariance( int i ) ;
240  float_v & Covariance( int i, int j ) ;
241  float_v * Parameters () ;
242  float_v * CovarianceMatrix() ;
243 
244  void GetKFParticle( KFParticle &Part, int iPart = 0);
245  void GetKFParticle( KFParticle *Part, int nPart = 0);
246 
247  //*
248  //* CONSTRUCTION OF THE PARTICLE BY ITS DAUGHTERS AND MOTHER
249  //* USING THE KALMAN FILTER METHOD
250  //*
251 
252 
253  //* Add daughter to the particle
254 
255  void AddDaughter( const KFParticleSIMD &Daughter );
256 
257  //* Add daughter via += operator: ex.{ D0; D0+=Pion; D0+= Kaon; }
258 
259  void operator +=( const KFParticleSIMD &Daughter );
260 
261  //* Everything in one go
262 
263  void Construct( const KFParticleSIMD *vDaughters[], int nDaughters,
264  const KFParticleSIMD *ProdVtx=0, Float_t Mass=-1 );
265 
266  //*
267  //* TRANSPORT
268  //*
269  //* ( main transportation parameter is S = SignedPath/Momentum )
270  //* ( parameters of decay & production vertices are stored locally )
271  //*
272 
273  //* Transport the particle close to xyz[] point
274 
275  void TransportToPoint( const float_v xyz[] );
276 
277  //* Transport the particle close to VVertex
278 #ifdef HomogeneousField
279  void TransportToVertex( const KFPVertex &v );
280 #endif
281  //* Transport the particle close to another particle p
282 
283  void TransportToParticle( const KFParticleSIMD &p );
284 
285  //* Get dS to a certain space point
286 
287  float_v GetDStoPoint( const float_v xyz[3], float_v dsdr[6] ) const ;
288 
289  //* Get dS to other particle p (dSp for particle p also returned)
290 
291  void GetDStoParticle( const KFParticleBaseSIMD &p, float_v dS[2], float_v dsdr[4][6] ) const ;
292  void GetDStoParticleFast( const KFParticleBaseSIMD &p, float_v dS[2] ) const ;
293  //*
294  //* OTHER UTILITIES
295  //*
296 
297  //* Calculate distance from another object [cm] in XY-plane
298 
299  float_m GetDistanceFromVertexXY( const float_v vtx[], float_v &val, float_v &err ) const ;
300  float_m GetDistanceFromVertexXY( const float_v vtx[], const float_v Cv[], float_v &val, float_v &err ) const ;
301  float_m GetDistanceFromVertexXY( const KFParticleSIMD &Vtx, float_v &val, float_v &err ) const ;
302 #ifdef HomogeneousField
303  float_m GetDistanceFromVertexXY( const KFPVertex &Vtx, float_v &val, float_v &err ) const ;
304 #endif
305 
306  float_v GetDistanceFromVertexXY( const float_v vtx[] ) const ;
307  float_v GetDistanceFromVertexXY( const KFParticleSIMD &Vtx ) const ;
308 #ifdef HomogeneousField
309  float_v GetDistanceFromVertexXY( const KFPVertex &Vtx ) const ;
310 #endif
311  float_v GetDistanceFromParticleXY( const KFParticleSIMD &p ) const ;
312 
313  //* Calculate sqrt(Chi2/ndf) deviation from another object in XY plane
314  //* ( v = [xyz]-vertex, Cv=[Cxx,Cxy,Cyy,Cxz,Cyz,Czz]-covariance matrix )
315 
316  float_v GetDeviationFromVertexXY( const float_v v[], const float_v Cv[]=0 ) const ;
317  float_v GetDeviationFromVertexXY( const KFParticleSIMD &Vtx ) const ;
318 #ifdef HomogeneousField
319  float_v GetDeviationFromVertexXY( const KFPVertex &Vtx ) const ;
320 #endif
321  float_v GetDeviationFromParticleXY( const KFParticleSIMD &p ) const ;
322 
323  //* Calculate opennig angle between two particles
324 
325  float_v GetAngle ( const KFParticleSIMD &p ) const ;
326  float_v GetAngleXY( const KFParticleSIMD &p ) const ;
327  float_v GetAngleRZ( const KFParticleSIMD &p ) const ;
328 
329  // * Pseudo Proper Time of decay = (r*pt) / |pt| * M/|pt|
330  // @primVertex - primary vertex
331  // @mass - mass of the mother particle (in the case of "Hb -> JPsi" it would be JPsi mass)
332  // @*timeErr2 - squared error of the decay time. If timeErr2 = 0 it isn't calculated
333  float_v GetPseudoProperDecayTime( const KFParticleSIMD &primVertex, const float_v& mass, float_v* timeErr2 = 0 ) const;
334 
335  void GetFieldValue( const float_v xyz[], float_v B[] ) const ;
336 
337  void Transport( float_v dS, const float_v* dsdr, float_v P[], float_v C[], float_v* dsdr1=0, float_v* F=0, float_v* F1=0 ) const ;
338  void TransportFast( float_v dS, float_v P[] ) const ;
339 
340  protected:
341 
342  //*
343  //* INTERNAL STUFF
344  //*
345 
346  //* Method to access ALICE field
347 #ifdef HomogeneousField
348  static float_v GetFieldAlice();
349 #endif
350  //* Other methods required by the abstract KFParticleBaseSIMD class
351 
352  private:
353 #ifdef HomogeneousField
354  static float_v fgBz;
355 #endif
356 #ifdef NonhomogeneousField
357 
360  KFParticleFieldRegion fField;
361 #endif
362 };
363 
364 
365 
366 //---------------------------------------------------------------------
367 //
368 // Inline implementation of the KFParticleSIMD methods
369 //
370 //---------------------------------------------------------------------
371 
372 #ifdef HomogeneousField
373 inline void KFParticleSIMD::SetField( float_v Bz )
374 {
378  fgBz = Bz;
379 }
380 #endif
381 
383  const KFParticleSIMD &d2,
384  const KFParticleSIMD &d3 ): KFParticleBaseSIMD()
385 #ifdef NonhomogeneousField
386  , fField()
387 #endif
388 {
395  KFParticleSIMD mother;
396  mother+= d1;
397  mother+= d2;
398  mother+= d3;
399  *this = mother;
400 }
401 
403  const KFParticleSIMD &d2,
404  const KFParticleSIMD &d3,
405  const KFParticleSIMD &d4 ): KFParticleBaseSIMD()
406 #ifdef NonhomogeneousField
407  , fField()
408 #endif
409 {
417  KFParticleSIMD mother;
418  mother+= d1;
419  mother+= d2;
420  mother+= d3;
421  mother+= d4;
422  *this = mother;
423 }
424 
425 inline float_v KFParticleSIMD::GetX () const
426 {
427  return KFParticleBaseSIMD::GetX();
428 }
429 
430 inline float_v KFParticleSIMD::GetY () const
431 {
432  return KFParticleBaseSIMD::GetY();
433 }
434 
435 inline float_v KFParticleSIMD::GetZ () const
436 {
437  return KFParticleBaseSIMD::GetZ();
438 }
439 
440 inline float_v KFParticleSIMD::GetPx () const
441 {
442  return KFParticleBaseSIMD::GetPx();
443 }
444 
445 inline float_v KFParticleSIMD::GetPy () const
446 {
447  return KFParticleBaseSIMD::GetPy();
448 }
449 
450 inline float_v KFParticleSIMD::GetPz () const
451 {
452  return KFParticleBaseSIMD::GetPz();
453 }
454 
455 inline float_v KFParticleSIMD::GetE () const
456 {
457  return KFParticleBaseSIMD::GetE();
458 }
459 
460 inline float_v KFParticleSIMD::GetS () const
461 {
462  return KFParticleBaseSIMD::GetS();
463 }
464 
465 inline int_v KFParticleSIMD::GetQ () const
466 {
467  return KFParticleBaseSIMD::GetQ();
468 }
469 
470 inline float_v KFParticleSIMD::GetChi2 () const
471 {
472  return KFParticleBaseSIMD::GetChi2();
473 }
474 
475 inline int_v KFParticleSIMD::GetNDF () const
476 {
477  return KFParticleBaseSIMD::GetNDF();
478 }
479 
480 inline float_v KFParticleSIMD::GetParameter ( int i ) const
481 {
483 }
484 
485 inline float_v KFParticleSIMD::GetCovariance( int i ) const
486 {
488 }
489 
490 inline float_v KFParticleSIMD::GetCovariance( int i, int j ) const
491 {
493 }
494 
495 
496 inline float_v KFParticleSIMD::GetP () const
497 {
498  float_v par, err;
500  return par;
501 }
502 
503 inline float_v KFParticleSIMD::GetPt () const
504 {
505  float_v par, err;
506  KFParticleBaseSIMD::GetPt( par, err ) ;
507  return par;
508 }
509 
510 inline float_v KFParticleSIMD::GetEta () const
511 {
512  float_v par, err;
513  KFParticleBaseSIMD::GetEta( par, err );
514  return par;
515 }
516 
517 inline float_v KFParticleSIMD::GetPhi () const
518 {
519  float_v par, err;
520  KFParticleSIMD::GetPhi( par, err );
521  return par;
522 }
523 
524 inline float_v KFParticleSIMD::GetMomentum () const
525 {
526  float_v par, err;
527  KFParticleSIMD::GetMomentum( par, err );
528  return par;
529 }
530 
531 inline float_v KFParticleSIMD::GetMass () const
532 {
533  float_v par, err;
534  KFParticleSIMD::GetMass( par, err );
535  return par;
536 }
537 
538 inline float_v KFParticleSIMD::GetDecayLength () const
539 {
540  float_v par, err;
541  KFParticleSIMD::GetDecayLength( par, err );
542  return par;
543 }
544 
545 inline float_v KFParticleSIMD::GetDecayLengthXY () const
546 {
547  float_v par, err;
549  return par;
550 }
551 
552 inline float_v KFParticleSIMD::GetLifeTime () const
553 {
554  float_v par, err;
555  KFParticleSIMD::GetLifeTime( par, err );
556  return par;
557 }
558 
559 inline float_v KFParticleSIMD::GetR () const
560 {
561  float_v par, err;
562  KFParticleSIMD::GetR( par, err );
563  return par;
564 }
565 
566 inline float_v KFParticleSIMD::GetErrX () const
567 {
568  return sqrt(abs( GetCovariance(0,0) ));
569 }
570 
571 inline float_v KFParticleSIMD::GetErrY () const
572 {
573  return sqrt(abs( GetCovariance(1,1) ));
574 }
575 
576 inline float_v KFParticleSIMD::GetErrZ () const
577 {
578  return sqrt(abs( GetCovariance(2,2) ));
579 }
580 
581 inline float_v KFParticleSIMD::GetErrPx () const
582 {
583  return sqrt(abs( GetCovariance(3,3) ));
584 }
585 
586 inline float_v KFParticleSIMD::GetErrPy () const
587 {
588  return sqrt(abs( GetCovariance(4,4) ));
589 }
590 
591 inline float_v KFParticleSIMD::GetErrPz () const
592 {
593  return sqrt(abs( GetCovariance(5,5) ));
594 }
595 
596 inline float_v KFParticleSIMD::GetErrE () const
597 {
598  return sqrt(abs( GetCovariance(6,6) ));
599 }
600 
601 inline float_v KFParticleSIMD::GetErrS () const
602 {
603  return sqrt(abs( GetCovariance(7,7) ));
604 }
605 
606 inline float_v KFParticleSIMD::GetErrP () const
607 {
608  float_v par, err;
609  float_m mask = KFParticleSIMD::GetMomentum( par, err );
610  float_v ret(1.e10f);
611  ret(!mask) = err;
612  return ret;
613 }
614 
615 inline float_v KFParticleSIMD::GetErrPt () const
616 {
617  float_v par, err;
618  float_m mask = KFParticleSIMD::GetPt( par, err );
619  float_v ret(1.e10f);
620  ret(!mask) = err;
621  return ret;
622 }
623 
624 inline float_v KFParticleSIMD::GetErrEta () const
625 {
626  float_v par, err;
627  float_m mask = KFParticleSIMD::GetEta( par, err );
628  float_v ret(1.e10f);
629  ret(!mask) = err;
630  return ret;
631 }
632 
633 inline float_v KFParticleSIMD::GetErrPhi () const
634 {
635  float_v par, err;
636  float_m mask = KFParticleSIMD::GetPhi( par, err );
637  float_v ret(1.e10f);
638  ret(!mask) = err;
639  return ret;
640 }
641 
642 inline float_v KFParticleSIMD::GetErrMomentum () const
643 {
644  float_v par, err;
645  float_m mask = KFParticleSIMD::GetMomentum( par, err );
646  float_v ret(1.e10f);
647  ret(!mask) = err;
648  return ret;
649 }
650 
651 inline float_v KFParticleSIMD::GetErrMass () const
652 {
653  float_v par, err;
654  float_m mask = KFParticleSIMD::GetMass( par, err );
655  float_v ret(1.e10f);
656  ret(!mask) = err;
657  return ret;
658 }
659 
660 inline float_v KFParticleSIMD::GetErrDecayLength () const
661 {
662  float_v par, err;
663  float_m mask = KFParticleSIMD::GetDecayLength( par, err );
664  float_v ret(1.e10f);
665  ret(!mask) = err;
666  return ret;
667 }
668 
669 inline float_v KFParticleSIMD::GetErrDecayLengthXY () const
670 {
671  float_v par, err;
672  float_m mask = KFParticleSIMD::GetDecayLengthXY( par, err );
673  float_v ret(1.e10f);
674  ret(!mask) = err;
675  return ret;
676 }
677 
678 inline float_v KFParticleSIMD::GetErrLifeTime () const
679 {
680  float_v par, err;
681  float_m mask = KFParticleSIMD::GetLifeTime( par, err );
682  float_v ret(1.e10f);
683  ret(!mask) = err;
684  return ret;
685 }
686 
687 inline float_v KFParticleSIMD::GetErrR () const
688 {
689  float_v par, err;
690  float_m mask = KFParticleSIMD::GetR( par, err );
691  float_v ret(1.e10f);
692  ret(!mask) = err;
693  return ret;
694 }
695 
696 
697 inline float_m KFParticleSIMD::GetP( float_v &P, float_v &SigmaP ) const
698 {
703  return KFParticleBaseSIMD::GetMomentum( P, SigmaP );
704 }
705 
706 inline float_m KFParticleSIMD::GetPt( float_v &Pt, float_v &SigmaPt ) const
707 {
712  return KFParticleBaseSIMD::GetPt( Pt, SigmaPt );
713 }
714 
715 inline float_m KFParticleSIMD::GetEta( float_v &Eta, float_v &SigmaEta ) const
716 {
721  return KFParticleBaseSIMD::GetEta( Eta, SigmaEta );
722 }
723 
724 inline float_m KFParticleSIMD::GetPhi( float_v &Phi, float_v &SigmaPhi ) const
725 {
730  return KFParticleBaseSIMD::GetPhi( Phi, SigmaPhi );
731 }
732 
733 inline float_m KFParticleSIMD::GetMomentum( float_v &P, float_v &SigmaP ) const
734 {
739  return KFParticleBaseSIMD::GetMomentum( P, SigmaP );
740 }
741 
742 inline float_m KFParticleSIMD::GetMass( float_v &M, float_v &SigmaM ) const
743 {
748  return KFParticleBaseSIMD::GetMass( M, SigmaM );
749 }
750 
751 inline float_m KFParticleSIMD::GetDecayLength( float_v &L, float_v &SigmaL ) const
752 {
758  return KFParticleBaseSIMD::GetDecayLength( L, SigmaL );
759 }
760 
761 inline float_m KFParticleSIMD::GetDecayLengthXY( float_v &L, float_v &SigmaL ) const
762 {
769  return KFParticleBaseSIMD::GetDecayLengthXY( L, SigmaL );
770 }
771 
772 inline float_m KFParticleSIMD::GetLifeTime( float_v &T, float_v &SigmaT ) const
773 {
780  return KFParticleBaseSIMD::GetLifeTime( T, SigmaT );
781 }
782 
783 inline float_m KFParticleSIMD::GetR( float_v &R, float_v &SigmaR ) const
784 {
789  return KFParticleBaseSIMD::GetR( R, SigmaR );
790 }
791 
792 inline float_v & KFParticleSIMD::X()
793 {
794  return KFParticleBaseSIMD::X();
795 }
796 
797 inline float_v & KFParticleSIMD::Y()
798 {
799  return KFParticleBaseSIMD::Y();
800 }
801 
802 inline float_v & KFParticleSIMD::Z()
803 {
804  return KFParticleBaseSIMD::Z();
805 }
806 
807 inline float_v & KFParticleSIMD::Px()
808 {
809  return KFParticleBaseSIMD::Px();
810 }
811 
812 inline float_v & KFParticleSIMD::Py()
813 {
814  return KFParticleBaseSIMD::Py();
815 }
816 
817 inline float_v & KFParticleSIMD::Pz()
818 {
819  return KFParticleBaseSIMD::Pz();
820 }
821 
822 inline float_v & KFParticleSIMD::E()
823 {
824  return KFParticleBaseSIMD::E();
825 }
826 
827 inline float_v & KFParticleSIMD::S()
828 {
829  return KFParticleBaseSIMD::S();
830 }
831 
832 inline int_v & KFParticleSIMD::Q()
833 {
834  return KFParticleBaseSIMD::Q();
835 }
836 
837 inline float_v & KFParticleSIMD::Chi2()
838 {
839  return KFParticleBaseSIMD::Chi2();
840 }
841 
842 inline int_v & KFParticleSIMD::NDF()
843 {
844  return KFParticleBaseSIMD::NDF();
845 }
846 
847 inline float_v & KFParticleSIMD::Parameter ( int i )
848 {
850 }
851 
852 inline float_v & KFParticleSIMD::Covariance( int i )
853 {
855 }
856 
857 inline float_v & KFParticleSIMD::Covariance( int i, int j )
858 {
859  return KFParticleBaseSIMD::Covariance(i,j);
860 }
861 
862 inline float_v * KFParticleSIMD::Parameters ()
863 {
864  return fP;
865 }
866 
868 {
869  return fC;
870 }
871 
872 
873 inline void KFParticleSIMD::operator +=( const KFParticleSIMD &Daughter )
874 {
878 #ifdef NonhomogeneousField
879  fField = Daughter.fField;
880 #endif
882 }
883 
884 
885 inline void KFParticleSIMD::AddDaughter( const KFParticleSIMD &Daughter )
886 {
899 #ifdef NonhomogeneousField
900  fField = Daughter.fField;
901 #endif
903 }
904 
905 inline void KFParticleSIMD::Construct( const KFParticleSIMD *vDaughters[], int nDaughters,
906  const KFParticleSIMD *ProdVtx, Float_t Mass )
907 {
918 #ifdef NonhomogeneousField
919  fField = vDaughters[0]->fField;
920 #endif
921  KFParticleBaseSIMD::Construct( ( const KFParticleBaseSIMD**)vDaughters, nDaughters,
922  ( const KFParticleBaseSIMD*)ProdVtx, Mass );
923 }
924 
925 inline void KFParticleSIMD::TransportToPoint( const float_v xyz[] )
926 {
931  float_v dsdr[6] = {0.f,0.f,0.f,0.f,0.f,0.f};
932  const float_v dS = GetDStoPoint(xyz, dsdr);
933  TransportToDS( dS, dsdr );
934 }
935 #ifdef HomogeneousField
936 inline void KFParticleSIMD::TransportToVertex( const KFPVertex &v )
937 {
942 }
943 #endif
945 {
949  float_v dsdr[4][6];
950  float_v dS[2];
951  GetDStoParticle( p, dS, dsdr );
952  TransportToDS( dS[0], dsdr[0] );
953 }
954 
955 inline float_v KFParticleSIMD::GetDStoPoint( const float_v xyz[3], float_v dsdr[6] ) const
956 {
968 #ifdef HomogeneousField
969  return KFParticleBaseSIMD::GetDStoPointBz( GetFieldAlice(), xyz, dsdr );
970 #endif
971 #ifdef NonhomogeneousField
972  return KFParticleBaseSIMD::GetDStoPointCBM( xyz, dsdr );
973 #endif
974 }
975 
976 
977 #ifdef HomogeneousField
978 inline float_v KFParticleSIMD::GetFieldAlice()
979 {
981  return fgBz;
982 }
983 #endif
984 
985 #ifdef HomogeneousField
986 inline void KFParticleSIMD::GetFieldValue( const float_v * /*xyz*/, float_v B[] ) const
987 {
993  B[0] = B[1] = 0;
994  B[2] = GetFieldAlice();
995 }
996 #endif
997 
998 #ifdef NonhomogeneousField
999 inline void KFParticleSIMD::GetFieldValue( const float_v xyz[], float_v B[] ) const
1000 {
1006  KFParticleFieldValue mB = const_cast<KFParticleFieldRegion&>(fField).Get(xyz[2]);
1007  B[0] = mB.x;
1008  B[1] = mB.y;
1009  B[2] = mB.z;
1010 }
1011 #endif
1012 
1013 inline void KFParticleSIMD::GetDStoParticle( const KFParticleBaseSIMD &p, float_v dS[2], float_v dsdr[4][6] )const
1014 {
1031 #ifdef HomogeneousField
1032  KFParticleBaseSIMD::GetDStoParticleBz( GetFieldAlice(), p, dS, dsdr ) ;
1033 #endif
1034 #ifdef NonhomogeneousField
1036 #endif
1037 }
1038 
1039 inline void KFParticleSIMD::GetDStoParticleFast( const KFParticleBaseSIMD &p, float_v dS[2] )const
1040 {
1050 #ifdef HomogeneousField
1051  KFParticleBaseSIMD::GetDStoParticleBz( GetFieldAlice(), p, dS ) ;
1052 #endif
1053 #ifdef NonhomogeneousField
1055 #endif
1056 }
1057 
1058 inline void KFParticleSIMD::Transport( float_v dS, const float_v* dsdr, float_v P[], float_v C[], float_v* dsdr1, float_v* F, float_v* F1 ) const
1059 {
1082 #ifdef HomogeneousField
1083  KFParticleBaseSIMD::TransportBz( GetFieldAlice(), dS, dsdr, P, C, dsdr1, F, F1 );
1084 #endif
1085 #ifdef NonhomogeneousField
1086  KFParticleBaseSIMD::TransportCBM( dS, dsdr, P, C, dsdr1, F, F1 );
1087 #endif
1088 }
1089 
1090 inline void KFParticleSIMD::TransportFast( float_v dS, float_v P[] ) const
1091 {
1102 #ifdef HomogeneousField
1103  KFParticleBaseSIMD::TransportBz( GetFieldAlice(), dS, P );
1104 #endif
1105 #ifdef NonhomogeneousField
1107 #endif
1108 }
1109 
1110 #endif