31 for (
int n = 0;
n <
NN; ++
n) {
32 const float cosA = (psPar[0 *
N +
n] * psPar[3 *
N +
n] + psPar[1 *
N +
n] * psPar[4 *
N +
n]) /
33 (
std::sqrt((psPar[0 *
N +
n] * psPar[0 *
N +
n] + psPar[1 *
N +
n] * psPar[1 *
N +
n]) *
34 (psPar[3 *
N +
n] * psPar[3 *
N +
n] + psPar[4 *
N +
n] * psPar[4 *
N +
n])));
35 const float dr = (
hipo(msPar[0 *
N +
n], msPar[1 *
N +
n]) -
hipo(psPar[0 *
N +
n], psPar[1 *
N +
n])) / cosA;
37 dprint_np(
n,
"propagateLineToRMPlex dr=" << dr);
39 const float pt =
hipo(psPar[3 *
N +
n], psPar[4 *
N +
n]);
40 const float p = dr /
pt;
41 const float psq =
p *
p;
43 outPar[0 *
N +
n] = psPar[0 *
N +
n] +
p * psPar[3 *
N +
n];
44 outPar[1 *
N +
n] = psPar[1 *
N +
n] +
p * psPar[4 *
N +
n];
45 outPar[2 *
N +
n] = psPar[2 *
N +
n] +
p * psPar[5 *
N +
n];
46 outPar[3 *
N +
n] = psPar[3 *
N +
n];
47 outPar[4 *
N +
n] = psPar[4 *
N +
n];
48 outPar[5 *
N +
n] = psPar[5 *
N +
n];
54 B.fArray[0 *
N +
n] =
A.fArray[0 *
N +
n];
55 B.fArray[1 *
N +
n] =
A.fArray[1 *
N +
n];
56 B.fArray[2 *
N +
n] =
A.fArray[2 *
N +
n];
57 B.fArray[3 *
N +
n] =
A.fArray[3 *
N +
n];
58 B.fArray[4 *
N +
n] =
A.fArray[4 *
N +
n];
59 B.fArray[5 *
N +
n] =
A.fArray[5 *
N +
n];
60 B.fArray[6 *
N +
n] =
A.fArray[6 *
N +
n] +
p *
A.fArray[0 *
N +
n];
61 B.fArray[7 *
N +
n] =
A.fArray[7 *
N +
n] +
p *
A.fArray[1 *
N +
n];
62 B.fArray[8 *
N +
n] =
A.fArray[8 *
N +
n] +
p *
A.fArray[3 *
N +
n];
64 A.fArray[9 *
N +
n] +
p * (
A.fArray[6 *
N +
n] +
A.fArray[6 *
N +
n]) + psq *
A.fArray[0 *
N +
n];
65 B.fArray[10 *
N +
n] =
A.fArray[10 *
N +
n] +
p *
A.fArray[1 *
N +
n];
66 B.fArray[11 *
N +
n] =
A.fArray[11 *
N +
n] +
p *
A.fArray[2 *
N +
n];
67 B.fArray[12 *
N +
n] =
A.fArray[12 *
N +
n] +
p *
A.fArray[4 *
N +
n];
68 B.fArray[13 *
N +
n] =
69 A.fArray[13 *
N +
n] +
p * (
A.fArray[7 *
N +
n] +
A.fArray[10 *
N +
n]) + psq *
A.fArray[1 *
N +
n];
70 B.fArray[14 *
N +
n] =
71 A.fArray[14 *
N +
n] +
p * (
A.fArray[11 *
N +
n] +
A.fArray[11 *
N +
n]) + psq *
A.fArray[2 *
N +
n];
72 B.fArray[15 *
N +
n] =
A.fArray[15 *
N +
n] +
p *
A.fArray[3 *
N +
n];
73 B.fArray[16 *
N +
n] =
A.fArray[16 *
N +
n] +
p *
A.fArray[4 *
N +
n];
74 B.fArray[17 *
N +
n] =
A.fArray[17 *
N +
n] +
p *
A.fArray[5 *
N +
n];
75 B.fArray[18 *
N +
n] =
76 A.fArray[18 *
N +
n] +
p * (
A.fArray[8 *
N +
n] +
A.fArray[15 *
N +
n]) + psq *
A.fArray[3 *
N +
n];
77 B.fArray[19 *
N +
n] =
78 A.fArray[19 *
N +
n] +
p * (
A.fArray[12 *
N +
n] +
A.fArray[16 *
N +
n]) + psq *
A.fArray[4 *
N +
n];
79 B.fArray[20 *
N +
n] =
80 A.fArray[20 *
N +
n] +
p * (
A.fArray[17 *
N +
n] +
A.fArray[17 *
N +
n]) + psq *
A.fArray[5 *
N +
n];
83 dprint_np(
n,
"propagateLineToRMPlex arrive at r=" <<
hipo(outPar[0 *
N +
n], outPar[1 *
N +
n]));
94 using namespace mkfit;
102 const T*
a =
A.fArray;
104 const T*
b =
B.fArray;
109 #include "MultHelixProp.ah" 118 const T*
a =
A.fArray;
120 const T*
b =
B.fArray;
125 #include "MultHelixPropTransp.ah" 134 const T*
a =
A.fArray;
136 const T*
b =
B.fArray;
141 #include "MultHelixPropEndcap.ah" 150 const T*
a =
A.fArray;
152 const T*
b =
B.fArray;
157 #include "MultHelixPropTranspEndcap.ah" 166 const T*
a =
A.fArray;
168 const T*
b =
B.fArray;
173 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] +
174 a[4 *
N +
n] *
b[24 *
N +
n];
175 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] +
176 a[4 *
N +
n] *
b[25 *
N +
n];
177 c[2 *
N +
n] =
a[2 *
N +
n];
178 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] +
179 a[3 *
N +
n] +
a[4 *
N +
n] *
b[27 *
N +
n];
180 c[4 *
N +
n] =
a[0 *
N +
n] *
b[4 *
N +
n] +
a[1 *
N +
n] *
b[10 *
N +
n] +
a[4 *
N +
n];
181 c[5 *
N +
n] =
a[2 *
N +
n] *
b[17 *
N +
n] +
a[5 *
N +
n];
182 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] +
183 a[10 *
N +
n] *
b[24 *
N +
n];
184 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] +
185 a[10 *
N +
n] *
b[25 *
N +
n];
186 c[8 *
N +
n] =
a[8 *
N +
n];
187 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] +
188 a[9 *
N +
n] +
a[10 *
N +
n] *
b[27 *
N +
n];
189 c[10 *
N +
n] =
a[6 *
N +
n] *
b[4 *
N +
n] +
a[7 *
N +
n] *
b[10 *
N +
n] +
a[10 *
N +
n];
190 c[11 *
N +
n] =
a[8 *
N +
n] *
b[17 *
N +
n] +
a[11 *
N +
n];
191 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] +
192 a[16 *
N +
n] *
b[24 *
N +
n];
193 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] +
194 a[16 *
N +
n] *
b[25 *
N +
n];
195 c[14 *
N +
n] =
a[14 *
N +
n];
196 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] +
197 a[15 *
N +
n] +
a[16 *
N +
n] *
b[27 *
N +
n];
198 c[16 *
N +
n] =
a[12 *
N +
n] *
b[4 *
N +
n] +
a[13 *
N +
n] *
b[10 *
N +
n] +
a[16 *
N +
n];
199 c[17 *
N +
n] =
a[14 *
N +
n] *
b[17 *
N +
n] +
a[17 *
N +
n];
200 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] +
201 a[22 *
N +
n] *
b[24 *
N +
n];
202 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] +
203 a[22 *
N +
n] *
b[25 *
N +
n];
204 c[20 *
N +
n] =
a[20 *
N +
n];
205 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] +
206 a[21 *
N +
n] +
a[22 *
N +
n] *
b[27 *
N +
n];
207 c[22 *
N +
n] =
a[18 *
N +
n] *
b[4 *
N +
n] +
a[19 *
N +
n] *
b[10 *
N +
n] +
a[22 *
N +
n];
208 c[23 *
N +
n] =
a[20 *
N +
n] *
b[17 *
N +
n] +
a[23 *
N +
n];
209 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] +
210 a[28 *
N +
n] *
b[24 *
N +
n];
211 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] +
212 a[28 *
N +
n] *
b[25 *
N +
n];
213 c[26 *
N +
n] =
a[26 *
N +
n];
214 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] +
215 a[27 *
N +
n] +
a[28 *
N +
n] *
b[27 *
N +
n];
216 c[28 *
N +
n] =
a[24 *
N +
n] *
b[4 *
N +
n] +
a[25 *
N +
n] *
b[10 *
N +
n] +
a[28 *
N +
n];
217 c[29 *
N +
n] =
a[26 *
N +
n] *
b[17 *
N +
n] +
a[29 *
N +
n];
218 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] +
219 a[34 *
N +
n] *
b[24 *
N +
n];
220 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] +
221 a[34 *
N +
n] *
b[25 *
N +
n];
222 c[32 *
N +
n] =
a[32 *
N +
n];
223 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] +
224 a[33 *
N +
n] +
a[34 *
N +
n] *
b[27 *
N +
n];
225 c[34 *
N +
n] =
a[30 *
N +
n] *
b[4 *
N +
n] +
a[31 *
N +
n] *
b[10 *
N +
n] +
a[34 *
N +
n];
226 c[35 *
N +
n] =
a[32 *
N +
n] *
b[17 *
N +
n] +
a[35 *
N +
n];
231 for (
int n = 0;
n <
NN; ++
n) {
232 for (
int i = 0;
i < 6; ++
i) {
236 for (
int j = 0;
j < 6; ++
j) {
238 for (
int k = 0;
k < 6; ++
k)
247 for (
int n = 0;
n <
NN; ++
n) {
248 for (
int i = 0;
i < 6; ++
i) {
252 for (
int j = 0;
j < 6; ++
j) {
254 for (
int k = 0;
k < 6; ++
k)
265 for (
int n = 0;
n <
NN; ++
n) {
266 for (
int i = 0;
i < 6; ++
i) {
267 for (
int j = 0;
j < 6; ++
j) {
269 for (
int k = 0;
k < 6; ++
k)
279 for (
int n = 0;
n <
NN; ++
n) {
280 for (
int i = 0;
i < 6; ++
i) {
281 for (
int j = 0;
j < 6; ++
j) {
283 for (
int k = 0;
k < 6; ++
k)
302 errorProp.setVal(0.
f);
309 #if !defined(__clang__) 312 for (
int n = 0;
n <
NN; ++
n) {
314 errorProp(
n, 0, 0) = 1.f;
315 errorProp(
n, 1, 1) = 1.f;
316 errorProp(
n, 2, 2) = 1.f;
317 errorProp(
n, 3, 3) = 1.f;
318 errorProp(
n, 4, 4) = 1.f;
319 errorProp(
n, 5, 5) = 1.f;
322 const float r = msRad.constAt(
n, 0, 0);
323 float r0 =
hipo(inPar.constAt(
n, 0, 0), inPar.constAt(
n, 1, 0));
326 dprint_np(
n,
"distance less than 1mum, skip");
330 const float ipt = inPar.constAt(
n, 3, 0);
331 const float phiin = inPar.constAt(
n, 4, 0);
332 const float theta = inPar.constAt(
n, 5, 0);
335 errorPropTmp(
n, 2, 2) = 1.f;
336 errorPropTmp(
n, 3, 3) = 1.f;
337 errorPropTmp(
n, 4, 4) = 1.f;
338 errorPropTmp(
n, 5, 5) = 1.f;
340 float cosah = 0., sinah = 0.;
344 float pxin = cosP / ipt;
345 float pyin = sinP / ipt;
351 <<
"attempt propagation from r=" << r0 <<
" to r=" << r << std::endl
352 <<
"x=" << outPar.At(
n, 0, 0) <<
" y=" << outPar.At(
n, 1, 0) <<
" z=" << outPar.At(
n, 2, 0)
354 <<
" pz=" << 1.f / (ipt *
tan(
theta)) <<
" q=" << inChg.constAt(
n, 0, 0) << std::endl);
356 r0 =
hipo(outPar.constAt(
n, 0, 0), outPar.constAt(
n, 1, 0));
357 const float ialpha = (r - r0) * ipt /
k;
361 sincos4(ialpha * 0.5
f, sinah, cosah);
366 const float cosa = 1.f - 2.f * sinah * sinah;
367 const float sina = 2.f * sinah * cosah;
370 const float dadx = -outPar.At(
n, 0, 0) * ipt / (
k * r0);
371 const float dady = -outPar.At(
n, 1, 0) * ipt / (
k * r0);
372 const float dadipt = (r - r0) /
k;
374 outPar.At(
n, 0, 0) = outPar.constAt(
n, 0, 0) + 2.f *
k * sinah * (pxin * cosah - pyin * sinah);
375 outPar.At(
n, 1, 0) = outPar.constAt(
n, 1, 0) + 2.f *
k * sinah * (pyin * cosah + pxin * sinah);
376 const float pxinold = pxin;
377 pxin = pxin * cosa - pyin * sina;
378 pyin = pyin * cosa + pxinold * sina;
385 outPar.At(
n, 2, 0) = outPar.constAt(
n, 2, 0) +
k * ialpha * cosT / (ipt * sinT);
386 outPar.At(
n, 3, 0) = ipt;
387 outPar.At(
n, 4, 0) = outPar.constAt(
n, 4, 0) + ialpha;
388 outPar.At(
n, 5, 0) =
theta;
390 errorPropTmp(
n, 0, 0) = 1.f +
k * (cosP * dadx * cosa - sinP * dadx * sina) / ipt;
391 errorPropTmp(
n, 0, 1) =
k * (cosP * dady * cosa - sinP * dady * sina) / ipt;
392 errorPropTmp(
n, 0, 3) =
393 k * (cosP * (ipt * dadipt * cosa - sina) + sinP * ((1.
f - cosa) - ipt * dadipt * sina)) / (ipt * ipt);
394 errorPropTmp(
n, 0, 4) = -
k * (sinP * sina + cosP * (1.f - cosa)) / ipt;
396 errorPropTmp(
n, 1, 0) =
k * (sinP * dadx * cosa + cosP * dadx * sina) / ipt;
397 errorPropTmp(
n, 1, 1) = 1.f +
k * (sinP * dady * cosa + cosP * dady * sina) / ipt;
398 errorPropTmp(
n, 1, 3) =
399 k * (sinP * (ipt * dadipt * cosa - sina) + cosP * (ipt * dadipt * sina - (1.
f - cosa))) / (ipt * ipt);
400 errorPropTmp(
n, 1, 4) =
k * (cosP * sina - sinP * (1.f - cosa)) / ipt;
402 errorPropTmp(
n, 2, 0) =
k * cosT * dadx / (ipt * sinT);
403 errorPropTmp(
n, 2, 1) =
k * cosT * dady / (ipt * sinT);
404 errorPropTmp(
n, 2, 3) =
k * cosT * (ipt * dadipt - ialpha) / (ipt * ipt * sinT);
405 errorPropTmp(
n, 2, 5) = -
k * ialpha / (ipt * sinT * sinT);
407 errorPropTmp(
n, 4, 0) = dadx;
408 errorPropTmp(
n, 4, 1) = dady;
409 errorPropTmp(
n, 4, 3) = dadipt;
411 MultHelixPropTemp(errorProp, errorPropTmp, errorPropSwap,
n);
412 errorProp = errorPropSwap;
417 "propagation end, dump parameters" 419 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
420 <<
"mom = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 421 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 422 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
423 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
424 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
430 printf(
"%5f %5f %5f %5f %5f %5f\n",
437 printf(
"%5f %5f %5f %5f %5f %5f\n",
444 printf(
"%5f %5f %5f %5f %5f %5f\n",
451 printf(
"%5f %5f %5f %5f %5f %5f\n",
458 printf(
"%5f %5f %5f %5f %5f %5f\n",
465 printf(
"%5f %5f %5f %5f %5f %5f\n",
480 #include "PropagationMPlex.icc" 492 errorProp.setVal(0.
f);
493 outFailFlag.setVal(0.
f);
495 helixAtRFromIterativeCCS_impl(inPar, inChg, msRad, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
523 for (
int kk = 0;
kk < N_proc; ++
kk) {
525 for (
int i = 0;
i < 6; ++
i) {
526 for (
int j = 0;
j < 6; ++
j)
533 for (
int i = 0;
i < 6; ++
i) {
534 for (
int j = 0;
j < 6; ++
j)
545 MultHelixProp(errorProp, outErr,
temp);
546 MultHelixPropTransp(errorProp,
temp, outErr);
557 for (
int n = 0;
n <
NN; ++
n) {
559 if (outFailFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
560 hitsRl(
n, 0, 0) = 0.f;
561 hitsXi(
n, 0, 0) = 0.f;
564 hitsRl(
n, 0, 0) = mat.
radl;
565 hitsXi(
n, 0, 0) = mat.bbxi;
567 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
568 const float r = msRad(
n, 0, 0);
569 propSign(
n, 0, 0) = (r > r0 ? 1. : -1.);
574 for (
int n = 0;
n <
NN; ++
n) {
575 plNrm(
n, 0, 0) =
std::cos(outPar.constAt(
n, 4, 0));
576 plNrm(
n, 1, 0) =
std::sin(outPar.constAt(
n, 4, 0));
577 plNrm(
n, 2, 0) = 0.f;
602 for (
int i = 0;
i < N_proc; ++
i) {
603 if (outFailFlag(
i, 0, 0)) {
604 outPar.copySlot(
i, inPar);
605 outErr.copySlot(
i, inErr);
631 helixAtZ(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
635 for (
int kk = 0;
kk < N_proc; ++
kk) {
637 for (
int i = 0;
i < 6; ++
i) {
643 for (
int i = 0;
i < 6; ++
i) {
644 for (
int j = 0;
j < 6; ++
j)
651 for (
int i = 0;
i < 6; ++
i) {
652 for (
int j = 0;
j < 6; ++
j)
663 for (
int kk = 0;
kk < N_proc; ++
kk) {
665 for (
int i = 0;
i < 6; ++
i) {
666 for (
int j = 0;
j < 6; ++
j)
677 MultHelixPropEndcap(errorProp, outErr,
temp);
678 MultHelixPropTranspEndcap(errorProp,
temp, outErr);
689 for (
int n = 0;
n <
NN; ++
n) {
690 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
691 hitsRl(
n, 0, 0) = 0.f;
692 hitsXi(
n, 0, 0) = 0.f;
694 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
696 hitsRl(
n, 0, 0) = mat.
radl;
697 hitsXi(
n, 0, 0) = mat.bbxi;
700 const float zout = msZ.constAt(
n, 0, 0);
701 const float zin = inPar.constAt(
n, 2, 0);
707 for (
int n = 0;
n <
NN; ++
n) {
708 plNrm(
n, 0, 0) = 0.f;
709 plNrm(
n, 1, 0) = 0.f;
710 plNrm(
n, 2, 0) = 1.f;
715 for (
int kk = 0;
kk < N_proc; ++
kk) {
717 for (
int i = 0;
i < 1; ++
i) {
722 for (
int i = 0;
i < 3; ++
i) {
726 dprintf(
"outErr(after material) %d\n",
kk);
727 for (
int i = 0;
i < 6; ++
i) {
728 for (
int j = 0;
j < 6; ++
j)
743 for (
int i = 0;
i < N_proc; ++
i) {
744 if (outFailFlag(
i, 0, 0)) {
745 outPar.copySlot(
i, inPar);
746 outErr.copySlot(
i, inErr);
760 errorProp.setVal(0.
f);
761 outFailFlag.setVal(0.
f);
765 for (
int n = 0;
n <
NN; ++
n) {
767 errorProp(
n, 0, 0) = 1.f;
768 errorProp(
n, 1, 1) = 1.f;
769 errorProp(
n, 3, 3) = 1.f;
770 errorProp(
n, 4, 4) = 1.f;
771 errorProp(
n, 5, 5) = 1.f;
779 for (
int n = 0;
n <
NN; ++
n) {
781 zout[
n] = msZ.constAt(
n, 0, 0);
782 zin[
n] = inPar.constAt(
n, 2, 0);
783 ipt[
n] = inPar.constAt(
n, 3, 0);
784 phiin[
n] = inPar.constAt(
n, 4, 0);
785 theta[
n] = inPar.constAt(
n, 5, 0);
791 for (
int n = 0;
n <
NN; ++
n) {
792 k[
n] = inChg.constAt(
n, 0, 0) * 100.f /
797 for (
int n = 0;
n <
NN; ++
n) {
804 for (
int n = 0;
n <
NN; ++
n) {
805 kinv[
n] = 1.f /
k[
n];
809 for (
int n = 0;
n <
NN; ++
n) {
812 <<
"input parameters" 813 <<
" inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.constAt(
n, 0, 0)
814 <<
" inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.constAt(
n, 1, 0)
815 <<
" inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.constAt(
n, 2, 0)
816 <<
" inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.constAt(
n, 3, 0)
817 <<
" inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.constAt(
n, 4, 0)
818 <<
" inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.constAt(
n, 5, 0)
819 <<
" inChg.constAt(n, 0, 0)=" << std::setprecision(9) << inChg.constAt(
n, 0, 0));
822 for (
int n = 0;
n <
NN; ++
n) {
824 "propagation start, dump parameters" 826 <<
"pos = " << inPar.constAt(
n, 0, 0) <<
" " << inPar.constAt(
n, 1, 0) <<
" " 827 << inPar.constAt(
n, 2, 0) << std::endl
828 <<
"mom (cart) = " <<
std::cos(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 829 <<
std::sin(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 830 << 1. / (inPar.constAt(
n, 3, 0) *
tan(inPar.constAt(
n, 5, 0))) <<
" r=" 831 <<
std::sqrt(inPar.constAt(
n, 0, 0) * inPar.constAt(
n, 0, 0) +
832 inPar.constAt(
n, 1, 0) * inPar.constAt(
n, 1, 0))
833 <<
" pT=" << 1. /
std::abs(inPar.constAt(
n, 3, 0)) <<
" q=" << inChg.constAt(
n, 0, 0)
834 <<
" targetZ=" << msZ.constAt(
n, 0, 0) << std::endl);
839 for (
int n = 0;
n <
NN; ++
n) {
840 pt[
n] = 1.f / ipt[
n];
847 for (
int n = 0;
n <
NN; ++
n) {
852 for (
int n = 0;
n <
NN; ++
n) {
859 for (
int n = 0;
n <
NN; ++
n) {
864 for (
int n = 0;
n <
NN; ++
n) {
873 for (
int n = 0;
n <
NN; ++
n) {
874 tanT[
n] = sinT[
n] / cosT[
n];
875 icos2T[
n] = 1.f / (cosT[
n] * cosT[
n]);
876 pxin[
n] = cosP[
n] *
pt[
n];
877 pyin[
n] = sinP[
n] *
pt[
n];
883 for (
int n = 0;
n <
NN; ++
n) {
891 #if !defined(__INTEL_COMPILER) 894 for (
int n = 0;
n <
NN; ++
n) {
898 #if !defined(__INTEL_COMPILER) 901 for (
int n = 0;
n <
NN; ++
n) {
904 #if !defined(__INTEL_COMPILER) 907 for (
int n = 0;
n <
NN; ++
n) {
917 for (
int n = 0;
n <
NN; ++
n) {
918 cosah[
n] = cosahTmp[
n];
919 sinah[
n] = sinahTmp[
n];
920 cosa[
n] = 1.f - 2.f * sinah[
n] * sinah[
n];
921 sina[
n] = 2.f * sinah[
n] * cosah[
n];
926 for (
int n = 0;
n <
NN; ++
n) {
927 outPar.At(
n, 0, 0) = outPar.At(
n, 0, 0) + 2.f *
k[
n] * sinah[
n] * (pxin[
n] * cosah[
n] - pyin[
n] * sinah[
n]);
928 outPar.At(
n, 1, 0) = outPar.At(
n, 1, 0) + 2.f *
k[
n] * sinah[
n] * (pyin[
n] * cosah[
n] + pxin[
n] * sinah[
n]);
929 outPar.At(
n, 2, 0) = zout[
n];
930 outPar.At(
n, 4, 0) = phiin[
n] +
alpha[
n];
934 for (
int n = 0;
n <
NN; ++
n) {
936 "propagation to Z end (OLD), dump parameters\n" 937 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 938 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
939 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
940 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 941 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 942 << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0))) <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0))
948 for (
int n = 0;
n <
NN; ++
n) {
949 pxcaMpysa[
n] = pxin[
n] * cosa[
n] - pyin[
n] * sina[
n];
953 for (
int n = 0;
n <
NN; ++
n) {
954 errorProp(
n, 0, 2) = -tanT[
n] * ipt[
n] * pxcaMpysa[
n];
957 (cosP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) + sinP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
958 errorProp(
n, 0, 4) = -2.f *
k[
n] *
pt[
n] * sinah[
n] * (sinP[
n] * cosah[
n] + cosP[
n] * sinah[
n]);
959 errorProp(
n, 0, 5) =
deltaZ[
n] * ipt[
n] * pxcaMpysa[
n] * icos2T[
n];
964 for (
int n = 0;
n <
NN; ++
n) {
965 pycaPpxsa[
n] = pyin[
n] * cosa[
n] + pxin[
n] * sina[
n];
969 for (
int n = 0;
n <
NN; ++
n) {
970 errorProp(
n, 1, 2) = -tanT[
n] * ipt[
n] * pycaPpxsa[
n];
973 (sinP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) - cosP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
974 errorProp(
n, 1, 4) = 2.f *
k[
n] *
pt[
n] * sinah[
n] * (cosP[
n] * cosah[
n] - sinP[
n] * sinah[
n]);
975 errorProp(
n, 1, 5) =
deltaZ[
n] * ipt[
n] * pycaPpxsa[
n] * icos2T[
n];
979 for (
int n = 0;
n <
NN; ++
n) {
980 errorProp(
n, 4, 2) = -ipt[
n] * tanT[
n] * kinv[
n];
981 errorProp(
n, 4, 3) = tanT[
n] *
deltaZ[
n] * kinv[
n];
982 errorProp(
n, 4, 5) = ipt[
n] *
deltaZ[
n] * kinv[
n] * icos2T[
n];
986 for (
int n = 0;
n <
NN; ++
n) {
989 "propagation end, dump parameters" 991 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
992 <<
"mom (cart) = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 993 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 994 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
995 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
996 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
1024 for (
int n = 0;
n < N_proc; ++
n) {
1027 printf(
"%5f %5f %5f %5f %5f %5f\n",
1033 errorProp(
n, 0, 5));
1034 printf(
"%5f %5f %5f %5f %5f %5f\n",
1040 errorProp(
n, 1, 5));
1041 printf(
"%5f %5f %5f %5f %5f %5f\n",
1047 errorProp(
n, 2, 5));
1048 printf(
"%5f %5f %5f %5f %5f %5f\n",
1054 errorProp(
n, 3, 5));
1055 printf(
"%5f %5f %5f %5f %5f %5f\n",
1061 errorProp(
n, 4, 5));
1062 printf(
"%5f %5f %5f %5f %5f %5f\n",
1068 errorProp(
n, 5, 5));
1084 errorProp.setVal(0.
f);
1085 outFailFlag.setVal(0.
f);
1087 helixAtPlane_impl(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
1109 helixAtPlane(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, N_proc, pflags);
1111 for (
int n = 0;
n <
NN; ++
n) {
1114 "propagation to plane end, dump parameters\n" 1116 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 1117 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
1118 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
1119 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 1120 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0)))
1121 <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0)) << std::endl);
1126 for (
int kk = 0;
kk < N_proc; ++
kk) {
1128 for (
int i = 0;
i < 6; ++
i) {
1133 for (
int i = 0;
i < 6; ++
i) {
1134 for (
int j = 0;
j < 6; ++
j)
1140 for (
int kk = 0;
kk < N_proc; ++
kk) {
1142 for (
int j = 0;
j < 3; ++
j)
1147 for (
int kk = 0;
kk < N_proc; ++
kk) {
1149 for (
int j = 0;
j < 1; ++
j)
1155 for (
int i = 0;
i < 6; ++
i) {
1156 for (
int j = 0;
j < 6; ++
j)
1168 MultHelixPropFull(errorProp, outErr,
temp);
1169 MultHelixPropTranspFull(errorProp,
temp, outErr);
1173 for (
int kk = 0;
kk < N_proc; ++
kk) {
1175 for (
int i = 0;
i < 6; ++
i) {
1176 for (
int j = 0;
j < 6; ++
j)
1193 for (
int n = 0;
n <
NN; ++
n) {
1194 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
1195 hitsRl(
n, 0, 0) = 0.f;
1196 hitsXi(
n, 0, 0) = 0.f;
1198 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
1200 hitsRl(
n, 0, 0) = mat.
radl;
1201 hitsXi(
n, 0, 0) = mat.bbxi;
1203 propSign(
n, 0, 0) = (pathL(
n, 0, 0) > 0.f ? 1.f : -1.f);
1208 for (
int kk = 0;
kk < N_proc; ++
kk) {
1210 for (
int i = 0;
i < 1; ++
i) {
1215 for (
int i = 0;
i < 3; ++
i) {
1219 dprintf(
"outErr(after material) %d\n",
kk);
1220 for (
int i = 0;
i < 6; ++
i) {
1221 for (
int j = 0;
j < 6; ++
j)
1236 for (
int i = 0;
i < N_proc; ++
i) {
1237 if (outFailFlag(
i, 0, 0)) {
1238 outPar.copySlot(
i, inPar);
1239 outErr.copySlot(
i, inErr);
1255 for (
int n = 0;
n <
NN; ++
n) {
1258 float radL = hitsRl.constAt(
n, 0, 0);
1261 const float theta = outPar.constAt(
n, 5, 0);
1263 const float ipt = outPar.constAt(
n, 3, 0);
1264 const float pt = 1.f / ipt;
1265 const float ipt2 = ipt * ipt;
1268 const float p2 =
p *
p;
1271 const float beta2 =
p2 / (
p2 + mpi2);
1274 const float invCos =
1276 pt *
std::sin(outPar.constAt(
n, 4, 0)) * plNrm.constAt(
n, 1, 0) + pz * plNrm.constAt(
n, 2, 0));
1277 radL = radL * invCos;
1285 const float thetaMSC = 0.0136f * (1.f + 0.038f *
std::log(radL)) / (
beta *
p);
1286 const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1288 outErr.At(
n, 3, 3) += thetaMSC2 * pz * pz * ipt2 * ipt2;
1289 outErr.At(
n, 3, 5) -= thetaMSC2 * pz * ipt2;
1290 outErr.At(
n, 4, 4) += thetaMSC2 *
p2 * ipt2;
1291 outErr.At(
n, 5, 5) += thetaMSC2;
1293 outErr.At(
n, 4, 4) += thetaMSC2;
1294 outErr.At(
n, 5, 5) += thetaMSC2;
1302 const float gamma2 = (
p2 + mpi2) / mpi2;
1305 const float wmax = 2.f *
me * beta2 * gamma2 / (1.f + 2.f *
gamma *
me / mpi +
me *
me / (mpi * mpi));
1310 ? (2.f * (hitsXi.constAt(
n, 0, 0) * invCos *
1311 (0.5f *
std::log(2.
f *
me * beta2 * gamma2 *
wmax / (
I *
I)) - beta2 - deltahalf) / beta2))
1315 const float dP = propSign.constAt(
n, 0, 0) *
dEdx /
beta;
1318 outErr.At(
n, 3, 3) += dP * dP / (
p2 *
pt *
pt);
void propagateHelixToPlaneMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
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)
constexpr bool usePtMultScat
#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)
void helixAtZ(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
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)
const std::complex< double > I
constexpr bool useTrigApprox
Matriplex::Matriplex< int, 1, 1, NN > MPlexQI
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
float hipo(float x, float y)
float bFieldFromZR(const float z, const float r)
void helixAtPlane(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexQF &pathL, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
Matriplex::MatriplexSym< float, HH, NN > MPlexHS
void propagateHelixToZMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
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)
Geom::Theta< T > theta() const
#define ASSUME_ALIGNED(a, b)
__host__ __device__ V V wmax