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];
232 for (
int n = 0;
n <
NN; ++
n) {
233 for (
int i = 0;
i < 6; ++
i) {
234 for (
int j = 0;
j < 6; ++
j) {
236 for (
int k = 0;
k < 6; ++
k)
246 for (
int n = 0;
n <
NN; ++
n) {
247 for (
int i = 0;
i < 6; ++
i) {
248 for (
int j = 0;
j < 6; ++
j) {
250 for (
int k = 0;
k < 6; ++
k)
261 for (
int n = 0;
n <
NN; ++
n) {
262 for (
int i = 0;
i < 6; ++
i) {
263 for (
int j = 0;
j < 6; ++
j) {
265 for (
int k = 0;
k < 6; ++
k)
275 for (
int n = 0;
n <
NN; ++
n) {
276 for (
int i = 0;
i < 6; ++
i) {
277 for (
int j = 0;
j < 6; ++
j) {
279 for (
int k = 0;
k < 6; ++
k)
298 errorProp.setVal(0.
f);
305 #if !defined(__clang__) 308 for (
int n = 0;
n <
NN; ++
n) {
310 errorProp(
n, 0, 0) = 1.f;
311 errorProp(
n, 1, 1) = 1.f;
312 errorProp(
n, 2, 2) = 1.f;
313 errorProp(
n, 3, 3) = 1.f;
314 errorProp(
n, 4, 4) = 1.f;
315 errorProp(
n, 5, 5) = 1.f;
318 const float r = msRad.constAt(
n, 0, 0);
319 float r0 =
hipo(inPar.constAt(
n, 0, 0), inPar.constAt(
n, 1, 0));
322 dprint_np(
n,
"distance less than 1mum, skip");
326 const float ipt = inPar.constAt(
n, 3, 0);
327 const float phiin = inPar.constAt(
n, 4, 0);
328 const float theta = inPar.constAt(
n, 5, 0);
331 errorPropTmp(
n, 2, 2) = 1.f;
332 errorPropTmp(
n, 3, 3) = 1.f;
333 errorPropTmp(
n, 4, 4) = 1.f;
334 errorPropTmp(
n, 5, 5) = 1.f;
336 float cosah = 0., sinah = 0.;
340 float pxin = cosP / ipt;
341 float pyin = sinP / ipt;
347 <<
"attempt propagation from r=" << r0 <<
" to r=" << r << std::endl
348 <<
"x=" << outPar.At(
n, 0, 0) <<
" y=" << outPar.At(
n, 1, 0) <<
" z=" << outPar.At(
n, 2, 0)
350 <<
" pz=" << 1.f / (ipt *
tan(
theta)) <<
" q=" << inChg.constAt(
n, 0, 0) << std::endl);
352 r0 =
hipo(outPar.constAt(
n, 0, 0), outPar.constAt(
n, 1, 0));
353 const float ialpha = (r - r0) * ipt /
k;
357 sincos4(ialpha * 0.5
f, sinah, cosah);
362 const float cosa = 1.f - 2.f * sinah * sinah;
363 const float sina = 2.f * sinah * cosah;
366 const float dadx = -outPar.At(
n, 0, 0) * ipt / (
k * r0);
367 const float dady = -outPar.At(
n, 1, 0) * ipt / (
k * r0);
368 const float dadipt = (r - r0) /
k;
370 outPar.At(
n, 0, 0) = outPar.constAt(
n, 0, 0) + 2.f *
k * sinah * (pxin * cosah - pyin * sinah);
371 outPar.At(
n, 1, 0) = outPar.constAt(
n, 1, 0) + 2.f *
k * sinah * (pyin * cosah + pxin * sinah);
372 const float pxinold = pxin;
373 pxin = pxin * cosa - pyin * sina;
374 pyin = pyin * cosa + pxinold * sina;
381 outPar.At(
n, 2, 0) = outPar.constAt(
n, 2, 0) +
k * ialpha * cosT / (ipt * sinT);
382 outPar.At(
n, 3, 0) = ipt;
383 outPar.At(
n, 4, 0) = outPar.constAt(
n, 4, 0) + ialpha;
384 outPar.At(
n, 5, 0) =
theta;
386 errorPropTmp(
n, 0, 0) = 1.f +
k * (cosP * dadx * cosa - sinP * dadx * sina) / ipt;
387 errorPropTmp(
n, 0, 1) =
k * (cosP * dady * cosa - sinP * dady * sina) / ipt;
388 errorPropTmp(
n, 0, 3) =
389 k * (cosP * (ipt * dadipt * cosa - sina) + sinP * ((1.
f - cosa) - ipt * dadipt * sina)) / (ipt * ipt);
390 errorPropTmp(
n, 0, 4) = -
k * (sinP * sina + cosP * (1.f - cosa)) / ipt;
392 errorPropTmp(
n, 1, 0) =
k * (sinP * dadx * cosa + cosP * dadx * sina) / ipt;
393 errorPropTmp(
n, 1, 1) = 1.f +
k * (sinP * dady * cosa + cosP * dady * sina) / ipt;
394 errorPropTmp(
n, 1, 3) =
395 k * (sinP * (ipt * dadipt * cosa - sina) + cosP * (ipt * dadipt * sina - (1.
f - cosa))) / (ipt * ipt);
396 errorPropTmp(
n, 1, 4) =
k * (cosP * sina - sinP * (1.f - cosa)) / ipt;
398 errorPropTmp(
n, 2, 0) =
k * cosT * dadx / (ipt * sinT);
399 errorPropTmp(
n, 2, 1) =
k * cosT * dady / (ipt * sinT);
400 errorPropTmp(
n, 2, 3) =
k * cosT * (ipt * dadipt - ialpha) / (ipt * ipt * sinT);
401 errorPropTmp(
n, 2, 5) = -
k * ialpha / (ipt * sinT * sinT);
403 errorPropTmp(
n, 4, 0) = dadx;
404 errorPropTmp(
n, 4, 1) = dady;
405 errorPropTmp(
n, 4, 3) = dadipt;
407 MultHelixPropTemp(errorProp, errorPropTmp, errorPropSwap,
n);
408 errorProp = errorPropSwap;
413 "propagation end, dump parameters" 415 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
416 <<
"mom = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 417 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 418 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
419 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
420 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
426 printf(
"%5f %5f %5f %5f %5f %5f\n",
433 printf(
"%5f %5f %5f %5f %5f %5f\n",
440 printf(
"%5f %5f %5f %5f %5f %5f\n",
447 printf(
"%5f %5f %5f %5f %5f %5f\n",
454 printf(
"%5f %5f %5f %5f %5f %5f\n",
461 printf(
"%5f %5f %5f %5f %5f %5f\n",
476 #include "PropagationMPlex.icc" 488 errorProp.setVal(0.
f);
489 outFailFlag.setVal(0.
f);
491 helixAtRFromIterativeCCS_impl(inPar, inChg, msRad, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
519 for (
int kk = 0;
kk < N_proc; ++
kk) {
521 for (
int i = 0;
i < 6; ++
i) {
522 for (
int j = 0;
j < 6; ++
j)
529 for (
int i = 0;
i < 6; ++
i) {
530 for (
int j = 0;
j < 6; ++
j)
541 MultHelixProp(errorProp, outErr,
temp);
542 MultHelixPropTransp(errorProp,
temp, outErr);
553 for (
int n = 0;
n <
NN; ++
n) {
554 if (
n >= N_proc || (outFailFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0)))) {
555 hitsRl(
n, 0, 0) = 0.f;
556 hitsXi(
n, 0, 0) = 0.f;
559 hitsRl(
n, 0, 0) = mat.
radl;
560 hitsXi(
n, 0, 0) = mat.bbxi;
562 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
563 const float r = msRad(
n, 0, 0);
564 propSign(
n, 0, 0) = (r > r0 ? 1. : -1.);
568 for (
int n = 0;
n <
NN; ++
n) {
569 plNrm(
n, 0, 0) =
std::cos(outPar.constAt(
n, 4, 0));
570 plNrm(
n, 1, 0) =
std::sin(outPar.constAt(
n, 4, 0));
571 plNrm(
n, 2, 0) = 0.f;
596 for (
int i = 0;
i < N_proc; ++
i) {
597 if (outFailFlag(
i, 0, 0)) {
598 outPar.copySlot(
i, inPar);
599 outErr.copySlot(
i, inErr);
625 helixAtZ(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
629 for (
int kk = 0;
kk < N_proc; ++
kk) {
631 for (
int i = 0;
i < 6; ++
i) {
637 for (
int i = 0;
i < 6; ++
i) {
638 for (
int j = 0;
j < 6; ++
j)
645 for (
int i = 0;
i < 6; ++
i) {
646 for (
int j = 0;
j < 6; ++
j)
657 for (
int kk = 0;
kk < N_proc; ++
kk) {
659 for (
int i = 0;
i < 6; ++
i) {
660 for (
int j = 0;
j < 6; ++
j)
671 MultHelixPropEndcap(errorProp, outErr,
temp);
672 MultHelixPropTranspEndcap(errorProp,
temp, outErr);
683 for (
int n = 0;
n <
NN; ++
n) {
684 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
685 hitsRl(
n, 0, 0) = 0.f;
686 hitsXi(
n, 0, 0) = 0.f;
688 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
690 hitsRl(
n, 0, 0) = mat.
radl;
691 hitsXi(
n, 0, 0) = mat.bbxi;
693 const float zout = msZ.constAt(
n, 0, 0);
694 const float zin = inPar.constAt(
n, 2, 0);
699 for (
int n = 0;
n <
NN; ++
n) {
700 plNrm(
n, 0, 0) = 0.f;
701 plNrm(
n, 1, 0) = 0.f;
702 plNrm(
n, 2, 0) = 1.f;
707 for (
int kk = 0;
kk < N_proc; ++
kk) {
709 for (
int i = 0;
i < 1; ++
i) {
714 for (
int i = 0;
i < 3; ++
i) {
718 dprintf(
"outErr(after material) %d\n",
kk);
719 for (
int i = 0;
i < 6; ++
i) {
720 for (
int j = 0;
j < 6; ++
j)
735 for (
int i = 0;
i < N_proc; ++
i) {
736 if (outFailFlag(
i, 0, 0)) {
737 outPar.copySlot(
i, inPar);
738 outErr.copySlot(
i, inErr);
752 errorProp.setVal(0.
f);
753 outFailFlag.setVal(0.
f);
757 for (
int n = 0;
n <
NN; ++
n) {
759 errorProp(
n, 0, 0) = 1.f;
760 errorProp(
n, 1, 1) = 1.f;
761 errorProp(
n, 3, 3) = 1.f;
762 errorProp(
n, 4, 4) = 1.f;
763 errorProp(
n, 5, 5) = 1.f;
771 for (
int n = 0;
n <
NN; ++
n) {
773 zout[
n] = msZ.constAt(
n, 0, 0);
774 zin[
n] = inPar.constAt(
n, 2, 0);
775 ipt[
n] = inPar.constAt(
n, 3, 0);
776 phiin[
n] = inPar.constAt(
n, 4, 0);
777 theta[
n] = inPar.constAt(
n, 5, 0);
783 for (
int n = 0;
n <
NN; ++
n) {
784 k[
n] = inChg.constAt(
n, 0, 0) * 100.f /
789 for (
int n = 0;
n <
NN; ++
n) {
796 for (
int n = 0;
n <
NN; ++
n) {
797 kinv[
n] = 1.f /
k[
n];
801 for (
int n = 0;
n <
NN; ++
n) {
804 <<
"input parameters" 805 <<
" inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.constAt(
n, 0, 0)
806 <<
" inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.constAt(
n, 1, 0)
807 <<
" inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.constAt(
n, 2, 0)
808 <<
" inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.constAt(
n, 3, 0)
809 <<
" inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.constAt(
n, 4, 0)
810 <<
" inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.constAt(
n, 5, 0)
811 <<
" inChg.constAt(n, 0, 0)=" << std::setprecision(9) << inChg.constAt(
n, 0, 0));
814 for (
int n = 0;
n <
NN; ++
n) {
816 "propagation start, dump parameters" 818 <<
"pos = " << inPar.constAt(
n, 0, 0) <<
" " << inPar.constAt(
n, 1, 0) <<
" " 819 << inPar.constAt(
n, 2, 0) << std::endl
820 <<
"mom (cart) = " <<
std::cos(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 821 <<
std::sin(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 822 << 1. / (inPar.constAt(
n, 3, 0) *
tan(inPar.constAt(
n, 5, 0))) <<
" r=" 823 <<
std::sqrt(inPar.constAt(
n, 0, 0) * inPar.constAt(
n, 0, 0) +
824 inPar.constAt(
n, 1, 0) * inPar.constAt(
n, 1, 0))
825 <<
" pT=" << 1. /
std::abs(inPar.constAt(
n, 3, 0)) <<
" q=" << inChg.constAt(
n, 0, 0)
826 <<
" targetZ=" << msZ.constAt(
n, 0, 0) << std::endl);
831 for (
int n = 0;
n <
NN; ++
n) {
832 pt[
n] = 1.f / ipt[
n];
839 for (
int n = 0;
n <
NN; ++
n) {
844 for (
int n = 0;
n <
NN; ++
n) {
851 for (
int n = 0;
n <
NN; ++
n) {
856 for (
int n = 0;
n <
NN; ++
n) {
865 for (
int n = 0;
n <
NN; ++
n) {
866 tanT[
n] = sinT[
n] / cosT[
n];
867 icos2T[
n] = 1.f / (cosT[
n] * cosT[
n]);
868 pxin[
n] = cosP[
n] *
pt[
n];
869 pyin[
n] = sinP[
n] *
pt[
n];
875 for (
int n = 0;
n <
NN; ++
n) {
883 #if !defined(__INTEL_COMPILER) 886 for (
int n = 0;
n <
NN; ++
n) {
890 #if !defined(__INTEL_COMPILER) 893 for (
int n = 0;
n <
NN; ++
n) {
896 #if !defined(__INTEL_COMPILER) 899 for (
int n = 0;
n <
NN; ++
n) {
909 for (
int n = 0;
n <
NN; ++
n) {
910 cosah[
n] = cosahTmp[
n];
911 sinah[
n] = sinahTmp[
n];
912 cosa[
n] = 1.f - 2.f * sinah[
n] * sinah[
n];
913 sina[
n] = 2.f * sinah[
n] * cosah[
n];
918 for (
int n = 0;
n <
NN; ++
n) {
919 outPar.At(
n, 0, 0) = outPar.At(
n, 0, 0) + 2.f *
k[
n] * sinah[
n] * (pxin[
n] * cosah[
n] - pyin[
n] * sinah[
n]);
920 outPar.At(
n, 1, 0) = outPar.At(
n, 1, 0) + 2.f *
k[
n] * sinah[
n] * (pyin[
n] * cosah[
n] + pxin[
n] * sinah[
n]);
921 outPar.At(
n, 2, 0) = zout[
n];
922 outPar.At(
n, 4, 0) = phiin[
n] +
alpha[
n];
926 for (
int n = 0;
n <
NN; ++
n) {
928 "propagation to Z end (OLD), dump parameters\n" 929 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 930 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
931 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
932 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 933 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 934 << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0))) <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0))
940 for (
int n = 0;
n <
NN; ++
n) {
941 pxcaMpysa[
n] = pxin[
n] * cosa[
n] - pyin[
n] * sina[
n];
945 for (
int n = 0;
n <
NN; ++
n) {
946 errorProp(
n, 0, 2) = -tanT[
n] * ipt[
n] * pxcaMpysa[
n];
949 (cosP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) + sinP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
950 errorProp(
n, 0, 4) = -2.f *
k[
n] *
pt[
n] * sinah[
n] * (sinP[
n] * cosah[
n] + cosP[
n] * sinah[
n]);
951 errorProp(
n, 0, 5) =
deltaZ[
n] * ipt[
n] * pxcaMpysa[
n] * icos2T[
n];
956 for (
int n = 0;
n <
NN; ++
n) {
957 pycaPpxsa[
n] = pyin[
n] * cosa[
n] + pxin[
n] * sina[
n];
961 for (
int n = 0;
n <
NN; ++
n) {
962 errorProp(
n, 1, 2) = -tanT[
n] * ipt[
n] * pycaPpxsa[
n];
965 (sinP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) - cosP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
966 errorProp(
n, 1, 4) = 2.f *
k[
n] *
pt[
n] * sinah[
n] * (cosP[
n] * cosah[
n] - sinP[
n] * sinah[
n]);
967 errorProp(
n, 1, 5) =
deltaZ[
n] * ipt[
n] * pycaPpxsa[
n] * icos2T[
n];
971 for (
int n = 0;
n <
NN; ++
n) {
972 errorProp(
n, 4, 2) = -ipt[
n] * tanT[
n] * kinv[
n];
973 errorProp(
n, 4, 3) = tanT[
n] *
deltaZ[
n] * kinv[
n];
974 errorProp(
n, 4, 5) = ipt[
n] *
deltaZ[
n] * kinv[
n] * icos2T[
n];
978 for (
int n = 0;
n <
NN; ++
n) {
981 "propagation end, dump parameters" 983 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
984 <<
"mom (cart) = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 985 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 986 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
987 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
988 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
1016 for (
int n = 0;
n < N_proc; ++
n) {
1019 printf(
"%5f %5f %5f %5f %5f %5f\n",
1025 errorProp(
n, 0, 5));
1026 printf(
"%5f %5f %5f %5f %5f %5f\n",
1032 errorProp(
n, 1, 5));
1033 printf(
"%5f %5f %5f %5f %5f %5f\n",
1039 errorProp(
n, 2, 5));
1040 printf(
"%5f %5f %5f %5f %5f %5f\n",
1046 errorProp(
n, 3, 5));
1047 printf(
"%5f %5f %5f %5f %5f %5f\n",
1053 errorProp(
n, 4, 5));
1054 printf(
"%5f %5f %5f %5f %5f %5f\n",
1060 errorProp(
n, 5, 5));
1076 errorProp.setVal(0.
f);
1077 outFailFlag.setVal(0.
f);
1079 helixAtPlane_impl(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
1101 helixAtPlane(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, N_proc, pflags);
1103 for (
int n = 0;
n <
NN; ++
n) {
1106 "propagation to plane end, dump parameters\n" 1108 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 1109 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
1110 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
1111 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 1112 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0)))
1113 <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0)) << std::endl);
1118 for (
int kk = 0;
kk < N_proc; ++
kk) {
1120 for (
int i = 0;
i < 6; ++
i) {
1125 for (
int i = 0;
i < 6; ++
i) {
1126 for (
int j = 0;
j < 6; ++
j)
1132 for (
int kk = 0;
kk < N_proc; ++
kk) {
1134 for (
int j = 0;
j < 3; ++
j)
1139 for (
int kk = 0;
kk < N_proc; ++
kk) {
1141 for (
int j = 0;
j < 1; ++
j)
1147 for (
int i = 0;
i < 6; ++
i) {
1148 for (
int j = 0;
j < 6; ++
j)
1160 MultHelixPropFull(errorProp, outErr,
temp);
1161 MultHelixPropTranspFull(errorProp,
temp, outErr);
1165 for (
int kk = 0;
kk < N_proc; ++
kk) {
1167 for (
int i = 0;
i < 6; ++
i) {
1168 for (
int j = 0;
j < 6; ++
j)
1185 for (
int n = 0;
n <
NN; ++
n) {
1186 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
1187 hitsRl(
n, 0, 0) = 0.f;
1188 hitsXi(
n, 0, 0) = 0.f;
1190 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
1192 hitsRl(
n, 0, 0) = mat.
radl;
1193 hitsXi(
n, 0, 0) = mat.bbxi;
1195 propSign(
n, 0, 0) = (pathL(
n, 0, 0) > 0.f ? 1.f : -1.f);
1200 for (
int kk = 0;
kk < N_proc; ++
kk) {
1202 for (
int i = 0;
i < 1; ++
i) {
1207 for (
int i = 0;
i < 3; ++
i) {
1211 dprintf(
"outErr(after material) %d\n",
kk);
1212 for (
int i = 0;
i < 6; ++
i) {
1213 for (
int j = 0;
j < 6; ++
j)
1228 for (
int i = 0;
i < N_proc; ++
i) {
1229 if (outFailFlag(
i, 0, 0)) {
1230 outPar.copySlot(
i, inPar);
1231 outErr.copySlot(
i, inErr);
1247 for (
int n = 0;
n <
NN; ++
n) {
1248 float radL = hitsRl.constAt(
n, 0, 0);
1251 const float theta = outPar.constAt(
n, 5, 0);
1253 const float ipt = outPar.constAt(
n, 3, 0);
1254 const float pt = 1.f / ipt;
1255 const float ipt2 = ipt * ipt;
1258 const float p2 =
p *
p;
1259 constexpr
float mpi = 0.140;
1260 constexpr
float mpi2 = mpi * mpi;
1261 const float beta2 =
p2 / (
p2 + mpi2);
1264 const float invCos =
1266 pt *
std::sin(outPar.constAt(
n, 4, 0)) * plNrm.constAt(
n, 1, 0) + pz * plNrm.constAt(
n, 2, 0));
1267 radL = radL * invCos;
1275 const float thetaMSC = 0.0136f * (1.f + 0.038f *
std::log(radL)) / (
beta *
p);
1276 const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1278 outErr.At(
n, 3, 3) += thetaMSC2 * pz * pz * ipt2 * ipt2;
1279 outErr.At(
n, 3, 5) -= thetaMSC2 * pz * ipt2;
1280 outErr.At(
n, 4, 4) += thetaMSC2 *
p2 * ipt2;
1281 outErr.At(
n, 5, 5) += thetaMSC2;
1283 outErr.At(
n, 4, 4) += thetaMSC2;
1284 outErr.At(
n, 5, 5) += thetaMSC2;
1292 const float gamma2 = (
p2 + mpi2) / mpi2;
1294 constexpr
float me = 0.0005;
1295 const float wmax = 2.f *
me * beta2 * gamma2 / (1.f + 2.f *
gamma *
me / mpi +
me *
me / (mpi * mpi));
1296 constexpr
float I = 16.0e-9 * 10.75;
1300 ? (2.f * (hitsXi.constAt(
n, 0, 0) * invCos *
1301 (0.5f *
std::log(2.
f *
me * beta2 * gamma2 *
wmax / (
I *
I)) - beta2 - deltahalf) / beta2))
1305 const float dP = propSign.constAt(
n, 0, 0) *
dEdx /
beta;
1308 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