10 #include "../L1/L1Algo/vectors/P4_F32vec4.h"
11 #include <emmintrin.h>
16 unsigned short int indmax,
22 Int_t *intX, *intY, *intR;
25 unsigned short int iH11, iH12, iH13, iH14, iH2, iH3;
26 Int_t nofHitsNorm =
fHitInd[0].size() + 1;
30 Float_t dx = 1.0f /
fDx, dy = 1.0f /
fDy, dr = 1.0f /
fDr;
37 fvec rx0, rx1, rx2, ry0, ry1, ry2;
38 fvec t5, t10, t19, det, t6, t7;
39 fvec iH1X, iH1Y, iH2X, iH2Y, iH3X, iH3Y;
42 __m128i intXv, intYv, intRv, indXYv;
43 __m128i fNofBinsXv = _mm_set1_epi32(
fNofBinsX);
44 __m128i fNofBinsXYv = _mm_set1_epi32(
fNofBinsXY + 1);
45 __m128i m128i_0 = _mm_set1_epi32(0);
48 __m128i fNofBinsRv = _mm_set1_epi32(
fNofBinsR + 1);
49 __m128i m128i_10 = _mm_set1_epi32(10);
54 Int_t nofHits =
fHitInd[iPart].size();
56 iPmulNofHits = iPart * nofHitsNorm;
58 vector<unsigned short> hitIndPart;
63 for (
unsigned short int iHit1 = 0; iHit1 < (nofHits & ~3); iHit1 += 4) {
64 iH11 = hitIndPart[iHit1];
65 iH12 = hitIndPart[iHit1 + 1];
66 iH13 = hitIndPart[iHit1 + 2];
67 iH14 = hitIndPart[iHit1 + 3];
74 for (
unsigned short int iHit2 = iHit1 + 1; iHit2 < nofHits; iHit2++) {
75 iH2 = hitIndPart[iHit2];
82 r12 = rx0 * rx0 + ry0 * ry0;
83 if (_mm_comineq_ss(_mm_cmpgt_ss(r12, fMinDistanceSqv), fvec0) == 1)
85 if (_mm_comineq_ss(_mm_cmplt_ss(r12, fMaxDistanceSqv), fvec0) == 1)
90 fData[iH12]->fX2plusY2 -
fData[iH2]->fX2plusY2,
91 fData[iH13]->fX2plusY2 -
fData[iH2]->fX2plusY2,
92 fData[iH14]->fX2plusY2 -
fData[iH2]->fX2plusY2);
93 for (
unsigned short int iHit3 = iHit2 + 1; iHit3 < nofHits; iHit3++) {
95 h3 =
fDataV[hitIndPart[iHit3]];
102 r13 = rx1 * rx1 + ry1 * ry1;
103 if (_mm_comineq_ss(_mm_cmpgt_ss(r13, fMinDistanceSqv), fvec0) == 1)
105 if (_mm_comineq_ss(_mm_cmplt_ss(r13, fMaxDistanceSqv), fvec0) == 1)
110 r23 = rx2 * rx2 + ry2 * ry2;
111 if (_mm_comineq_ss(_mm_cmpgt_ss(r23, fMinDistanceSqv), fvec0) == 1)
113 if (_mm_comineq_ss(_mm_cmplt_ss(r23, fMaxDistanceSqv), fvec0) == 1)
116 t19 = fvec05 / (rx2 * ry0 - rx0 * ry2);
118 xc = (t5 * ry0 - t10 * ry2) * t19;
119 xcs = xc - fCurMinXV;
123 yc = (t10 * rx2 - t5 * rx0) * t19;
124 ycs = yc - fCurMinYV;
131 r =
sqrt(t6 * t6 + t7 * t7);
139 intRv = _mm_cvtps_epi32(r * drv);
143 intXv = _mm_cvtps_epi32(xcs * dxv);
144 intYv = _mm_cvtps_epi32(ycs * dyv);
145 indXYv = intXv * fNofBinsXv + intYv;
151 indXY = (
int*) &indXYv;
152 intR = (
int*) &intRv;
154 if (intR[0] > 9 && intR[0] <
fNofBinsR && indXY[0] > -1
159 if (intR[1] > 9 && intR[1] <
fNofBinsR && indXY[1] > -1
165 if (intR[2] > 9 && intR[2] <
fNofBinsR && indXY[2] > -1
171 if (intR[3] > 9 && intR[3] <
fNofBinsR && indXY[3] > -1
183 Int_t indmin, indmax;
188 for (UInt_t iHit = 0; iHit <
fData.size(); iHit++) {
196 for (UInt_t iHit = 0; iHit <
fData.size(); iHit++) {
197 if (
fData[iHit].fIsUsed ==
true)
continue;