9 #include "../L1/L1Algo/vectors/P4_F32vec4.h"
10 #include <emmintrin.h>
19 unsigned short int indmin,
20 unsigned short int indmax,
27 register Int_t* intX, *intY, *intR;
28 register Int_t* indXY;
30 register unsigned short int iH11, iH12, iH13, iH14, iH2, iH3;
31 register Int_t nofHitsNorm =
fHitInd[0].size() + 1;
32 register Int_t iPmulNofHits;
42 fvec rx0, rx1, rx2, ry0, ry1,ry2;
43 fvec t5, t10, t19, det, t6, t7;
44 fvec iH1X, iH1Y, iH2X, iH2Y, iH3X, iH3Y;
47 __m128i intXv, intYv, intRv, indXYv;
48 __m128i fNofBinsXv = _mm_set1_epi32(
fNofBinsX);
49 __m128i fNofBinsXYv = _mm_set1_epi32(
fNofBinsXY + 1);
50 __m128i m128i_0 = _mm_set1_epi32(0);
53 __m128i fNofBinsRv = _mm_set1_epi32(
fNofBinsR + 1);
54 __m128i m128i_10 = _mm_set1_epi32(10);
56 fvec dxv = fvec(1.0f/
fDx), dyv = fvec(1.0f/
fDy), drv = fvec(1.0f/
fDr);
57 fvec fvec05 = fvec(0.5f);
58 fvec fvec0 = fvec(0.f);
59 Int_t nofHits =
fHitInd[iPart].size();
61 iPmulNofHits = iPart * nofHitsNorm;
63 vector<unsigned short> hitIndPart;
68 for (
unsigned short int iHit1 = 0; iHit1 < (nofHits & ~3); iHit1+=4) {
69 iH11 = hitIndPart[iHit1];
70 iH12 = hitIndPart[iHit1+1];
71 iH13 = hitIndPart[iHit1+2];
72 iH14 = hitIndPart[iHit1+3];
77 for (
unsigned short int iHit2 = iHit1 + 1; iHit2 < nofHits; iHit2++) {
78 iH2 = hitIndPart[iHit2];
85 r12 = rx0 * rx0 + ry0 * ry0;
86 if ( _mm_comineq_ss(_mm_cmpgt_ss(r12, fMinDistanceSqv), fvec0) == 1)
continue;
87 if ( _mm_comineq_ss(_mm_cmplt_ss(r12, fMaxDistanceSqv), fvec0) == 1)
continue;
90 t10 = fvec(
fData[iH11]->fX2plusY2 -
fData[iH2]->fX2plusY2,
91 fData[iH12]->fX2plusY2 -
fData[iH2]->fX2plusY2,
92 fData[iH13]->fX2plusY2 -
fData[iH2]->fX2plusY2,
93 fData[iH14]->fX2plusY2 -
fData[iH2]->fX2plusY2);
94 for (
unsigned short int iHit3 = iHit2 + 1; iHit3 < nofHits; iHit3++) {
96 h3 =
fDataV[ hitIndPart[iHit3] ];
103 r13 = rx1 * rx1 + ry1 * ry1;
104 if ( _mm_comineq_ss(_mm_cmpgt_ss(r13, fMinDistanceSqv), fvec0) == 1)
continue;
105 if ( _mm_comineq_ss(_mm_cmplt_ss(r13, fMaxDistanceSqv), fvec0) == 1)
continue;
109 r23 = rx2 * rx2 + ry2 * ry2;
110 if ( _mm_comineq_ss(_mm_cmpgt_ss(r23, fMinDistanceSqv), fvec0) == 1)
continue;
111 if ( _mm_comineq_ss(_mm_cmplt_ss(r23, fMaxDistanceSqv), fvec0) == 1)
continue;
113 t19 = fvec05 / (rx2*ry0 - rx0*ry2);
115 xc = (t5 * ry0 - t10 * ry2) * t19;
116 xcs = xc - fCurMinXV;
120 yc = (t10 * rx2 - t5 * rx0) * t19;
121 ycs = yc - fCurMinYV;
128 r = sqrt(t6 * t6 + t7 * t7);
136 intRv = _mm_cvtps_epi32(r *drv);
140 intXv = _mm_cvtps_epi32(xcs *dxv);
141 intYv = _mm_cvtps_epi32(ycs *dyv);
142 indXYv = intXv * fNofBinsXv + intYv;
148 indXY = (
int*)&indXYv;
151 if (intR[0] > 9 && intR[0] <
fNofBinsR &&
156 if (intR[1] > 9 && intR[1] <
fNofBinsR &&
162 if (intR[2] > 9 && intR[2] <
fNofBinsR &&
168 if (intR[3] > 9 && intR[3] <
fNofBinsR &&
182 Int_t indmin, indmax;
187 for (UInt_t iHit = 0; iHit <
fData.size(); iHit++){
195 for (UInt_t iHit = 0; iHit <
fData.size(); iHit++)
197 if (
fData[iHit].fIsUsed ==
true)
continue;