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) {
555 if (outFailFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
556 hitsRl(
n, 0, 0) = 0.f;
557 hitsXi(
n, 0, 0) = 0.f;
560 hitsRl(
n, 0, 0) = mat.
radl;
561 hitsXi(
n, 0, 0) = mat.bbxi;
563 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
564 const float r = msRad(
n, 0, 0);
565 propSign(
n, 0, 0) = (r > r0 ? 1. : -1.);
570 for (
int n = 0;
n <
NN; ++
n) {
571 plNrm(
n, 0, 0) =
std::cos(outPar.constAt(
n, 4, 0));
572 plNrm(
n, 1, 0) =
std::sin(outPar.constAt(
n, 4, 0));
573 plNrm(
n, 2, 0) = 0.f;
598 for (
int i = 0;
i < N_proc; ++
i) {
599 if (outFailFlag(
i, 0, 0)) {
600 outPar.copySlot(
i, inPar);
601 outErr.copySlot(
i, inErr);
627 helixAtZ(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
631 for (
int kk = 0;
kk < N_proc; ++
kk) {
633 for (
int i = 0;
i < 6; ++
i) {
639 for (
int i = 0;
i < 6; ++
i) {
640 for (
int j = 0;
j < 6; ++
j)
647 for (
int i = 0;
i < 6; ++
i) {
648 for (
int j = 0;
j < 6; ++
j)
659 for (
int kk = 0;
kk < N_proc; ++
kk) {
661 for (
int i = 0;
i < 6; ++
i) {
662 for (
int j = 0;
j < 6; ++
j)
673 MultHelixPropEndcap(errorProp, outErr,
temp);
674 MultHelixPropTranspEndcap(errorProp,
temp, outErr);
685 for (
int n = 0;
n <
NN; ++
n) {
686 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
687 hitsRl(
n, 0, 0) = 0.f;
688 hitsXi(
n, 0, 0) = 0.f;
690 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
692 hitsRl(
n, 0, 0) = mat.
radl;
693 hitsXi(
n, 0, 0) = mat.bbxi;
696 const float zout = msZ.constAt(
n, 0, 0);
697 const float zin = inPar.constAt(
n, 2, 0);
703 for (
int n = 0;
n <
NN; ++
n) {
704 plNrm(
n, 0, 0) = 0.f;
705 plNrm(
n, 1, 0) = 0.f;
706 plNrm(
n, 2, 0) = 1.f;
711 for (
int kk = 0;
kk < N_proc; ++
kk) {
713 for (
int i = 0;
i < 1; ++
i) {
718 for (
int i = 0;
i < 3; ++
i) {
722 dprintf(
"outErr(after material) %d\n",
kk);
723 for (
int i = 0;
i < 6; ++
i) {
724 for (
int j = 0;
j < 6; ++
j)
739 for (
int i = 0;
i < N_proc; ++
i) {
740 if (outFailFlag(
i, 0, 0)) {
741 outPar.copySlot(
i, inPar);
742 outErr.copySlot(
i, inErr);
756 errorProp.setVal(0.
f);
757 outFailFlag.setVal(0.
f);
761 for (
int n = 0;
n <
NN; ++
n) {
763 errorProp(
n, 0, 0) = 1.f;
764 errorProp(
n, 1, 1) = 1.f;
765 errorProp(
n, 3, 3) = 1.f;
766 errorProp(
n, 4, 4) = 1.f;
767 errorProp(
n, 5, 5) = 1.f;
775 for (
int n = 0;
n <
NN; ++
n) {
777 zout[
n] = msZ.constAt(
n, 0, 0);
778 zin[
n] = inPar.constAt(
n, 2, 0);
779 ipt[
n] = inPar.constAt(
n, 3, 0);
780 phiin[
n] = inPar.constAt(
n, 4, 0);
781 theta[
n] = inPar.constAt(
n, 5, 0);
787 for (
int n = 0;
n <
NN; ++
n) {
788 k[
n] = inChg.constAt(
n, 0, 0) * 100.f /
793 for (
int n = 0;
n <
NN; ++
n) {
800 for (
int n = 0;
n <
NN; ++
n) {
801 kinv[
n] = 1.f /
k[
n];
805 for (
int n = 0;
n <
NN; ++
n) {
808 <<
"input parameters" 809 <<
" inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.constAt(
n, 0, 0)
810 <<
" inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.constAt(
n, 1, 0)
811 <<
" inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.constAt(
n, 2, 0)
812 <<
" inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.constAt(
n, 3, 0)
813 <<
" inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.constAt(
n, 4, 0)
814 <<
" inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.constAt(
n, 5, 0)
815 <<
" inChg.constAt(n, 0, 0)=" << std::setprecision(9) << inChg.constAt(
n, 0, 0));
818 for (
int n = 0;
n <
NN; ++
n) {
820 "propagation start, dump parameters" 822 <<
"pos = " << inPar.constAt(
n, 0, 0) <<
" " << inPar.constAt(
n, 1, 0) <<
" " 823 << inPar.constAt(
n, 2, 0) << std::endl
824 <<
"mom (cart) = " <<
std::cos(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 825 <<
std::sin(inPar.constAt(
n, 4, 0)) / inPar.constAt(
n, 3, 0) <<
" " 826 << 1. / (inPar.constAt(
n, 3, 0) *
tan(inPar.constAt(
n, 5, 0))) <<
" r=" 827 <<
std::sqrt(inPar.constAt(
n, 0, 0) * inPar.constAt(
n, 0, 0) +
828 inPar.constAt(
n, 1, 0) * inPar.constAt(
n, 1, 0))
829 <<
" pT=" << 1. /
std::abs(inPar.constAt(
n, 3, 0)) <<
" q=" << inChg.constAt(
n, 0, 0)
830 <<
" targetZ=" << msZ.constAt(
n, 0, 0) << std::endl);
835 for (
int n = 0;
n <
NN; ++
n) {
836 pt[
n] = 1.f / ipt[
n];
843 for (
int n = 0;
n <
NN; ++
n) {
848 for (
int n = 0;
n <
NN; ++
n) {
855 for (
int n = 0;
n <
NN; ++
n) {
860 for (
int n = 0;
n <
NN; ++
n) {
869 for (
int n = 0;
n <
NN; ++
n) {
870 tanT[
n] = sinT[
n] / cosT[
n];
871 icos2T[
n] = 1.f / (cosT[
n] * cosT[
n]);
872 pxin[
n] = cosP[
n] *
pt[
n];
873 pyin[
n] = sinP[
n] *
pt[
n];
879 for (
int n = 0;
n <
NN; ++
n) {
887 #if !defined(__INTEL_COMPILER) 890 for (
int n = 0;
n <
NN; ++
n) {
894 #if !defined(__INTEL_COMPILER) 897 for (
int n = 0;
n <
NN; ++
n) {
900 #if !defined(__INTEL_COMPILER) 903 for (
int n = 0;
n <
NN; ++
n) {
913 for (
int n = 0;
n <
NN; ++
n) {
914 cosah[
n] = cosahTmp[
n];
915 sinah[
n] = sinahTmp[
n];
916 cosa[
n] = 1.f - 2.f * sinah[
n] * sinah[
n];
917 sina[
n] = 2.f * sinah[
n] * cosah[
n];
922 for (
int n = 0;
n <
NN; ++
n) {
923 outPar.At(
n, 0, 0) = outPar.At(
n, 0, 0) + 2.f *
k[
n] * sinah[
n] * (pxin[
n] * cosah[
n] - pyin[
n] * sinah[
n]);
924 outPar.At(
n, 1, 0) = outPar.At(
n, 1, 0) + 2.f *
k[
n] * sinah[
n] * (pyin[
n] * cosah[
n] + pxin[
n] * sinah[
n]);
925 outPar.At(
n, 2, 0) = zout[
n];
926 outPar.At(
n, 4, 0) = phiin[
n] +
alpha[
n];
930 for (
int n = 0;
n <
NN; ++
n) {
932 "propagation to Z end (OLD), dump parameters\n" 933 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 934 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
935 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
936 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 937 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 938 << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0))) <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0))
944 for (
int n = 0;
n <
NN; ++
n) {
945 pxcaMpysa[
n] = pxin[
n] * cosa[
n] - pyin[
n] * sina[
n];
949 for (
int n = 0;
n <
NN; ++
n) {
950 errorProp(
n, 0, 2) = -tanT[
n] * ipt[
n] * pxcaMpysa[
n];
953 (cosP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) + sinP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
954 errorProp(
n, 0, 4) = -2.f *
k[
n] *
pt[
n] * sinah[
n] * (sinP[
n] * cosah[
n] + cosP[
n] * sinah[
n]);
955 errorProp(
n, 0, 5) =
deltaZ[
n] * ipt[
n] * pxcaMpysa[
n] * icos2T[
n];
960 for (
int n = 0;
n <
NN; ++
n) {
961 pycaPpxsa[
n] = pyin[
n] * cosa[
n] + pxin[
n] * sina[
n];
965 for (
int n = 0;
n <
NN; ++
n) {
966 errorProp(
n, 1, 2) = -tanT[
n] * ipt[
n] * pycaPpxsa[
n];
969 (sinP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) - cosP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
970 errorProp(
n, 1, 4) = 2.f *
k[
n] *
pt[
n] * sinah[
n] * (cosP[
n] * cosah[
n] - sinP[
n] * sinah[
n]);
971 errorProp(
n, 1, 5) =
deltaZ[
n] * ipt[
n] * pycaPpxsa[
n] * icos2T[
n];
975 for (
int n = 0;
n <
NN; ++
n) {
976 errorProp(
n, 4, 2) = -ipt[
n] * tanT[
n] * kinv[
n];
977 errorProp(
n, 4, 3) = tanT[
n] *
deltaZ[
n] * kinv[
n];
978 errorProp(
n, 4, 5) = ipt[
n] *
deltaZ[
n] * kinv[
n] * icos2T[
n];
982 for (
int n = 0;
n <
NN; ++
n) {
985 "propagation end, dump parameters" 987 <<
"pos = " << outPar.At(
n, 0, 0) <<
" " << outPar.At(
n, 1, 0) <<
" " << outPar.At(
n, 2, 0) << std::endl
988 <<
"mom (cart) = " <<
std::cos(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 989 <<
std::sin(outPar.At(
n, 4, 0)) / outPar.At(
n, 3, 0) <<
" " 990 << 1. / (outPar.At(
n, 3, 0) *
tan(outPar.At(
n, 5, 0)))
991 <<
" r=" <<
std::sqrt(outPar.At(
n, 0, 0) * outPar.At(
n, 0, 0) + outPar.At(
n, 1, 0) * outPar.At(
n, 1, 0))
992 <<
" pT=" << 1. /
std::abs(outPar.At(
n, 3, 0)) << std::endl);
1020 for (
int n = 0;
n < N_proc; ++
n) {
1023 printf(
"%5f %5f %5f %5f %5f %5f\n",
1029 errorProp(
n, 0, 5));
1030 printf(
"%5f %5f %5f %5f %5f %5f\n",
1036 errorProp(
n, 1, 5));
1037 printf(
"%5f %5f %5f %5f %5f %5f\n",
1043 errorProp(
n, 2, 5));
1044 printf(
"%5f %5f %5f %5f %5f %5f\n",
1050 errorProp(
n, 3, 5));
1051 printf(
"%5f %5f %5f %5f %5f %5f\n",
1057 errorProp(
n, 4, 5));
1058 printf(
"%5f %5f %5f %5f %5f %5f\n",
1064 errorProp(
n, 5, 5));
1080 errorProp.setVal(0.
f);
1081 outFailFlag.setVal(0.
f);
1083 helixAtPlane_impl(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
1105 helixAtPlane(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, N_proc, pflags);
1107 for (
int n = 0;
n <
NN; ++
n) {
1110 "propagation to plane end, dump parameters\n" 1112 <<
" pos = " << outPar(
n, 0, 0) <<
" " << outPar(
n, 1, 0) <<
" " << outPar(
n, 2, 0) <<
"\t\t r=" 1113 <<
std::sqrt(outPar(
n, 0, 0) * outPar(
n, 0, 0) + outPar(
n, 1, 0) * outPar(
n, 1, 0)) << std::endl
1114 <<
" mom = " << outPar(
n, 3, 0) <<
" " << outPar(
n, 4, 0) <<
" " << outPar(
n, 5, 0) << std::endl
1115 <<
" cart= " <<
std::cos(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " 1116 <<
std::sin(outPar(
n, 4, 0)) / outPar(
n, 3, 0) <<
" " << 1. / (outPar(
n, 3, 0) *
tan(outPar(
n, 5, 0)))
1117 <<
"\t\tpT=" << 1. /
std::abs(outPar(
n, 3, 0)) << std::endl);
1122 for (
int kk = 0;
kk < N_proc; ++
kk) {
1124 for (
int i = 0;
i < 6; ++
i) {
1129 for (
int i = 0;
i < 6; ++
i) {
1130 for (
int j = 0;
j < 6; ++
j)
1136 for (
int kk = 0;
kk < N_proc; ++
kk) {
1138 for (
int j = 0;
j < 3; ++
j)
1143 for (
int kk = 0;
kk < N_proc; ++
kk) {
1145 for (
int j = 0;
j < 1; ++
j)
1151 for (
int i = 0;
i < 6; ++
i) {
1152 for (
int j = 0;
j < 6; ++
j)
1164 MultHelixPropFull(errorProp, outErr,
temp);
1165 MultHelixPropTranspFull(errorProp,
temp, outErr);
1169 for (
int kk = 0;
kk < N_proc; ++
kk) {
1171 for (
int i = 0;
i < 6; ++
i) {
1172 for (
int j = 0;
j < 6; ++
j)
1189 for (
int n = 0;
n <
NN; ++
n) {
1190 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(
n, 0, 0))) {
1191 hitsRl(
n, 0, 0) = 0.f;
1192 hitsXi(
n, 0, 0) = 0.f;
1194 const float hypo =
std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
1196 hitsRl(
n, 0, 0) = mat.
radl;
1197 hitsXi(
n, 0, 0) = mat.bbxi;
1199 propSign(
n, 0, 0) = (pathL(
n, 0, 0) > 0.f ? 1.f : -1.f);
1204 for (
int kk = 0;
kk < N_proc; ++
kk) {
1206 for (
int i = 0;
i < 1; ++
i) {
1211 for (
int i = 0;
i < 3; ++
i) {
1215 dprintf(
"outErr(after material) %d\n",
kk);
1216 for (
int i = 0;
i < 6; ++
i) {
1217 for (
int j = 0;
j < 6; ++
j)
1232 for (
int i = 0;
i < N_proc; ++
i) {
1233 if (outFailFlag(
i, 0, 0)) {
1234 outPar.copySlot(
i, inPar);
1235 outErr.copySlot(
i, inErr);
1251 for (
int n = 0;
n <
NN; ++
n) {
1254 float radL = hitsRl.constAt(
n, 0, 0);
1257 const float theta = outPar.constAt(
n, 5, 0);
1259 const float ipt = outPar.constAt(
n, 3, 0);
1260 const float pt = 1.f / ipt;
1261 const float ipt2 = ipt * ipt;
1264 const float p2 =
p *
p;
1267 const float beta2 =
p2 / (
p2 + mpi2);
1270 const float invCos =
1272 pt *
std::sin(outPar.constAt(
n, 4, 0)) * plNrm.constAt(
n, 1, 0) + pz * plNrm.constAt(
n, 2, 0));
1273 radL = radL * invCos;
1281 const float thetaMSC = 0.0136f * (1.f + 0.038f *
std::log(radL)) / (
beta *
p);
1282 const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1284 outErr.At(
n, 3, 3) += thetaMSC2 * pz * pz * ipt2 * ipt2;
1285 outErr.At(
n, 3, 5) -= thetaMSC2 * pz * ipt2;
1286 outErr.At(
n, 4, 4) += thetaMSC2 *
p2 * ipt2;
1287 outErr.At(
n, 5, 5) += thetaMSC2;
1289 outErr.At(
n, 4, 4) += thetaMSC2;
1290 outErr.At(
n, 5, 5) += thetaMSC2;
1298 const float gamma2 = (
p2 + mpi2) / mpi2;
1301 const float wmax = 2.f *
me * beta2 * gamma2 / (1.f + 2.f *
gamma *
me / mpi +
me *
me / (mpi * mpi));
1306 ? (2.f * (hitsXi.constAt(
n, 0, 0) * invCos *
1307 (0.5f *
std::log(2.
f *
me * beta2 * gamma2 *
wmax / (
I *
I)) - beta2 - deltahalf) / beta2))
1311 const float dP = propSign.constAt(
n, 0, 0) *
dEdx /
beta;
1314 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