29 for (
int n = 0;
n <
NN; ++
n) {
30 const float cosA = (psPar[0 *
N +
n] * psPar[3 *
N +
n] + psPar[1 *
N +
n] * psPar[4 *
N +
n]) /
31 (
std::sqrt((psPar[0 *
N +
n] * psPar[0 *
N +
n] + psPar[1 *
N +
n] * psPar[1 *
N +
n]) *
32 (psPar[3 *
N +
n] * psPar[3 *
N +
n] + psPar[4 *
N +
n] * psPar[4 *
N +
n])));
33 const float dr = (
hipo(msPar[0 *
N +
n], msPar[1 *
N +
n]) -
hipo(psPar[0 *
N +
n], psPar[1 *
N +
n])) / cosA;
35 dprint_np(
n,
"propagateLineToRMPlex dr=" << dr);
37 const float pt =
hipo(psPar[3 *
N +
n], psPar[4 *
N +
n]);
38 const float p = dr /
pt;
39 const float psq =
p *
p;
41 outPar[0 *
N +
n] = psPar[0 *
N +
n] +
p * psPar[3 *
N +
n];
42 outPar[1 *
N +
n] = psPar[1 *
N +
n] +
p * psPar[4 *
N +
n];
43 outPar[2 *
N +
n] = psPar[2 *
N +
n] +
p * psPar[5 *
N +
n];
44 outPar[3 *
N +
n] = psPar[3 *
N +
n];
45 outPar[4 *
N +
n] = psPar[4 *
N +
n];
46 outPar[5 *
N +
n] = psPar[5 *
N +
n];
52 B.fArray[0 *
N +
n] =
A.fArray[0 *
N +
n];
53 B.fArray[1 *
N +
n] =
A.fArray[1 *
N +
n];
54 B.fArray[2 *
N +
n] =
A.fArray[2 *
N +
n];
55 B.fArray[3 *
N +
n] =
A.fArray[3 *
N +
n];
56 B.fArray[4 *
N +
n] =
A.fArray[4 *
N +
n];
57 B.fArray[5 *
N +
n] =
A.fArray[5 *
N +
n];
58 B.fArray[6 *
N +
n] =
A.fArray[6 *
N +
n] +
p *
A.fArray[0 *
N +
n];
59 B.fArray[7 *
N +
n] =
A.fArray[7 *
N +
n] +
p *
A.fArray[1 *
N +
n];
60 B.fArray[8 *
N +
n] =
A.fArray[8 *
N +
n] +
p *
A.fArray[3 *
N +
n];
62 A.fArray[9 *
N +
n] +
p * (
A.fArray[6 *
N +
n] +
A.fArray[6 *
N +
n]) + psq *
A.fArray[0 *
N +
n];
63 B.fArray[10 *
N +
n] =
A.fArray[10 *
N +
n] +
p *
A.fArray[1 *
N +
n];
64 B.fArray[11 *
N +
n] =
A.fArray[11 *
N +
n] +
p *
A.fArray[2 *
N +
n];
65 B.fArray[12 *
N +
n] =
A.fArray[12 *
N +
n] +
p *
A.fArray[4 *
N +
n];
66 B.fArray[13 *
N +
n] =
67 A.fArray[13 *
N +
n] +
p * (
A.fArray[7 *
N +
n] +
A.fArray[10 *
N +
n]) + psq *
A.fArray[1 *
N +
n];
68 B.fArray[14 *
N +
n] =
69 A.fArray[14 *
N +
n] +
p * (
A.fArray[11 *
N +
n] +
A.fArray[11 *
N +
n]) + psq *
A.fArray[2 *
N +
n];
70 B.fArray[15 *
N +
n] =
A.fArray[15 *
N +
n] +
p *
A.fArray[3 *
N +
n];
71 B.fArray[16 *
N +
n] =
A.fArray[16 *
N +
n] +
p *
A.fArray[4 *
N +
n];
72 B.fArray[17 *
N +
n] =
A.fArray[17 *
N +
n] +
p *
A.fArray[5 *
N +
n];
73 B.fArray[18 *
N +
n] =
74 A.fArray[18 *
N +
n] +
p * (
A.fArray[8 *
N +
n] +
A.fArray[15 *
N +
n]) + psq *
A.fArray[3 *
N +
n];
75 B.fArray[19 *
N +
n] =
76 A.fArray[19 *
N +
n] +
p * (
A.fArray[12 *
N +
n] +
A.fArray[16 *
N +
n]) + psq *
A.fArray[4 *
N +
n];
77 B.fArray[20 *
N +
n] =
78 A.fArray[20 *
N +
n] +
p * (
A.fArray[17 *
N +
n] +
A.fArray[17 *
N +
n]) + psq *
A.fArray[5 *
N +
n];
81 dprint_np(
n,
"propagateLineToRMPlex arrive at r=" <<
hipo(outPar[0 *
N +
n], outPar[1 *
N +
n]));
92 using namespace mkfit;
100 const T*
a =
A.fArray;
102 const T*
b =
B.fArray;
107 #include "MultHelixProp.ah" 116 const T*
a =
A.fArray;
118 const T*
b =
B.fArray;
123 #include "MultHelixPropTransp.ah" 132 const T*
a =
A.fArray;
134 const T*
b =
B.fArray;
139 c[0 *
N +
n] =
a[0 *
N +
n] *
b[0 *
N +
n] +
a[1 *
N +
n] *
b[6 *
N +
n] +
a[2 *
N +
n] *
b[12 *
N +
n] +
140 a[4 *
N +
n] *
b[24 *
N +
n];
141 c[1 *
N +
n] =
a[0 *
N +
n] *
b[1 *
N +
n] +
a[1 *
N +
n] *
b[7 *
N +
n] +
a[2 *
N +
n] *
b[13 *
N +
n] +
142 a[4 *
N +
n] *
b[25 *
N +
n];
143 c[2 *
N +
n] =
a[2 *
N +
n];
144 c[3 *
N +
n] =
a[0 *
N +
n] *
b[3 *
N +
n] +
a[1 *
N +
n] *
b[9 *
N +
n] +
a[2 *
N +
n] *
b[15 *
N +
n] +
145 a[3 *
N +
n] +
a[4 *
N +
n] *
b[27 *
N +
n];
146 c[4 *
N +
n] =
a[0 *
N +
n] *
b[4 *
N +
n] +
a[1 *
N +
n] *
b[10 *
N +
n] +
a[4 *
N +
n];
147 c[5 *
N +
n] =
a[2 *
N +
n] *
b[17 *
N +
n] +
a[5 *
N +
n];
148 c[6 *
N +
n] =
a[6 *
N +
n] *
b[0 *
N +
n] +
a[7 *
N +
n] *
b[6 *
N +
n] +
a[8 *
N +
n] *
b[12 *
N +
n] +
149 a[10 *
N +
n] *
b[24 *
N +
n];
150 c[7 *
N +
n] =
a[6 *
N +
n] *
b[1 *
N +
n] +
a[7 *
N +
n] *
b[7 *
N +
n] +
a[8 *
N +
n] *
b[13 *
N +
n] +
151 a[10 *
N +
n] *
b[25 *
N +
n];
152 c[8 *
N +
n] =
a[8 *
N +
n];
153 c[9 *
N +
n] =
a[6 *
N +
n] *
b[3 *
N +
n] +
a[7 *
N +
n] *
b[9 *
N +
n] +
a[8 *
N +
n] *
b[15 *
N +
n] +
154 a[9 *
N +
n] +
a[10 *
N +
n] *
b[27 *
N +
n];
155 c[10 *
N +
n] =
a[6 *
N +
n] *
b[4 *
N +
n] +
a[7 *
N +
n] *
b[10 *
N +
n] +
a[10 *
N +
n];
156 c[11 *
N +
n] =
a[8 *
N +
n] *
b[17 *
N +
n] +
a[11 *
N +
n];
157 c[12 *
N +
n] =
a[12 *
N +
n] *
b[0 *
N +
n] +
a[13 *
N +
n] *
b[6 *
N +
n] +
a[14 *
N +
n] *
b[12 *
N +
n] +
158 a[16 *
N +
n] *
b[24 *
N +
n];
159 c[13 *
N +
n] =
a[12 *
N +
n] *
b[1 *
N +
n] +
a[13 *
N +
n] *
b[7 *
N +
n] +
a[14 *
N +
n] *
b[13 *
N +
n] +
160 a[16 *
N +
n] *
b[25 *
N +
n];
161 c[14 *
N +
n] =
a[14 *
N +
n];
162 c[15 *
N +
n] =
a[12 *
N +
n] *
b[3 *
N +
n] +
a[13 *
N +
n] *
b[9 *
N +
n] +
a[14 *
N +
n] *
b[15 *
N +
n] +
163 a[15 *
N +
n] +
a[16 *
N +
n] *
b[27 *
N +
n];
164 c[16 *
N +
n] =
a[12 *
N +
n] *
b[4 *
N +
n] +
a[13 *
N +
n] *
b[10 *
N +
n] +
a[16 *
N +
n];
165 c[17 *
N +
n] =
a[14 *
N +
n] *
b[17 *
N +
n] +
a[17 *
N +
n];
166 c[18 *
N +
n] =
a[18 *
N +
n] *
b[0 *
N +
n] +
a[19 *
N +
n] *
b[6 *
N +
n] +
a[20 *
N +
n] *
b[12 *
N +
n] +
167 a[22 *
N +
n] *
b[24 *
N +
n];
168 c[19 *
N +
n] =
a[18 *
N +
n] *
b[1 *
N +
n] +
a[19 *
N +
n] *
b[7 *
N +
n] +
a[20 *
N +
n] *
b[13 *
N +
n] +
169 a[22 *
N +
n] *
b[25 *
N +
n];
170 c[20 *
N +
n] =
a[20 *
N +
n];
171 c[21 *
N +
n] =
a[18 *
N +
n] *
b[3 *
N +
n] +
a[19 *
N +
n] *
b[9 *
N +
n] +
a[20 *
N +
n] *
b[15 *
N +
n] +
172 a[21 *
N +
n] +
a[22 *
N +
n] *
b[27 *
N +
n];
173 c[22 *
N +
n] =
a[18 *
N +
n] *
b[4 *
N +
n] +
a[19 *
N +
n] *
b[10 *
N +
n] +
a[22 *
N +
n];
174 c[23 *
N +
n] =
a[20 *
N +
n] *
b[17 *
N +
n] +
a[23 *
N +
n];
175 c[24 *
N +
n] =
a[24 *
N +
n] *
b[0 *
N +
n] +
a[25 *
N +
n] *
b[6 *
N +
n] +
a[26 *
N +
n] *
b[12 *
N +
n] +
176 a[28 *
N +
n] *
b[24 *
N +
n];
177 c[25 *
N +
n] =
a[24 *
N +
n] *
b[1 *
N +
n] +
a[25 *
N +
n] *
b[7 *
N +
n] +
a[26 *
N +
n] *
b[13 *
N +
n] +
178 a[28 *
N +
n] *
b[25 *
N +
n];
179 c[26 *
N +
n] =
a[26 *
N +
n];
180 c[27 *
N +
n] =
a[24 *
N +
n] *
b[3 *
N +
n] +
a[25 *
N +
n] *
b[9 *
N +
n] +
a[26 *
N +
n] *
b[15 *
N +
n] +
181 a[27 *
N +
n] +
a[28 *
N +
n] *
b[27 *
N +
n];
182 c[28 *
N +
n] =
a[24 *
N +
n] *
b[4 *
N +
n] +
a[25 *
N +
n] *
b[10 *
N +
n] +
a[28 *
N +
n];
183 c[29 *
N +
n] =
a[26 *
N +
n] *
b[17 *
N +
n] +
a[29 *
N +
n];
184 c[30 *
N +
n] =
a[30 *
N +
n] *
b[0 *
N +
n] +
a[31 *
N +
n] *
b[6 *
N +
n] +
a[32 *
N +
n] *
b[12 *
N +
n] +
185 a[34 *
N +
n] *
b[24 *
N +
n];
186 c[31 *
N +
n] =
a[30 *
N +
n] *
b[1 *
N +
n] +
a[31 *
N +
n] *
b[7 *
N +
n] +
a[32 *
N +
n] *
b[13 *
N +
n] +
187 a[34 *
N +
n] *
b[25 *
N +
n];
188 c[32 *
N +
n] =
a[32 *
N +
n];
189 c[33 *
N +
n] =
a[30 *
N +
n] *
b[3 *
N +
n] +
a[31 *
N +
n] *
b[9 *
N +
n] +
a[32 *
N +
n] *
b[15 *
N +
n] +
190 a[33 *
N +
n] +
a[34 *
N +
n] *
b[27 *
N +
n];
191 c[34 *
N +
n] =
a[30 *
N +
n] *
b[4 *
N +
n] +
a[31 *
N +
n] *
b[10 *
N +
n] +
a[34 *
N +
n];
192 c[35 *
N +
n] =
a[32 *
N +
n] *
b[17 *
N +
n] +
a[35 *
N +
n];
207 errorProp.setVal(0.
f);
214 #if !defined(__clang__) 217 for (
int n = 0;
n <
NN; ++
n) {
219 errorProp(
n, 0, 0) = 1.f;
220 errorProp(
n, 1, 1) = 1.f;
221 errorProp(
n, 2, 2) = 1.f;
222 errorProp(
n, 3, 3) = 1.f;
223 errorProp(
n, 4, 4) = 1.f;
224 errorProp(
n, 5, 5) = 1.f;
227 const float r = msRad.constAt(
n, 0, 0);
228 float r0 =
hipo(inPar.constAt(
n, 0, 0), inPar.constAt(
n, 1, 0));
231 dprint_np(
n,
"distance less than 1mum, skip");
235 const float ipt = inPar.constAt(
n, 3, 0);
236 const float phiin = inPar.constAt(
n, 4, 0);
237 const float theta = inPar.constAt(
n, 5, 0);
240 errorPropTmp(
n, 2, 2) = 1.f;
241 errorPropTmp(
n, 3, 3) = 1.f;
242 errorPropTmp(
n, 4, 4) = 1.f;
243 errorPropTmp(
n, 5, 5) = 1.f;
245 float cosah = 0., sinah = 0.;
249 float pxin = cosP / ipt;
250 float pyin = sinP / ipt;
256 <<
"attempt propagation from r=" << r0 <<
" to r=" << r << std::endl
257 <<
"x=" << outPar.At(
n, 0, 0) <<
" y=" << outPar.At(
n, 1, 0) <<
" z=" << outPar.At(
n, 2, 0)
259 <<
" pz=" << 1.f / (ipt *
tan(
theta)) <<
" q=" << inChg.constAt(
n, 0, 0) << std::endl);
261 r0 =
hipo(outPar.constAt(
n, 0, 0), outPar.constAt(
n, 1, 0));
262 const float ialpha = (r - r0) * ipt /
k;
266 sincos4(ialpha * 0.5
f, sinah, cosah);
271 const float cosa = 1.f - 2.f * sinah * sinah;
272 const float sina = 2.f * sinah * cosah;
275 const float dadx = -outPar.At(
n, 0, 0) * ipt / (
k * r0);
276 const float dady = -outPar.At(
n, 1, 0) * ipt / (
k * r0);
277 const float dadipt = (r - r0) /
k;
279 outPar.At(
n, 0, 0) = outPar.constAt(
n, 0, 0) + 2.f *
k * sinah * (pxin * cosah - pyin * sinah);
280 outPar.At(
n, 1, 0) = outPar.constAt(
n, 1, 0) + 2.f *
k * sinah * (pyin * cosah + pxin * sinah);
281 const float pxinold = pxin;
282 pxin = pxin * cosa - pyin * sina;
283 pyin = pyin * cosa + pxinold * sina;
290 outPar.At(
n, 2, 0) = outPar.constAt(
n, 2, 0) +
k * ialpha * cosT / (ipt * sinT);
291 outPar.At(
n, 3, 0) = ipt;
292 outPar.At(
n, 4, 0) = outPar.constAt(
n, 4, 0) + ialpha;
293 outPar.At(
n, 5, 0) =
theta;
295 errorPropTmp(
n, 0, 0) = 1.f +
k * (cosP * dadx * cosa - sinP * dadx * sina) / ipt;
296 errorPropTmp(
n, 0, 1) =
k * (cosP * dady * cosa - sinP * dady * sina) / ipt;
297 errorPropTmp(
n, 0, 3) =
298 k * (cosP * (ipt * dadipt * cosa - sina) + sinP * ((1.
f - cosa) - ipt * dadipt * sina)) / (ipt * ipt);
299 errorPropTmp(
n, 0, 4) = -
k * (sinP * sina + cosP * (1.f - cosa)) / ipt;
301 errorPropTmp(
n, 1, 0) =
k * (sinP * dadx * cosa + cosP * dadx * sina) / ipt;
302 errorPropTmp(
n, 1, 1) = 1.f +
k * (sinP * dady * cosa + cosP * dady * sina) / ipt;
303 errorPropTmp(
n, 1, 3) =
304 k * (sinP * (ipt * dadipt * cosa - sina) + cosP * (ipt * dadipt * sina - (1.
f - cosa))) / (ipt * ipt);
305 errorPropTmp(
n, 1, 4) =
k * (cosP * sina - sinP * (1.f - cosa)) / ipt;
307 errorPropTmp(
n, 2, 0) =
k * cosT * dadx / (ipt * sinT);
308 errorPropTmp(
n, 2, 1) =
k * cosT * dady / (ipt * sinT);
309 errorPropTmp(
n, 2, 3) =
k * cosT * (ipt * dadipt - ialpha) / (ipt * ipt * sinT);
310 errorPropTmp(
n, 2, 5) = -
k * ialpha / (ipt * sinT * sinT);
312 errorPropTmp(
n, 4, 0) = dadx;
313 errorPropTmp(
n, 4, 1) = dady;
314 errorPropTmp(
n, 4, 3) = dadipt;
316 MultHelixPropTemp(errorProp, errorPropTmp, errorPropSwap,
n);
317 errorProp = errorPropSwap;
322 "propagation end, dump parameters" 324 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
325 <<
"mom = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 326 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 327 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
328 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
329 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
335 printf(
"%5f %5f %5f %5f %5f %5f\n",
342 printf(
"%5f %5f %5f %5f %5f %5f\n",
349 printf(
"%5f %5f %5f %5f %5f %5f\n",
356 printf(
"%5f %5f %5f %5f %5f %5f\n",
363 printf(
"%5f %5f %5f %5f %5f %5f\n",
370 printf(
"%5f %5f %5f %5f %5f %5f\n",
393 void helixAtRFromIterativeCCS_impl(
const MPlexLV& __restrict__ inPar,
394 const MPlexQI& __restrict__ inChg,
395 const MPlexQF& __restrict__ msRad,
397 MPlexLL& __restrict__ errorProp,
398 MPlexQI& __restrict__ outFailFlag,
406 for (
int n =
nmin;
n < nmax; ++
n) {
408 errorProp(
n, 0, 0) = 1.f;
409 errorProp(
n, 1, 1) = 1.f;
410 errorProp(
n, 2, 2) = 1.f;
411 errorProp(
n, 3, 3) = 1.f;
412 errorProp(
n, 4, 4) = 1.f;
413 errorProp(
n, 5, 5) = 1.f;
417 for (
int n =
nmin;
n < nmax; ++
n) {
421 float k[nmax -
nmin];
422 if (
pf.use_param_b_field) {
424 for (
int n =
nmin;
n < nmax; ++
n) {
429 for (
int n =
nmin;
n < nmax; ++
n) {
433 float r[nmax -
nmin];
435 for (
int n =
nmin;
n < nmax; ++
n) {
438 float xin[nmax -
nmin];
439 float yin[nmax -
nmin];
440 float ipt[nmax -
nmin];
441 float phiin[nmax -
nmin];
444 for (
int n =
nmin;
n < nmax; ++
n) {
450 xin[
n -
nmin] = inPar(
n, 0, 0);
451 yin[
n -
nmin] = inPar(
n, 1, 0);
452 ipt[
n -
nmin] = inPar(
n, 3, 0);
453 phiin[
n -
nmin] = inPar(
n, 4, 0);
460 for (
int n =
nmin;
n < nmax; ++
n) {
463 <<
" inPar(n, 0, 0)=" << std::setprecision(9) << inPar(
n, 0, 0) <<
" inPar(n, 1, 0)=" 464 << std::setprecision(9) << inPar(
n, 1, 0) <<
" inPar(n, 2, 0)=" << std::setprecision(9)
465 << inPar(
n, 2, 0) <<
" inPar(n, 3, 0)=" << std::setprecision(9) << inPar(
n, 3, 0)
466 <<
" inPar(n, 4, 0)=" << std::setprecision(9) << inPar(
n, 4, 0)
467 <<
" inPar(n, 5, 0)=" << std::setprecision(9) << inPar(
n, 5, 0));
470 float kinv[nmax -
nmin];
473 for (
int n =
nmin;
n < nmax; ++
n) {
477 float D[nmax -
nmin];
478 float cosa[nmax -
nmin];
479 float sina[nmax -
nmin];
480 float cosah[nmax -
nmin];
481 float sinah[nmax -
nmin];
482 float id[nmax -
nmin];
485 for (
int n =
nmin;
n < nmax; ++
n) {
490 float cosPorT[nmax -
nmin];
491 float sinPorT[nmax -
nmin];
493 for (
int n =
nmin;
n < nmax; ++
n) {
497 for (
int n =
nmin;
n < nmax; ++
n) {
501 float pxin[nmax -
nmin];
502 float pyin[nmax -
nmin];
504 for (
int n =
nmin;
n < nmax; ++
n) {
509 for (
int n =
nmin;
n < nmax; ++
n) {
511 "k=" << std::setprecision(9) <<
k[
n -
nmin] <<
" pxin=" << std::setprecision(9) << pxin[
n -
nmin]
512 <<
" pyin=" << std::setprecision(9) << pyin[
n -
nmin] <<
" cosPorT=" << std::setprecision(9)
513 << cosPorT[
n -
nmin] <<
" sinPorT=" << std::setprecision(9) << sinPorT[
n -
nmin]
514 <<
" pt=" << std::setprecision(9) <<
pt[
n -
nmin]);
517 float dDdx[nmax -
nmin];
518 float dDdy[nmax -
nmin];
519 float dDdipt[nmax -
nmin];
520 float dDdphi[nmax -
nmin];
523 for (
int n =
nmin;
n < nmax; ++
n) {
524 dDdipt[
n -
nmin] = 0.;
525 dDdphi[
n -
nmin] = 0.;
528 for (
int n =
nmin;
n < nmax; ++
n) {
534 for (
int n =
nmin;
n < nmax; ++
n) {
538 float oodotp[nmax -
nmin];
539 float x[nmax -
nmin];
540 float y[nmax -
nmin];
541 float oor0[nmax -
nmin];
542 float dadipt[nmax -
nmin];
543 float dadx[nmax -
nmin];
544 float dady[nmax -
nmin];
545 float pxca[nmax -
nmin];
546 float pxsa[nmax -
nmin];
547 float pyca[nmax -
nmin];
548 float pysa[nmax -
nmin];
550 float tmpx[nmax -
nmin];
551 float tmpy[nmax -
nmin];
552 float pxinold[nmax -
nmin];
557 for (
int n =
nmin;
n < nmax; ++
n) {
569 for (
int n =
nmin;
n < nmax; ++
n) {
575 for (
int n =
nmin;
n < nmax; ++
n) {
576 if (oodotp[
n -
nmin] > 5.0
f || oodotp[
n -
nmin] < 0)
578 outFailFlag(
n, 0, 0) = 1;
579 oodotp[
n -
nmin] = 0.0f;
587 for (
int n =
nmin;
n < nmax; ++
n) {
594 for (
int n =
nmin;
n < nmax; ++
n) {
599 #if !defined(__INTEL_COMPILER) 602 for (
int n =
nmin;
n < nmax; ++
n) {
606 #if !defined(__INTEL_COMPILER) 609 for (
int n =
nmin;
n < nmax; ++
n) {
616 for (
int n =
nmin;
n < nmax; ++
n) {
621 for (
int n =
nmin;
n < nmax; ++
n) {
623 "Attempt propagation from r=" 624 << r0[
n -
nmin] <<
" to r=" <<
r[
n -
nmin] << std::endl
625 <<
" x=" << xin[
n -
nmin] <<
" y=" << yin[
n -
nmin] <<
" z=" << inPar(
n, 2, 0)
626 <<
" px=" << pxin[
n -
nmin] <<
" py=" << pyin[
n -
nmin]
628 <<
" r=" << std::setprecision(9) <<
r[
n -
nmin] <<
" r0=" << std::setprecision(9)
629 << r0[
n -
nmin] <<
" id=" << std::setprecision(9) <<
id[
n -
nmin]
630 <<
" dr=" << std::setprecision(9) <<
r[
n -
nmin] - r0[
n -
nmin] <<
" cosa=" << cosa[
n -
nmin]
631 <<
" sina=" << sina[
n -
nmin] <<
" dir_cos(rad,pT)=" << 1.0
f / oodotp[
n -
nmin]);
637 for (
int n =
nmin;
n < nmax; ++
n) {
642 for (
int n =
nmin;
n < nmax; ++
n) {
647 for (
int n =
nmin;
n < nmax; ++
n) {
659 for (
int n =
nmin;
n < nmax; ++
n) {
666 for (
int n =
nmin;
n < nmax; ++
n) {
670 for (
int n =
nmin;
n < nmax; ++
n) {
676 for (
int n =
nmin;
n < nmax; ++
n) {
681 for (
int n =
nmin;
n < nmax; ++
n) {
690 for (
int n =
nmin;
n < nmax; ++
n) {
699 for (
int n =
nmin;
n < nmax; ++
n) {
701 outPar(
n, 0, 0) = outPar(
n, 0, 0) + 2.f *
k[
n -
nmin] * sinah[
n -
nmin] *
703 outPar(
n, 1, 0) = outPar(
n, 1, 0) + 2.f *
k[
n -
nmin] * sinah[
n -
nmin] *
709 for (
int n =
nmin;
n < nmax; ++
n) {
711 "outPar(n, 0, 0)=" << outPar(
n, 0, 0) <<
" outPar(n, 1, 0)=" << outPar(
n, 1, 0)
712 <<
" pxin=" << pxin[
n -
nmin] <<
" pyin=" << pyin[
n -
nmin]);
717 float dadphi[nmax -
nmin];
720 for (
int n =
nmin;
n < nmax; ++
n) {
730 for (
int n =
nmin;
n < nmax; ++
n) {
735 for (
int n =
nmin;
n < nmax; ++
n) {
741 for (
int n =
nmin;
n < nmax; ++
n) {
742 errorProp(
n, 0, 0) = 1.f +
k[
n -
nmin] * dadx[
n -
nmin] *
747 errorProp(
n, 0, 2) = 0.f;
753 errorProp(
n, 0, 4) =
k[
n -
nmin] *
758 errorProp(
n, 0, 5) = 0.f;
762 for (
int n =
nmin;
n < nmax; ++
n) {
765 errorProp(
n, 1, 1) = 1.f +
k[
n -
nmin] * dady[
n -
nmin] *
768 errorProp(
n, 1, 2) = 0.f;
774 errorProp(
n, 1, 4) =
k[
n -
nmin] *
779 errorProp(
n, 1, 5) = 0.f;
783 for (
int n =
nmin;
n < nmax; ++
n) {
789 for (
int n =
nmin;
n < nmax; ++
n) {
794 for (
int n =
nmin;
n < nmax; ++
n) {
800 for (
int n =
nmin;
n < nmax; ++
n) {
805 errorProp(
n, 2, 2) = 1.f;
813 for (
int n =
nmin;
n < nmax; ++
n) {
814 outPar(
n, 3, 0) = ipt[
n -
nmin];
815 errorProp(
n, 3, 0) = 0.f;
816 errorProp(
n, 3, 1) = 0.f;
817 errorProp(
n, 3, 2) = 0.f;
818 errorProp(
n, 3, 3) = 1.f;
819 errorProp(
n, 3, 4) = 0.f;
820 errorProp(
n, 3, 5) = 0.f;
824 for (
int n =
nmin;
n < nmax; ++
n) {
826 errorProp(
n, 4, 0) = dadx[
n -
nmin];
827 errorProp(
n, 4, 1) = dady[
n -
nmin];
828 errorProp(
n, 4, 2) = 0.f;
829 errorProp(
n, 4, 3) = dadipt[
n -
nmin];
830 errorProp(
n, 4, 4) = 1.f + dadphi[
n -
nmin];
831 errorProp(
n, 4, 5) = 0.f;
835 for (
int n =
nmin;
n < nmax; ++
n) {
837 errorProp(
n, 5, 0) = 0.f;
838 errorProp(
n, 5, 1) = 0.f;
839 errorProp(
n, 5, 2) = 0.f;
840 errorProp(
n, 5, 3) = 0.f;
841 errorProp(
n, 5, 4) = 0.f;
842 errorProp(
n, 5, 5) = 1.f;
845 for (
int n =
nmin;
n < nmax; ++
n) {
848 "propagation end, dump parameters\n" 849 <<
" D = " <<
D[
n -
nmin] <<
" alpha = " <<
alpha[
n -
nmin] <<
" kinv = " << kinv[
n -
nmin] << std::endl
850 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 851 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
852 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
853 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 854 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0)))
855 <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0)) << std::endl);
859 for (
int n =
nmin;
n < nmax; ++
n) {
863 printf(
"%5f %5f %5f %5f %5f %5f\n",
870 printf(
"%5f %5f %5f %5f %5f %5f\n",
877 printf(
"%5f %5f %5f %5f %5f %5f\n",
884 printf(
"%5f %5f %5f %5f %5f %5f\n",
891 printf(
"%5f %5f %5f %5f %5f %5f\n",
898 printf(
"%5f %5f %5f %5f %5f %5f\n",
926 errorProp.setVal(0.
f);
927 outFailFlag.setVal(0.
f);
929 helixAtRFromIterativeCCS_impl(inPar, inChg, msRad, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
957 for (
int kk = 0;
kk < N_proc; ++
kk) {
959 for (
int i = 0;
i < 6; ++
i) {
960 for (
int j = 0;
j < 6; ++
j)
967 for (
int i = 0;
i < 6; ++
i) {
968 for (
int j = 0;
j < 6; ++
j)
979 MultHelixProp(errorProp, outErr,
temp);
980 MultHelixPropTransp(errorProp,
temp, outErr);
985 for (
int kk = 0;
kk < N_proc; ++
kk) {
987 for (
int i = 0;
i < 6; ++
i) {
988 for (
int j = 0;
j < 6; ++
j)
1005 for (
int n = 0;
n <
NN; ++
n) {
1007 if (outFailFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
1008 hitsRl(
n, 0, 0) = 0.f;
1009 hitsXi(
n, 0, 0) = 0.f;
1012 hitsRl(
n, 0, 0) = mat.
radl;
1013 hitsXi(
n, 0, 0) = mat.bbxi;
1015 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
1016 const float r = msRad(
n, 0, 0);
1017 propSign(
n, 0, 0) = (r > r0 ? 1. : -1.);
1022 for (
int n = 0;
n <
NN; ++
n) {
1023 plNrm(
n, 0, 0) =
std::cos(outPar.constAt(
n, 4, 0));
1024 plNrm(
n, 1, 0) =
std::sin(outPar.constAt(
n, 4, 0));
1025 plNrm(
n, 2, 0) = 0.f;
1030 for (
int kk = 0;
kk < N_proc; ++
kk) {
1032 for (
int i = 0;
i < 1; ++
i) {
1037 for (
int i = 0;
i < 3; ++
i) {
1041 dprintf(
"outErr(after material) %d\n",
kk);
1042 for (
int i = 0;
i < 6; ++
i) {
1043 for (
int j = 0;
j < 6; ++
j)
1073 for (
int i = 0;
i < N_proc; ++
i) {
1074 if (outFailFlag(
i, 0, 0)) {
1075 outPar.copySlot(
i, inPar);
1076 outErr.copySlot(
i, inErr);
void sincos4(const MPlex< T, D1, D2, N > &a, MPlex< T, D1, D2, N > &s, MPlex< T, D1, D2, N > &c)
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
void propagateHelixToRMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Sin< T >::type sin(const T &t)
#define CMS_UNROLL_LOOP_COUNT(N)
void propagateLineToRMPlex(const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
const TrackerInfo * tracker_info
void applyMaterialEffects(const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
void squashPhiMPlex(MPlexLV &par, const int N_proc)
constexpr Matriplex::idx_t NN
Cos< T >::type cos(const T &t)
void helixAtRFromIterativeCCSFullJac(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, const int N_proc)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
constexpr bool useTrigApprox
Matriplex::Matriplex< int, 1, 1, NN > MPlexQI
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
DecomposeProduct< arg, typename Div::arg > D
float hipo(float x, float y)
float bFieldFromZR(const float z, const float r)
Matriplex::MatriplexSym< float, HH, NN > MPlexHS
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Material material_checked(float z, float r) const
void helixAtRFromIterativeCCS(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
void sincos4(const float x, float &sin, float &cos)
#define ASSUME_ALIGNED(a, b)