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];
233 for (
int n = 0;
n <
NN; ++
n) {
234 for (
int i = 0;
i < 6; ++
i) {
235 for (
int j = 0;
j < 6; ++
j) {
237 for (
int k = 0;
k < 6; ++
k)
247 for (
int n = 0;
n <
NN; ++
n) {
248 for (
int i = 0;
i < 6; ++
i) {
249 for (
int j = 0;
j < 6; ++
j) {
251 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)
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);
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);
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);
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;
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) <<
" " 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" 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)
547 for (
int n = 0;
n <
NN; ++
n) {
548 if (
n >= N_proc || (outFailFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->
constAt(
n, 0, 0)))) {
549 hitsRl(
n, 0, 0) = 0.f;
550 hitsXi(
n, 0, 0) = 0.f;
553 hitsRl(
n, 0, 0) = mat.radl;
554 hitsXi(
n, 0, 0) = mat.bbxi;
556 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
557 const float r = msRad(
n, 0, 0);
558 propSign(
n, 0, 0) = (r > r0 ? 1. : -1.);
570 MultHelixProp(errorProp, outErr,
temp);
571 MultHelixPropTransp(errorProp,
temp, outErr);
588 for (
int i = 0;
i < N_proc; ++
i) {
589 if (outFailFlag(
i, 0, 0)) {
616 helixAtZ(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
620 for (
int kk = 0;
kk < N_proc; ++
kk) {
622 for (
int i = 0;
i < 6; ++
i) {
623 for (
int j = 0;
j < 6; ++
j)
630 for (
int i = 0;
i < 6; ++
i) {
631 for (
int j = 0;
j < 6; ++
j)
648 for (
int n = 0;
n <
NN; ++
n) {
649 if (
n >= N_proc || (noMatEffPtr && noMatEffPtr->
constAt(
n, 0, 0))) {
650 hitsRl(
n, 0, 0) = 0.f;
651 hitsXi(
n, 0, 0) = 0.f;
653 const float hypo = std::hypot(outPar(
n, 0, 0), outPar(
n, 1, 0));
655 hitsRl(
n, 0, 0) = mat.radl;
656 hitsXi(
n, 0, 0) = mat.bbxi;
658 const float zout = msZ.
constAt(
n, 0, 0);
659 const float zin = inPar.
constAt(
n, 2, 0);
670 MultHelixPropEndcap(errorProp, outErr,
temp);
671 MultHelixPropTranspEndcap(errorProp,
temp, outErr);
676 for (
int i = 0;
i < N_proc; ++
i) {
677 if (outFailFlag(
i, 0, 0)) {
723 for (
int n = 0;
n <
NN; ++
n) {
725 errorProp(
n, 0, 0) = 1.f;
726 errorProp(
n, 1, 1) = 1.f;
727 errorProp(
n, 3, 3) = 1.f;
728 errorProp(
n, 4, 4) = 1.f;
729 errorProp(
n, 5, 5) = 1.f;
737 for (
int n = 0;
n <
NN; ++
n) {
749 for (
int n = 0;
n <
NN; ++
n) {
755 for (
int n = 0;
n <
NN; ++
n) {
762 for (
int n = 0;
n <
NN; ++
n) {
763 kinv[
n] = 1.f /
k[
n];
767 for (
int n = 0;
n <
NN; ++
n) {
770 <<
"input parameters" 771 <<
" inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 0, 0)
772 <<
" inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 1, 0)
773 <<
" inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 2, 0)
774 <<
" inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 3, 0)
775 <<
" inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 4, 0)
776 <<
" inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 5, 0));
781 for (
int n = 0;
n <
NN; ++
n) {
782 pt[
n] = 1.f / ipt[
n];
789 for (
int n = 0;
n <
NN; ++
n) {
794 for (
int n = 0;
n <
NN; ++
n) {
801 for (
int n = 0;
n <
NN; ++
n) {
806 for (
int n = 0;
n <
NN; ++
n) {
815 for (
int n = 0;
n <
NN; ++
n) {
816 tanT[
n] = sinT[
n] / cosT[
n];
817 icos2T[
n] = 1.f / (cosT[
n] * cosT[
n]);
818 pxin[
n] = cosP[
n] *
pt[
n];
819 pyin[
n] = sinP[
n] *
pt[
n];
822 for (
int n = 0;
n <
NN; ++
n) {
826 <<
"k=" << std::setprecision(9) <<
k[
n] <<
" pxin=" << std::setprecision(9) << pxin[
n]
827 <<
" pyin=" << std::setprecision(9) << pyin[
n] <<
" cosP=" << std::setprecision(9) << cosP[
n]
828 <<
" sinP=" << std::setprecision(9) << sinP[
n] <<
" pt=" << std::setprecision(9) <<
pt[
n]);
833 for (
int n = 0;
n <
NN; ++
n) {
841 #if !defined(__INTEL_COMPILER) 844 for (
int n = 0;
n <
NN; ++
n) {
848 #if !defined(__INTEL_COMPILER) 851 for (
int n = 0;
n <
NN; ++
n) {
854 #if !defined(__INTEL_COMPILER) 857 for (
int n = 0;
n <
NN; ++
n) {
867 for (
int n = 0;
n <
NN; ++
n) {
868 cosah[
n] = cosahTmp[
n];
869 sinah[
n] = sinahTmp[
n];
870 cosa[
n] = 1.f - 2.f * sinah[
n] * sinah[
n];
871 sina[
n] = 2.f * sinah[
n] * cosah[
n];
875 for (
int n = 0;
n <
NN; ++
n) {
876 outPar.
At(
n, 0, 0) = outPar.
At(
n, 0, 0) + 2.f *
k[
n] * sinah[
n] * (pxin[
n] * cosah[
n] - pyin[
n] * sinah[
n]);
877 outPar.
At(
n, 1, 0) = outPar.
At(
n, 1, 0) + 2.f *
k[
n] * sinah[
n] * (pyin[
n] * cosah[
n] + pxin[
n] * sinah[
n]);
878 outPar.
At(
n, 2, 0) = zout[
n];
883 for (
int n = 0;
n <
NN; ++
n) {
886 <<
"outPar.At(n, 0, 0)=" << outPar.
At(
n, 0, 0) <<
" outPar.At(n, 1, 0)=" << outPar.
At(
n, 1, 0)
887 <<
" pxin=" << pxin[
n] <<
" pyin=" << pyin[
n]);
892 for (
int n = 0;
n <
NN; ++
n) {
893 pxcaMpysa[
n] = pxin[
n] * cosa[
n] - pyin[
n] * sina[
n];
897 for (
int n = 0;
n <
NN; ++
n) {
898 errorProp(
n, 0, 2) = -tanT[
n] * ipt[
n] * pxcaMpysa[
n];
901 (cosP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) + sinP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
902 errorProp(
n, 0, 4) = -2.f *
k[
n] *
pt[
n] * sinah[
n] * (sinP[
n] * cosah[
n] + cosP[
n] * sinah[
n]);
903 errorProp(
n, 0, 5) =
deltaZ[
n] * ipt[
n] * pxcaMpysa[
n] * icos2T[
n];
908 for (
int n = 0;
n <
NN; ++
n) {
909 pycaPpxsa[
n] = pyin[
n] * cosa[
n] + pxin[
n] * sina[
n];
913 for (
int n = 0;
n <
NN; ++
n) {
914 errorProp(
n, 1, 2) = -tanT[
n] * ipt[
n] * pycaPpxsa[
n];
917 (sinP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) - cosP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
918 errorProp(
n, 1, 4) = 2.f *
k[
n] *
pt[
n] * sinah[
n] * (cosP[
n] * cosah[
n] - sinP[
n] * sinah[
n]);
919 errorProp(
n, 1, 5) =
deltaZ[
n] * ipt[
n] * pycaPpxsa[
n] * icos2T[
n];
923 for (
int n = 0;
n <
NN; ++
n) {
924 errorProp(
n, 4, 2) = -ipt[
n] * tanT[
n] * kinv[
n];
925 errorProp(
n, 4, 3) = tanT[
n] *
deltaZ[
n] * kinv[
n];
926 errorProp(
n, 4, 5) = ipt[
n] *
deltaZ[
n] * kinv[
n] * icos2T[
n];
930 for (
int n = 0;
n <
NN; ++
n) {
933 "propagation end, dump parameters" 935 <<
"pos = " << outPar.
At(
n, 0, 0) <<
" " << outPar.
At(
n, 1, 0) <<
" " << outPar.
At(
n, 2, 0) << std::endl
936 <<
"mom = " <<
std::cos(outPar.
At(
n, 4, 0)) / outPar.
At(
n, 3, 0) <<
" " 938 << 1. / (outPar.
At(
n, 3, 0) *
tan(outPar.
At(
n, 5, 0)))
939 <<
" r=" <<
std::sqrt(outPar.
At(
n, 0, 0) * outPar.
At(
n, 0, 0) + outPar.
At(
n, 1, 0) * outPar.
At(
n, 1, 0))
940 <<
" pT=" << 1. /
std::abs(outPar.
At(
n, 3, 0)) << std::endl);
968 for (
int n = 0;
n < N_proc; ++
n) {
971 printf(
"%5f %5f %5f %5f %5f %5f\n",
978 printf(
"%5f %5f %5f %5f %5f %5f\n",
985 printf(
"%5f %5f %5f %5f %5f %5f\n",
992 printf(
"%5f %5f %5f %5f %5f %5f\n",
999 printf(
"%5f %5f %5f %5f %5f %5f\n",
1005 errorProp(
n, 4, 5));
1006 printf(
"%5f %5f %5f %5f %5f %5f\n",
1012 errorProp(
n, 5, 5));
1028 for (
int n = 0;
n <
NN; ++
n) {
1029 float radL = hitsRl.
constAt(
n, 0, 0);
1033 const float pt = 1.f / outPar.
constAt(
n, 3, 0);
1035 const float p2 =
p *
p;
1036 constexpr
float mpi = 0.140;
1037 constexpr
float mpi2 = mpi * mpi;
1038 const float beta2 =
p2 / (
p2 + mpi2);
1042 radL = radL * invCos;
1050 const float thetaMSC = 0.0136f * (1.f + 0.038f *
std::log(radL)) / (
beta *
p);
1051 const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1052 outErr.
At(
n, 4, 4) += thetaMSC2;
1054 outErr.
At(
n, 5, 5) += thetaMSC2;
1061 const float gamma2 = (
p2 + mpi2) / mpi2;
1063 constexpr
float me = 0.0005;
1064 const float wmax = 2.f *
me * beta2 * gamma2 / (1.f + 2.f *
gamma *
me / mpi +
me *
me / (mpi * mpi));
1065 constexpr
float I = 16.0e-9 * 10.75;
1069 ? (2.f * (hitsXi.
constAt(
n, 0, 0) * invCos *
1070 (0.5f *
std::log(2.
f *
me * beta2 * gamma2 *
wmax / (
I *
I)) - beta2 - deltahalf) / beta2))
1077 outErr.
At(
n, 3, 3) += dP * dP / (
p2 *
pt *
pt);
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)
void copySlot(idx_t n, const MatriplexSym &m)
const T & constAt(idx_t n, idx_t i, idx_t j) const
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)
T & At(idx_t n, idx_t i, idx_t j)
const TrackerInfo * tracker_info
void squashPhiMPlex(MPlexLV &par, const int N_proc)
const T & constAt(idx_t n, idx_t i, idx_t j) const
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
float hipo(float x, float y)
float bFieldFromZR(const float z, const float r)
void applyMaterialEffects(const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, MPlexLS &outErr, MPlexLV &outPar, const int N_proc, const bool isBarrel)
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)
Material material_checked(float z, float r) const
void copySlot(idx_t n, const Matriplex &m)
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)
T & At(idx_t n, idx_t i, idx_t j)
__host__ __device__ V V wmax