22 #ifndef KFPTrackVector_H
23 #define KFPTrackVector_H
53 KFPTrackVector():
fId(),
fPDG(),
fQ(),
fPVIndex(),
fNPixelHits(),
fNE(0),
fNMu(0),
fNPi(0),
fNK(0),
fNP(0),
fND(0),
fNT(0),
fNHe3(0),
fNHe4(0) { }
57 int Size()
const {
return fP[0].size(); }
60 const int&
size =
fP[0].size();
62 const int dataSize = size * 32
63 #ifdef NonhomogeneousField
84 #ifdef NonhomogeneousField
85 const kfvector_float& FieldCoefficient(
const int i)
const {
return fField[
i]; }
94 float Pt(
const int n)
const {
return sqrt(
fP[3][n]*
fP[3][n]+
fP[4][n]*
fP[4][n]); }
95 float P(
const int n)
const {
return sqrt(
fP[3][n]*
fP[3][n]+
fP[4][n]*
fP[4][n]+
fP[5][n]*
fP[5][n]); }
104 #ifdef NonhomogeneousField
105 void SetFieldCoefficient(
float value,
int iP,
int iTr) { fField[iP][iTr] =
value; }
128 switch (abs(
fPDG[
i]))
130 case 11:
fNE++;
break;
131 case 13:
fNMu++;
break;
132 case 19:
fNMu++;
break;
133 case 211:
fNPi++;
break;
134 case 1:
fNPi++;
break;
135 case 3:
fNPi++;
break;
136 case 321:
fNK++;
break;
137 case 2212:
fNP++;
break;
138 case 1000010020:
fND++;
break;
139 case 1000010030:
fNT++;
break;
140 case 1000020030:
fNHe3++;
break;
141 case 1000020040:
fNHe4++;
break;
195 const int localSize = track.
Size();
197 for(
int i=0;
i<6;
i++)
199 fP[
i].resize(localSize);
200 for(
int n=0;
n<localSize;
n++)
204 for(
int i=0;
i<21;
i++)
206 fC[
i].resize(localSize);
207 for(
int n=0;
n<localSize;
n++)
211 #ifdef NonhomogeneousField
212 for(
int i=0;
i<10;
i++)
214 fField[
i].resize(localSize);
215 for(
int n=0;
n<localSize;
n++)
216 fField[
i][
n] = track.fField[
i][
n];
220 fId.resize(localSize);
221 for(
int n=0;
n<localSize;
n++)
224 fPDG.resize(localSize);
225 for(
int n=0;
n<localSize;
n++)
228 fQ.resize(localSize);
229 for(
int n=0;
n<localSize;
n++)
233 for(
int n=0;
n<localSize;
n++)
237 for(
int n=0;
n<localSize;
n++)
263 for(
int iP=0; iP<6; iP++)
265 memcpy( &(data[offset]), &(
fP[iP][0]),
Size()*
sizeof(
float));
269 for(
int iC=0; iC<21; iC++)
271 memcpy( &(data[offset]), &(
fC[iC][0]),
Size()*
sizeof(
float));
275 memcpy( &(data[offset]), &(
fId[0]),
Size()*
sizeof(
float));
278 memcpy( &(data[offset]), &(
fPDG[0]),
Size()*
sizeof(
float));
281 memcpy( &(data[offset]), &(
fQ[0]),
Size()*
sizeof(
float));
284 memcpy( &(data[offset]), &(
fPVIndex[0]),
Size()*
sizeof(
float));
290 #ifdef NonhomogeneousField
291 for(
int iF=0; iF<10; iF++)
293 memcpy( &(data[offset]), &(fField[iF][0]),
Size()*
sizeof(
float));
319 for(
int iP=0; iP<6; iP++)
321 memcpy( &(
fP[iP][0]), &(data[offset]),
Size()*
sizeof(
float));
325 for(
int iC=0; iC<21; iC++)
327 memcpy( &(
fC[iC][0]), &(data[offset]),
Size()*
sizeof(
float));
331 memcpy( &(
fId[0]), &(data[offset]),
Size()*
sizeof(
float));
334 memcpy( &(
fPDG[0]), &(data[offset]),
Size()*
sizeof(
float));
337 memcpy( &(
fQ[0]), &(data[offset]),
Size()*
sizeof(
float));
340 memcpy( &(
fPVIndex[0]), &(data[offset]),
Size()*
sizeof(
float));
346 #ifdef NonhomogeneousField
347 for(
int iF=0; iF<10; iF++)
349 memcpy( &(fField[iF][0]), &(data[offset]),
Size()*
sizeof(
float));
365 void *
operator new(
size_t size) {
return _mm_malloc(
size,
sizeof(float_v)); }
366 void *
operator new[](
size_t size) {
return _mm_malloc(
size,
sizeof(float_v)); }
367 void *
operator new(
size_t size,
void *ptr) { return ::operator
new(
size, ptr);}
368 void *
operator new[](
size_t size,
void *ptr) { return ::operator
new(
size, ptr);}
369 void operator delete(
void *ptr, size_t) { _mm_free(ptr); }
370 void operator delete[](
void *ptr, size_t) { _mm_free(ptr); }
391 #ifdef NonhomogeneousField