BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmKFParticle_simd.h
Go to the documentation of this file.
1/** The CbmKFParticle_simd class
2 *
3 * @author S.Gorbunov, I.Kisel
4 * @version 1.0
5 * @since 24.11.06
6 *
7 * Class to fit decayed particle with the Kalman Filter method
8 *
9 */
10#ifndef CBMKFPARTICLE_SIMD_H
11#define CBMKFPARTICLE_SIMD_H
12
13#include "CbmKFTrackInterface.h"
15class CbmKFParticle;
16
17#include "CbmL1Def.h"
18#include "L1Field.h"
19
20#include <vector>
21
22using namespace std;
23
25{
26
27 public:
28 void* operator new(size_t bytes) { return _mm_malloc(bytes, 16); }
29 void operator delete(void* p) { _mm_free(p); }
30
31 public:
33 CbmKFParticle_simd(CbmKFTrackInterface* Track[], Int_t* qHypo = 0, const Int_t* pdg = 0);
34 CbmKFParticle_simd(CbmKFTrackInterface& Track, Int_t* qHypo = 0, const Int_t* pdg = 0);
37
39
40 // Construction
41 void Create(CbmKFTrackInterface* Track[], int Ntracks = fvecLen, Int_t* qHypo = 0, const Int_t* pdg = 0);
42 void Create(CbmKFParticle* part[], int N = fvecLen);
43
44 // Accessors
45
46 //* Simple accessors
47 fvec GetX() const { return r[0]; }
48 fvec GetY() const { return r[1]; }
49 fvec GetZ() const { return r[2]; }
50 fvec GetPx() const { return r[3]; }
51 fvec GetPy() const { return r[4]; }
52 fvec GetPz() const { return r[5]; }
53 fvec GetE() const { return r[6]; }
54 fvec GetS() const { return r[7]; }
55 fvec GetQ() const { return Q; }
56 fvec GetChi2() const { return Chi2; }
57 fvec GetNDF() const { return NDF; }
58 fvec* GetParameters() { return r; }
59 const fvec* GetParameters() const { return r; }
60 fvec* GetCovMatrix() { return C; }
61 fvec GetParameter(Int_t i) const { return r[i]; }
62 fvec GetCovariance(Int_t i) const { return C[i]; }
63
64 // fvec GetParameter ( Int_t i ) const { return r[i]; }
65 // fvec GetCovariance( Int_t i ) const { return C[i]; }
66 // fvec GetCovariance( Int_t i, Int_t j ) const { return C[IJ(i,j)]; }
67
68 fvec GetVtxGuess(int i) const { return fVtxGuess[i]; }
69 fvec GetVtxErrGuess(int i) const { return fVtxErrGuess[i]; }
70 fvec* GetVtxGuess() { return fVtxGuess; }
72
73 //*
74 //* MODIFIERS
75 //*
76
77 fvec& rX() { return r[0]; }
78 fvec& rY() { return r[1]; }
79 fvec& rZ() { return r[2]; }
80 fvec& rPx() { return r[3]; }
81 fvec& rPy() { return r[4]; }
82 fvec& rPz() { return r[5]; }
83 fvec& rE() { return r[6]; }
84 fvec& rS() { return r[7]; }
85 fvec& rQ() { return Q; }
86 fvec& rChi2() { return Chi2; }
87 fvec& rNDF() { return NDF; }
88
89 // fvec & rParameter ( Int_t i ) { return r[i]; }
90 // fvec & rCovariance( Int_t i ) { return C[i]; }
91 // fvec & rCovariance( Int_t i, Int_t j ) { return C[IJ(i,j)]; }
92
93 //* Accessor with calculations
94
95 void GetKFTrack(CbmKFTrackInterface** Track);
96
97 fvec GetTx() const { return r[3] / r[5]; }
98 fvec GetTy() const { return r[4] / r[5]; }
99
100 void GetMomentum(fvec& P, fvec& Error);
101 void GetMass(fvec& M, fvec& Error);
102 void GetDecayLength(fvec& L, fvec& Error);
103 void GetLifeTime(fvec& T, fvec& Error);
104
105 fvec GetRapidity() const { return 0.5 * log((r[6] + r[5]) / (r[6] - r[5])); }
106 fvec GetPt() const { return sqrt(r[3] * r[3] + r[4] * r[4]); }
107 fvec GetTheta() const { return atan2(GetPt(), r[5]); }
108 fvec GetPhi() const { return atan2(r[4], r[5]); }
109
110 void SetVtxGuess(fvec& x, fvec& y, fvec& z);
111 void SetVtxErrGuess(fvec& d_x, fvec& d_y, fvec& d_z);
112
113 void SetField();
115 void SetField(const L1FieldRegion& field, bool isOneEntry = 0, const int iVec = 0);
116
117 void SetPDG(fvec pdg) { fPDG = pdg; }
118 const fvec& GetPDG() const { return fPDG; }
119
120 void SetId(fvec id) { fId = id; };
121 void SetNDaughters(int n) { fDaughterIds.reserve(n); }
122 void AddDaughterId(fvec id) { fDaughterIds.push_back(id); };
123 void CleanDaughtersId() { fDaughterIds.clear(); }
124
125 fvec Id() const { return fId; };
126 int NDaughters() const { return fDaughterIds.size(); };
127 vector<fvec>& DaughterIds() { return fDaughterIds; };
128
129 private:
130 fvec fId; // id of particle
131 vector<fvec> fDaughterIds; // id of particles it created from. if size == 1 then this is id of track.
132
133 public:
134 fvec r[8];
135 fvec C[36];
138
141
142 fvec fPDG; // PDG hypothesis
143
147
149
151#endif /* !CBMKFPARTICLE_H */
const int fvecLen
Definition P4_F32vec4.h:233
#define _fvecalignment
Definition P4_F32vec4.h:236
int i
Definition P4_F32vec4.h:22
F32vec4 fvec
Definition P4_F32vec4.h:231
int Int_t
void Error(const char *location, const char *msgfmt,...)
void Create(CbmKFTrackInterface *Track[], int Ntracks=fvecLen, Int_t *qHypo=0, const Int_t *pdg=0)
void GetDecayLength(fvec &L, fvec &Error)
void SetVtxErrGuess(fvec &d_x, fvec &d_y, fvec &d_z)
void SetField(CbmKFTrackInterface **Track)
fvec GetVtxGuess(int i) const
void GetMomentum(fvec &P, fvec &Error)
void AddDaughterId(fvec id)
fvec GetCovariance(Int_t i) const
void SetVtxGuess(fvec &x, fvec &y, fvec &z)
const fvec * GetParameters() const
const fvec & GetPDG() const
vector< fvec > fDaughterIds
void GetMass(fvec &M, fvec &Error)
fvec GetParameter(Int_t i) const
fvec GetVtxErrGuess(int i) const
void GetKFTrack(CbmKFTrackInterface **Track)
vector< fvec > & DaughterIds()
void GetLifeTime(fvec &T, fvec &Error)
RVec< PromoteType< T > > log(const RVec< T > &v)
RVec< PromoteType< T > > sqrt(const RVec< T > &v)
RVec< PromoteTypes< T0, T1 > > atan2(const RVec< T0 > &v, const T1 &y)
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362
Definition json.hpp:4446