BmnRoot
Loading...
Searching...
No Matches
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#include "TMath.h"
26
27#ifdef HomogeneousField
28class AliVTrack;
29class AliVVertex;
30#endif
31
32#ifdef NonhomogeneousField
33#include "CbmKF.h"
36#include "L1Field.h"
37#endif
38
39class KFParticle;
40
42{
43
44 public:
45
46 //*
47 //* INITIALIZATION
48 //*
49
50 //* Set magnetic field for all particles
51#ifdef HomogeneousField
52 static void SetField( fvec Bz );
53#endif
54#ifdef NonhomogeneousField
55 void SetField(const L1FieldRegion &field, bool isOneEntry=0, const int iVec=0)
56 {
57 if(!isOneEntry)
58 fField = field;
59 else
60 fField.SetOneEntry(field,iVec);
61 }
62#endif
63 //* Constructor (empty)
64
67 , fField()
68 #endif
69 { ; }
70
71 //* Destructor (empty)
72
74
75 //* Construction of mother particle by its 2-3-4 daughters
76
77 KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2, Bool_t gamma = kFALSE );
78
79 KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2, const KFParticleSIMD &d3 );
80
81 KFParticleSIMD( const KFParticleSIMD &d1, const KFParticleSIMD &d2, const KFParticleSIMD &d3, const KFParticleSIMD &d4 );
82
83 //* Initialisation from "cartesian" coordinates ( X Y Z Px Py Pz )
84 //* Parameters, covariance matrix, charge and PID hypothesis should be provided
85
86 void Create( const fvec Param[], const fvec Cov[], Int_t Charge, fvec mass /*Int_t PID*/ );
87
88#ifdef HomogeneousField
89 //* Initialisation from ALICE track, PID hypothesis shoould be provided
90
91 KFParticleSIMD( const AliVTrack &track, Int_t PID );
92
93 //* Initialisation from VVertex
94
95 KFParticleSIMD( const AliVVertex &vertex );
96#endif
97
98#ifdef NonhomogeneousField
99 KFParticleSIMD( CbmKFTrackInterface* Track[], int NTracks, Int_t *qHypo=0, const Int_t *pdg=0 );
100 KFParticleSIMD( CbmKFTrackInterface &Track, Int_t *qHypo=0, const Int_t *pdg=0);
102 void Create(CbmKFTrackInterface* Track[], int NTracks, Int_t *qHypo=0, const Int_t *pdg=0);
103#endif
104 KFParticleSIMD( KFParticle* part[], const int nPart = 0 );
105 KFParticleSIMD( KFParticle &part );
106
107 //* Initialise covariance matrix and set current parameters to 0.0
108
109 void Initialize();
110
111 //* Set decay vertex parameters for linearisation
112
113 void SetVtxGuess( fvec x, fvec y, fvec z );
114
115 //*
116 //* ACCESSORS
117 //*
118
119 //* Simple accessors
120
121 fvec GetX () const ; //* x of current position
122 fvec GetY () const ; //* y of current position
123 fvec GetZ () const ; //* z of current position
124 fvec GetPx () const ; //* x-compoment of 3-momentum
125 fvec GetPy () const ; //* y-compoment of 3-momentum
126 fvec GetPz () const ; //* z-compoment of 3-momentum
127 fvec GetE () const ; //* energy
128 fvec GetS () const ; //* decay length / momentum
129 fvec GetQ () const ; //* charge
130 fvec GetChi2 () const ; //* chi^2
131 fvec GetNDF () const ; //* Number of Degrees of Freedom
132
134
135 const fvec& X () const { return fP[0]; }
136 const fvec& Y () const { return fP[1]; }
137 const fvec& Z () const { return fP[2]; }
138 const fvec& Px () const { return fP[3]; }
139 const fvec& Py () const { return fP[4]; }
140 const fvec& Pz () const { return fP[5]; }
141 const fvec& E () const { return fP[6]; }
142 const fvec& S () const { return fP[7]; }
143 const fvec& Q () const { return fQ; }
144 const fvec& Chi2 () const { return fChi2; }
145 const fvec& NDF () const { return fNDF; }
146
147 fvec GetParameter ( int i ) const ;
148 fvec GetCovariance( int i ) const ;
149 fvec GetCovariance( int i, int j ) const ;
150
151 //* Accessors with calculations, value returned w/o error flag
152
153 fvec GetP () const; //* momentum
154 fvec GetPt () const; //* transverse momentum
155 fvec GetEta () const; //* pseudorapidity
156 fvec GetPhi () const; //* phi
157 fvec GetMomentum () const; //* momentum (same as GetP() )
158 fvec GetMass () const; //* mass
159 fvec GetDecayLength () const; //* decay length
160 fvec GetDecayLengthXY () const; //* decay length in XY
161 fvec GetLifeTime () const; //* life time
162 fvec GetR () const; //* distance to the origin
163
164 //* Accessors to estimated errors
165
166 fvec GetErrX () const ; //* x of current position
167 fvec GetErrY () const ; //* y of current position
168 fvec GetErrZ () const ; //* z of current position
169 fvec GetErrPx () const ; //* x-compoment of 3-momentum
170 fvec GetErrPy () const ; //* y-compoment of 3-momentum
171 fvec GetErrPz () const ; //* z-compoment of 3-momentum
172 fvec GetErrE () const ; //* energy
173 fvec GetErrS () const ; //* decay length / momentum
174 fvec GetErrP () const ; //* momentum
175 fvec GetErrPt () const ; //* transverse momentum
176 fvec GetErrEta () const ; //* pseudorapidity
177 fvec GetErrPhi () const ; //* phi
178 fvec GetErrMomentum () const ; //* momentum
179 fvec GetErrMass () const ; //* mass
180 fvec GetErrDecayLength () const ; //* decay length
181 fvec GetErrDecayLengthXY () const ; //* decay length in XY
182 fvec GetErrLifeTime () const ; //* life time
183 fvec GetErrR () const ; //* distance to the origin
184
185 //* Accessors with calculations( &value, &estimated sigma )
186 //* error flag returned (0 means no error during calculations)
187
188 fvec GetP ( fvec &P, fvec &SigmaP ) const ; //* momentum
189 fvec GetPt ( fvec &Pt, fvec &SigmaPt ) const ; //* transverse momentum
190 fvec GetEta ( fvec &Eta, fvec &SigmaEta ) const ; //* pseudorapidity
191 fvec GetPhi ( fvec &Phi, fvec &SigmaPhi ) const ; //* phi
192 fvec GetMomentum ( fvec &P, fvec &SigmaP ) const ; //* momentum
193 fvec GetMass ( fvec &M, fvec &SigmaM ) const ; //* mass
194 fvec GetDecayLength ( fvec &L, fvec &SigmaL ) const ; //* decay length
195 fvec GetDecayLengthXY ( fvec &L, fvec &SigmaL ) const ; //* decay length in XY
196 fvec GetLifeTime ( fvec &T, fvec &SigmaT ) const ; //* life time
197 fvec GetR ( fvec &R, fvec &SigmaR ) const ; //* R
198
199
200 //*
201 //* MODIFIERS
202 //*
203
204 fvec & X () ;
205 fvec & Y () ;
206 fvec & Z () ;
207 fvec & Px () ;
208 fvec & Py () ;
209 fvec & Pz () ;
210 fvec & E () ;
211 fvec & S () ;
212 fvec & Q () ;
213 fvec & Chi2 () ;
214 fvec & NDF () ;
215
216 fvec & Parameter ( int i ) ;
217 fvec & Covariance( int i ) ;
218 fvec & Covariance( int i, int j ) ;
219 fvec * Parameters () ;
221
222 void GetKFParticle( KFParticle &Part, int iPart = 0);
223 void GetKFParticle( KFParticle *Part, int nPart = 0);
224
225 //*
226 //* CONSTRUCTION OF THE PARTICLE BY ITS DAUGHTERS AND MOTHER
227 //* USING THE KALMAN FILTER METHOD
228 //*
229
230
231 //* Add daughter to the particle
232
233 void AddDaughter( const KFParticleSIMD &Daughter );
234
235 //* Add daughter via += operator: ex.{ D0; D0+=Pion; D0+= Kaon; }
236
237 void operator +=( const KFParticleSIMD &Daughter );
238
239 //* Set production vertex
240
241 void SetProductionVertex( const KFParticleSIMD &Vtx );
242
243 //* Set mass constraint
244
245 void SetMassConstraint( fvec Mass, fvec SigmaMass = 0 );
246
247 //* Set no decay length for resonances
248
249 void SetNoDecayLength();
250
251 //* Everything in one go
252
253 void Construct( const KFParticleSIMD *vDaughters[], int nDaughters,
254 const KFParticleSIMD *ProdVtx=0, Float_t Mass=-1, Bool_t IsConstrained=0,
255 Bool_t isAtVtxGuess = 0);
256
257 //*
258 //* TRANSPORT
259 //*
260 //* ( main transportation parameter is S = SignedPath/Momentum )
261 //* ( parameters of decay & production vertices are stored locally )
262 //*
263
264 //* Transport the particle to its decay vertex
265
267
268 //* Transport the particle to its production vertex
269
271
272 //* Transport the particle close to xyz[] point
273
274 void TransportToPoint( const fvec xyz[] );
275
276 //* Transport the particle close to VVertex
277#ifdef HomogeneousField
278 void TransportToVertex( const AliVVertex &v );
279#endif
280 //* Transport the particle close to another particle p
281
282 void TransportToParticle( const KFParticleSIMD &p );
283
284 //* Transport the particle on dS parameter (SignedPath/Momentum)
285
286 void TransportToDS( fvec dS );
287
288 //* Get dS to a certain space point
289
290 fvec GetDStoPoint( const fvec xyz[] ) const ;
291
292 //* Get dS to other particle p (dSp for particle p also returned)
293
294 void GetDStoParticle( const KFParticleSIMD &p,
295 fvec &DS, fvec &DSp ) const ;
296
297 //* Get dS to other particle p in XY-plane
298
300 fvec &DS, fvec &DSp ) const ;
301
302 //*
303 //* OTHER UTILITIES
304 //*
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 AliVVertex &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 AliVVertex &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 AliVVertex &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 AliVVertex &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 AliVVertex &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,
366 const KFParticleSIMD &daughter2 );
367
368 // * Pseudo Proper Time of decay = (r*pt) / |pt| * M/|pt|
369 // @primVertex - primary vertex
370 // @mass - mass of the mother particle (in the case of "Hb -> JPsi" it would be JPsi mass)
371 // @*timeErr2 - squared error of the decay time. If timeErr2 = 0 it isn't calculated
372 fvec GetPseudoProperDecayTime( const KFParticleSIMD &primVertex, const fvec& mass, fvec* timeErr2 = 0 ) const;
373
374 protected:
375
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 GetFieldValue( const fvec xyz[], fvec B[] ) const ;
387 void GetDStoParticle( const KFParticleBaseSIMD &p, fvec &DS, fvec &DSp )const ;
388 void Transport( fvec dS, fvec P[], fvec C[] ) const ;
389 static void GetExternalTrackParam( const KFParticleBaseSIMD &p, fvec &X, fvec &Alpha, fvec P[5] ) ;
390
391 //void GetDStoParticleALICE( const KFParticleBaseSIMD &p, fvec &DS, fvec &DS1 ) const;
392
393
394 private:
395#ifdef HomogeneousField
396 static fvec fgBz; //* Bz compoment of the magnetic field
397#endif
398#ifdef NonhomogeneousField
399 L1FieldRegion fField;
400#endif
401};
402
403
404
405//---------------------------------------------------------------------
406//
407// Inline implementation of the KFParticleSIMD methods
408//
409//---------------------------------------------------------------------
410
411#ifdef HomogeneousField
412inline void KFParticleSIMD::SetField( fvec Bz )
413{
414 fgBz = Bz;
415}
416#endif
417
419 const KFParticleSIMD &d2,
420 const KFParticleSIMD &d3 )
421 #ifdef NonhomogeneousField
422 : fField()
423 #endif
424{
425 KFParticleSIMD mother;
426 mother+= d1;
427 mother+= d2;
428 mother+= d3;
429 *this = mother;
430}
431
433 const KFParticleSIMD &d2,
434 const KFParticleSIMD &d3,
435 const KFParticleSIMD &d4 )
436 #ifdef NonhomogeneousField
437 : fField()
438 #endif
439{
440 KFParticleSIMD mother;
441 mother+= d1;
442 mother+= d2;
443 mother+= d3;
444 mother+= d4;
445 *this = mother;
446}
447
448
453
455{
457}
458
460{
461 return KFParticleBaseSIMD::GetX();
462}
463
465{
466 return KFParticleBaseSIMD::GetY();
467}
468
470{
471 return KFParticleBaseSIMD::GetZ();
472}
473
475{
477}
478
480{
482}
483
485{
487}
488
490{
491 return KFParticleBaseSIMD::GetE();
492}
493
495{
496 return KFParticleBaseSIMD::GetS();
497}
498
500{
501 return KFParticleBaseSIMD::GetQ();
502}
503
505{
507}
508
510{
512}
513
515{
517}
518
520{
522}
523
524inline fvec KFParticleSIMD::GetCovariance( int i, int j ) const
525{
527}
528
529
531{
532 fvec par, err;
533 fvec mask = KFParticleBaseSIMD::GetMomentum( par, err );
534 return ((!mask) & par);
535}
536
538{
539 fvec par, err;
540 fvec mask = KFParticleBaseSIMD::GetPt( par, err ) ;
541 return ((!mask) & par);
542}
543
545{
546 fvec par, err;
547 fvec mask = KFParticleBaseSIMD::GetEta( par, err );
548 return ((!mask) & par);
549}
550
552{
553 fvec par, err;
554 fvec mask = KFParticleSIMD::GetPhi( par, err );
555 return ((!mask) & par);
556}
557
559{
560 fvec par, err;
561 fvec mask = KFParticleSIMD::GetMomentum( par, err );
562 return ((!mask) & par);
563}
564
566{
567 fvec par, err;
568 fvec mask = KFParticleSIMD::GetMass( par, err );
569 return ((!mask) & par);
570}
571
573{
574 fvec par, err;
575 fvec mask = KFParticleSIMD::GetDecayLength( par, err );
576 return ((!mask) & par);
577}
578
580{
581 fvec par, err;
582 fvec mask = KFParticleSIMD::GetDecayLengthXY( par, err );
583 return ((!mask) & par);
584}
585
587{
588 fvec par, err;
589 fvec mask = KFParticleSIMD::GetLifeTime( par, err );
590 return ((!mask) & par);
591}
592
594{
595 fvec par, err;
596 fvec mask = KFParticleSIMD::GetR( par, err );
597 return ((!mask) & par);
598}
599
601{
602 return sqrt(fabs( GetCovariance(0,0) ));
603}
604
606{
607 return sqrt(fabs( GetCovariance(1,1) ));
608}
609
611{
612 return sqrt(fabs( GetCovariance(2,2) ));
613}
614
616{
617 return sqrt(fabs( GetCovariance(3,3) ));
618}
619
621{
622 return sqrt(fabs( GetCovariance(4,4) ));
623}
624
626{
627 return sqrt(fabs( GetCovariance(5,5) ));
628}
629
631{
632 return sqrt(fabs( GetCovariance(6,6) ));
633}
634
636{
637 return sqrt(fabs( GetCovariance(7,7) ));
638}
639
641{
642 fvec par, err;
643 fvec mask = KFParticleSIMD::GetMomentum( par, err );
644 fvec ret(1.e10);
645 ret = (mask & ret) + ((!mask) & err);
646 return ret;
647}
648
650{
651 fvec par, err;
652 fvec mask = KFParticleSIMD::GetPt( par, err );
653 fvec ret(1.e10);
654 ret = (mask & ret) + ((!mask) & err);
655 return ret;
656}
657
659{
660 fvec par, err;
661 fvec mask = KFParticleSIMD::GetEta( par, err );
662 fvec ret(1.e10);
663 ret = (mask & ret) + ((!mask) & err);
664 return ret;
665}
666
668{
669 fvec par, err;
670 fvec mask = KFParticleSIMD::GetPhi( par, err );
671 fvec ret(1.e10);
672 ret = (mask & ret) + ((!mask) & err);
673 return ret;
674}
675
677{
678 fvec par, err;
679 fvec mask = KFParticleSIMD::GetMomentum( par, err );
680 fvec ret(1.e10);
681 ret = (mask & ret) + ((!mask) & err);
682 return ret;
683}
684
686{
687 fvec par, err;
688 fvec mask = KFParticleSIMD::GetMass( par, err );
689 fvec ret(1.e10);
690 ret = (mask & ret) + ((!mask) & err);
691 return ret;
692}
693
695{
696 fvec par, err;
697 fvec mask = KFParticleSIMD::GetDecayLength( par, err );
698 fvec ret(1.e10);
699 ret = (mask & ret) + ((!mask) & err);
700 return ret;
701}
702
704{
705 fvec par, err;
706 fvec mask = KFParticleSIMD::GetDecayLengthXY( par, err );
707 fvec ret(1.e10);
708 ret = (mask & ret) + ((!mask) & err);
709 return ret;
710}
711
713{
714 fvec par, err;
715 fvec mask = KFParticleSIMD::GetLifeTime( par, err );
716 fvec ret(1.e10);
717 ret = (mask & ret) + ((!mask) & err);
718 return ret;
719}
720
722{
723 fvec par, err;
724 fvec mask = KFParticleSIMD::GetR( par, err );
725 fvec ret(1.e10);
726 ret = (mask & ret) + ((!mask) & err);
727 return ret;
728}
729
730
731inline fvec KFParticleSIMD::GetP( fvec &P, fvec &SigmaP ) const
732{
733 return KFParticleBaseSIMD::GetMomentum( P, SigmaP );
734}
735
736inline fvec KFParticleSIMD::GetPt( fvec &Pt, fvec &SigmaPt ) const
737{
738 return KFParticleBaseSIMD::GetPt( Pt, SigmaPt );
739}
740
741inline fvec KFParticleSIMD::GetEta( fvec &Eta, fvec &SigmaEta ) const
742{
743 return KFParticleBaseSIMD::GetEta( Eta, SigmaEta );
744}
745
746inline fvec KFParticleSIMD::GetPhi( fvec &Phi, fvec &SigmaPhi ) const
747{
748 return KFParticleBaseSIMD::GetPhi( Phi, SigmaPhi );
749}
750
751inline fvec KFParticleSIMD::GetMomentum( fvec &P, fvec &SigmaP ) const
752{
753 return KFParticleBaseSIMD::GetMomentum( P, SigmaP );
754}
755
756inline fvec KFParticleSIMD::GetMass( fvec &M, fvec &SigmaM ) const
757{
758 return KFParticleBaseSIMD::GetMass( M, SigmaM );
759}
760
761inline fvec KFParticleSIMD::GetDecayLength( fvec &L, fvec &SigmaL ) const
762{
763 return KFParticleBaseSIMD::GetDecayLength( L, SigmaL );
764}
765
766inline fvec KFParticleSIMD::GetDecayLengthXY( fvec &L, fvec &SigmaL ) const
767{
768 return KFParticleBaseSIMD::GetDecayLengthXY( L, SigmaL );
769}
770
771inline fvec KFParticleSIMD::GetLifeTime( fvec &T, fvec &SigmaT ) const
772{
773 return KFParticleBaseSIMD::GetLifeTime( T, SigmaT );
774}
775
776inline fvec KFParticleSIMD::GetR( fvec &R, fvec &SigmaR ) const
777{
778 return KFParticleBaseSIMD::GetR( R, SigmaR );
779}
780
782{
783 return KFParticleBaseSIMD::X();
784}
785
787{
788 return KFParticleBaseSIMD::Y();
789}
790
792{
793 return KFParticleBaseSIMD::Z();
794}
795
797{
798 return KFParticleBaseSIMD::Px();
799}
800
802{
803 return KFParticleBaseSIMD::Py();
804}
805
807{
808 return KFParticleBaseSIMD::Pz();
809}
810
812{
813 return KFParticleBaseSIMD::E();
814}
815
817{
818 return KFParticleBaseSIMD::S();
819}
820
822{
823 return KFParticleBaseSIMD::Q();
824}
825
827{
828 return KFParticleBaseSIMD::Chi2();
829}
830
832{
833 return KFParticleBaseSIMD::NDF();
834}
835
837{
839}
840
842{
844}
845
846inline fvec & KFParticleSIMD::Covariance( int i, int j )
847{
849}
850
852{
853 return fP;
854}
855
857{
858 return fC;
859}
860
861
862inline void KFParticleSIMD::operator +=( const KFParticleSIMD &Daughter )
863{
865}
866
867
868inline void KFParticleSIMD::AddDaughter( const KFParticleSIMD &Daughter )
869{
871}
872
877
878inline void KFParticleSIMD::SetMassConstraint( fvec Mass, fvec SigmaMass )
879{
880 KFParticleBaseSIMD::SetMassConstraint( Mass, SigmaMass );
881}
882
887
888inline void KFParticleSIMD::Construct( const KFParticleSIMD *vDaughters[], int nDaughters,
889 const KFParticleSIMD *ProdVtx, Float_t Mass, Bool_t IsConstrained,
890 Bool_t isAtVtxGuess )
891{
892 KFParticleBaseSIMD::Construct( ( const KFParticleBaseSIMD**)vDaughters, nDaughters,
893 ( const KFParticleBaseSIMD*)ProdVtx, Mass, IsConstrained, isAtVtxGuess );
894
895 #ifdef NonhomogeneousField
896 // calculate a field region for the constructed particle
897 L1FieldValue field[3];
898 fvec zField[3] = {0, fP[2]/2, fP[2]};
899
900 for(int iPoint=0; iPoint<3; iPoint++)
901 {
902 for(int iD=0; iD<nDaughters; ++iD)
903 {
904 L1FieldValue b = const_cast<KFParticleSIMD *>(vDaughters[iD])->fField.Get(zField[iPoint]);
905 field[iPoint].x += b.x;
906 field[iPoint].y += b.y;
907 field[iPoint].z += b.z;
908 }
909 field[iPoint].x /= nDaughters;
910 field[iPoint].y /= nDaughters;
911 field[iPoint].z /= nDaughters;
912 }
913
914 fField.Set( field[2], zField[2], field[1], zField[1], field[0], zField[0] );
915 #endif
916}
917
922
927
928inline void KFParticleSIMD::TransportToPoint( const fvec xyz[] )
929{
931}
932#ifdef HomogeneousField
933inline void KFParticleSIMD::TransportToVertex( const AliVVertex &v )
934{
936}
937#endif
939{
940 fvec dS, dSp;
941 GetDStoParticle( p, dS, dSp );
942 TransportToDS( dS );
943}
944
949
950inline fvec KFParticleSIMD::GetDStoPoint( const fvec xyz[] ) const
951{
952#ifdef HomogeneousField
953 return KFParticleBaseSIMD::GetDStoPointBz( GetFieldAlice(), xyz );
954#endif
955#ifdef NonhomogeneousField
957#endif
958}
959
960
962 fvec &DS, fvec &DSp ) const
963{
964 GetDStoParticleXY( p, DS, DSp );
965}
966
967
969{
971}
972
974 const fvec Cv[] ) const
975{
977}
978
983
988#ifdef HomogeneousField
989inline fvec KFParticleSIMD::GetDistanceFromVertex( const AliVVertex &Vtx ) const
990{
992}
993
994inline fvec KFParticleSIMD::GetDeviationFromVertex( const AliVVertex &Vtx ) const
995{
997}
998#endif
1003
1008
1013
1018
1019#ifdef HomogeneousField
1020inline fvec KFParticleSIMD::GetFieldAlice()
1021{
1022 return fgBz;
1023}
1024#endif
1025
1026#ifdef HomogeneousField
1027inline void KFParticleSIMD::GetFieldValue( const fvec * /*xyz*/, fvec B[] ) const
1028{
1029 B[0] = B[1] = 0;
1030 B[2] = GetFieldAlice();
1031}
1032#endif
1033
1034#ifdef NonhomogeneousField
1035inline void KFParticleSIMD::GetFieldValue( const fvec xyz[], fvec B[] ) const
1036{
1037 L1FieldValue mB = const_cast<L1FieldRegion&>(fField).Get(xyz[2]);
1038 B[0] = mB.x;
1039 B[1] = mB.y;
1040 B[2] = mB.z;
1041}
1042#endif
1043
1045 fvec &DS, fvec &DSp )const
1046{
1047 GetDStoParticleXY( p, DS, DSp );
1048}
1049
1051 fvec &DS, fvec &DSp ) const
1052{
1053#ifdef HomogeneousField
1054 KFParticleBaseSIMD::GetDStoParticleBz( GetFieldAlice(), p, DS, DSp ) ;
1055#endif
1056#ifdef NonhomogeneousField
1058#endif
1059 //GetDStoParticleALICE( p, DS, DSp ) ;
1060}
1061
1062inline void KFParticleSIMD::Transport( fvec dS, fvec P[], fvec C[] ) const
1063{
1064#ifdef HomogeneousField
1065 KFParticleBaseSIMD::TransportBz( GetFieldAlice(), dS, P, C );
1066#endif
1067#ifdef NonhomogeneousField
1069#endif
1070}
1071
1073 const KFParticleSIMD &daughter2 )
1074{
1075#ifdef HomogeneousField
1076 KFParticleBaseSIMD::ConstructGammaBz( daughter1, daughter2, GetFieldAlice() );
1077#endif
1078}
1079
1080#endif
#define NonhomogeneousField
friend F32vec4 sqrt(const F32vec4 &a)
Definition P4_F32vec4.h:34
friend F32vec4 fabs(const F32vec4 &a)
Definition P4_F32vec4.h:52
__m128 v
Definition P4_F32vec4.h:1
int i
Definition P4_F32vec4.h:22
void GetDStoParticleBz(fvec Bz, const KFParticleBaseSIMD &p, fvec &dS, fvec &dS1) const
void SubtractFromParticle(KFParticleBaseSIMD &Vtx) const
const fvec & Q() const
fvec & Covariance(Int_t i)
void ConstructGammaBz(const KFParticleBaseSIMD &daughter1, const KFParticleBaseSIMD &daughter2, fvec Bz)
fvec GetDeviationFromParticle(const KFParticleBaseSIMD &p) const
fvec GetDistanceFromParticle(const KFParticleBaseSIMD &p) const
void operator+=(const KFParticleBaseSIMD &Daughter)
fvec & Parameter(Int_t i)
fvec GetMomentum(fvec &P, fvec &SigmaP) const
const fvec & S() const
const fvec & Px() const
void SetMassConstraint(fvec Mass, fvec SigmaMass=0)
fvec GetR(fvec &R, fvec &SigmaR) const
const fvec & Py() const
void AddDaughter(const KFParticleBaseSIMD &Daughter, Bool_t isAtVtxGuess=0)
const fvec & E() const
const fvec & Pz() const
fvec GetDistanceFromVertex(const fvec vtx[]) const
const fvec & X() const
void TransportCBM(fvec dS, fvec P[], fvec C[]) const
fvec GetDecayLength(fvec &L, fvec &SigmaL) const
fvec GetDecayLengthXY(fvec &L, fvec &SigmaL) const
void SetVtxGuess(fvec x, fvec y, fvec z)
fvec GetCovariance(Int_t i) const
fvec GetDeviationFromVertex(const fvec v[], const fvec Cv[]=0) const
fvec GetLifeTime(fvec &T, fvec &SigmaT) const
void GetDStoParticleCBM(const KFParticleBaseSIMD &p, fvec &dS, fvec &dS1) const
fvec GetDStoPointCBM(const fvec xyz[]) const
fvec GetDStoPointBz(fvec Bz, const fvec xyz[]) const
const fvec & Y() const
void SetProductionVertex(const KFParticleBaseSIMD &Vtx)
void Construct(const KFParticleBaseSIMD *vDaughters[], Int_t nDaughters, const KFParticleBaseSIMD *ProdVtx=0, Float_t Mass=-1, Bool_t IsConstrained=0, Bool_t isAtVtxGuess=0)
fvec GetParameter(Int_t i) const
fvec GetPt(fvec &Pt, fvec &SigmaPt) const
void SubtractFromVertex(KFParticleBaseSIMD &Vtx) const
void TransportBz(fvec Bz, fvec dS, fvec P[], fvec C[]) const
fvec GetPhi(fvec &Phi, fvec &SigmaPhi) const
const fvec & NDF() const
const fvec & Chi2() const
fvec GetEta(fvec &Eta, fvec &SigmaEta) const
fvec GetMass(fvec &M, fvec &SigmaM) const
const fvec & Z() const
fvec GetDistanceFromParticleXY(const KFParticleSIMD &p) const
fvec GetErrPz() const
fvec GetPz() const
fvec GetQ() const
fvec GetPhi() const
fvec GetCovariance(int i) const
const fvec & S() const
fvec GetPy() const
fvec GetNDF() const
fvec GetErrP() const
void TransportToDecayVertex()
fvec GetAngle(const KFParticleSIMD &p) const
void TransportToDS(fvec dS)
fvec GetZ() const
fvec GetChi2() const
void GetFieldValue(const fvec xyz[], fvec B[]) const
fvec GetDeviationFromVertexXY(const fvec v[], const fvec Cv[]=0) const
void SubtractFromParticle(KFParticleSIMD &v) const
void GetDStoParticle(const KFParticleSIMD &p, fvec &DS, fvec &DSp) const
void Construct(const KFParticleSIMD *vDaughters[], int nDaughters, const KFParticleSIMD *ProdVtx=0, Float_t Mass=-1, Bool_t IsConstrained=0, Bool_t isAtVtxGuess=0)
fvec GetErrY() const
fvec GetDStoPoint(const fvec xyz[]) const
void Create(const fvec Param[], const fvec Cov[], Int_t Charge, fvec mass)
fvec GetDeviationFromVertex(const fvec v[], const fvec Cv[]=0) const
static void GetExternalTrackParam(const KFParticleBaseSIMD &p, fvec &X, fvec &Alpha, fvec P[5])
fvec GetPx() const
fvec GetDistanceFromParticle(const KFParticleSIMD &p) const
const fvec & Px() const
void SubtractFromVertex(KFParticleSIMD &v) const
void SetProductionVertex(const KFParticleSIMD &Vtx)
fvec GetPt() const
fvec GetR() const
const fvec & Y() const
void TransportToProductionVertex()
const fvec & E() const
fvec GetErrZ() const
fvec GetErrPt() const
void Transport(fvec dS, fvec P[], fvec C[]) const
fvec & Parameter(int i)
const fvec & Z() const
fvec GetErrS() const
void TransportToParticle(const KFParticleSIMD &p)
fvec GetMomentum() const
void operator+=(const KFParticleSIMD &Daughter)
fvec GetDeviationFromParticle(const KFParticleSIMD &p) const
fvec GetErrEta() const
fvec GetX() const
fvec GetDeviationFromParticleXY(const KFParticleSIMD &p) const
fvec GetAngleRZ(const KFParticleSIMD &p) const
fvec GetLifeTime() const
fvec GetAngleXY(const KFParticleSIMD &p) const
fvec GetErrMass() const
const fvec & NDF() const
const fvec & X() const
fvec GetPseudoProperDecayTime(const KFParticleSIMD &primVertex, const fvec &mass, fvec *timeErr2=0) const
const fvec & Q() const
fvec GetErrLifeTime() const
void SetVtxGuess(fvec x, fvec y, fvec z)
fvec GetEta() const
fvec GetErrMomentum() const
fvec GetErrPx() const
fvec GetE() const
fvec GetErrX() const
fvec GetErrPy() const
void TransportToPoint(const fvec xyz[])
Bool_t GetAtProductionVertex() const
fvec GetMass() const
const fvec & Pz() const
fvec * CovarianceMatrix()
fvec GetErrR() const
const fvec & Py() const
void GetKFParticle(KFParticle &Part, int iPart=0)
fvec GetY() const
fvec GetDistanceFromVertex(const fvec vtx[]) const
fvec GetDistanceFromVertexXY(const fvec vtx[], fvec &val, fvec &err) const
fvec & Covariance(int i)
void ConstructGamma(const KFParticleSIMD &daughter1, const KFParticleSIMD &daughter2)
fvec GetP() const
fvec GetParameter(int i) const
const fvec & Chi2() const
void SetField(const L1FieldRegion &field, bool isOneEntry=0, const int iVec=0)
fvec GetDecayLengthXY() const
fvec GetS() const
void GetDStoParticleXY(const KFParticleBaseSIMD &p, fvec &DS, fvec &DSp) const
void SetMassConstraint(fvec Mass, fvec SigmaMass=0)
fvec GetErrPhi() const
fvec GetErrDecayLengthXY() const
fvec GetErrDecayLength() const
fvec GetDecayLength() const
void AddDaughter(const KFParticleSIMD &Daughter)
fvec GetErrE() const
void SetOneEntry(const int i0, const L1FieldRegion &f1, const int i1)
Definition L1Field.h:176
L1FieldValue Get(const fvec z)
Definition L1Field.h:106
void Set(const L1FieldValue &B0, const fvec B0z, const L1FieldValue &B1, const fvec B1z, const L1FieldValue &B2, const fvec B2z)
Definition L1Field.h:116