29 for (
int n = 0;
n <
NN; ++
n) {
30 const float cosA = (psPar[0 *
N +
n] * psPar[3 *
N +
n] + psPar[1 *
N +
n] * psPar[4 *
N +
n]) /
31 (
std::sqrt((psPar[0 *
N +
n] * psPar[0 *
N +
n] + psPar[1 *
N +
n] * psPar[1 *
N +
n]) *
32 (psPar[3 *
N +
n] * psPar[3 *
N +
n] + psPar[4 *
N +
n] * psPar[4 *
N +
n])));
33 const float dr = (
hipo(msPar[0 *
N +
n], msPar[1 *
N +
n]) -
hipo(psPar[0 *
N +
n], psPar[1 *
N +
n])) / cosA;
37 const float pt =
hipo(psPar[3 *
N +
n], psPar[4 *
N +
n]);
38 const float p =
dr /
pt;
39 const float psq =
p *
p;
41 outPar[0 *
N +
n] = psPar[0 *
N +
n] +
p * psPar[3 *
N +
n];
42 outPar[1 *
N +
n] = psPar[1 *
N +
n] +
p * psPar[4 *
N +
n];
43 outPar[2 *
N +
n] = psPar[2 *
N +
n] +
p * psPar[5 *
N +
n];
44 outPar[3 *
N +
n] = psPar[3 *
N +
n];
45 outPar[4 *
N +
n] = psPar[4 *
N +
n];
46 outPar[5 *
N +
n] = psPar[5 *
N +
n];
52 B.fArray[0 *
N +
n] =
A.fArray[0 *
N +
n];
53 B.fArray[1 *
N +
n] =
A.fArray[1 *
N +
n];
54 B.fArray[2 *
N +
n] =
A.fArray[2 *
N +
n];
55 B.fArray[3 *
N +
n] =
A.fArray[3 *
N +
n];
56 B.fArray[4 *
N +
n] =
A.fArray[4 *
N +
n];
57 B.fArray[5 *
N +
n] =
A.fArray[5 *
N +
n];
58 B.fArray[6 *
N +
n] =
A.fArray[6 *
N +
n] +
p *
A.fArray[0 *
N +
n];
59 B.fArray[7 *
N +
n] =
A.fArray[7 *
N +
n] +
p *
A.fArray[1 *
N +
n];
60 B.fArray[8 *
N +
n] =
A.fArray[8 *
N +
n] +
p *
A.fArray[3 *
N +
n];
62 A.fArray[9 *
N +
n] +
p * (
A.fArray[6 *
N +
n] +
A.fArray[6 *
N +
n]) + psq *
A.fArray[0 *
N +
n];
63 B.fArray[10 *
N +
n] =
A.fArray[10 *
N +
n] +
p *
A.fArray[1 *
N +
n];
64 B.fArray[11 *
N +
n] =
A.fArray[11 *
N +
n] +
p *
A.fArray[2 *
N +
n];
65 B.fArray[12 *
N +
n] =
A.fArray[12 *
N +
n] +
p *
A.fArray[4 *
N +
n];
66 B.fArray[13 *
N +
n] =
67 A.fArray[13 *
N +
n] +
p * (
A.fArray[7 *
N +
n] +
A.fArray[10 *
N +
n]) + psq *
A.fArray[1 *
N +
n];
68 B.fArray[14 *
N +
n] =
69 A.fArray[14 *
N +
n] +
p * (
A.fArray[11 *
N +
n] +
A.fArray[11 *
N +
n]) + psq *
A.fArray[2 *
N +
n];
70 B.fArray[15 *
N +
n] =
A.fArray[15 *
N +
n] +
p *
A.fArray[3 *
N +
n];
71 B.fArray[16 *
N +
n] =
A.fArray[16 *
N +
n] +
p *
A.fArray[4 *
N +
n];
72 B.fArray[17 *
N +
n] =
A.fArray[17 *
N +
n] +
p *
A.fArray[5 *
N +
n];
73 B.fArray[18 *
N +
n] =
74 A.fArray[18 *
N +
n] +
p * (
A.fArray[8 *
N +
n] +
A.fArray[15 *
N +
n]) + psq *
A.fArray[3 *
N +
n];
75 B.fArray[19 *
N +
n] =
76 A.fArray[19 *
N +
n] +
p * (
A.fArray[12 *
N +
n] +
A.fArray[16 *
N +
n]) + psq *
A.fArray[4 *
N +
n];
77 B.fArray[20 *
N +
n] =
78 A.fArray[20 *
N +
n] +
p * (
A.fArray[17 *
N +
n] +
A.fArray[17 *
N +
n]) + psq *
A.fArray[5 *
N +
n];
81 dprint_np(
n,
"propagateLineToRMPlex arrive at r=" <<
hipo(outPar[0 *
N +
n], outPar[1 *
N +
n]));
92 using namespace mkfit;
100 const T*
a =
A.fArray;
102 const T*
b =
B.fArray;
107 #include "MultHelixProp.ah" 116 const T*
a =
A.fArray;
118 const T*
b =
B.fArray;
123 #include "MultHelixPropTransp.ah" 132 const T*
a =
A.fArray;
134 const T*
b =
B.fArray;
139 #include "MultHelixPropEndcap.ah" 148 const T*
a =
A.fArray;
150 const T*
b =
B.fArray;
155 #include "MultHelixPropTranspEndcap.ah" 164 const T*
a =
A.fArray;
166 const T*
b =
B.fArray;
171 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] +
172 a[4 *
N +
n] *
b[24 *
N +
n];
173 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] +
174 a[4 *
N +
n] *
b[25 *
N +
n];
175 c[2 *
N +
n] =
a[2 *
N +
n];
176 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] +
177 a[3 *
N +
n] +
a[4 *
N +
n] *
b[27 *
N +
n];
178 c[4 *
N +
n] =
a[0 *
N +
n] *
b[4 *
N +
n] +
a[1 *
N +
n] *
b[10 *
N +
n] +
a[4 *
N +
n];
179 c[5 *
N +
n] =
a[2 *
N +
n] *
b[17 *
N +
n] +
a[5 *
N +
n];
180 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] +
181 a[10 *
N +
n] *
b[24 *
N +
n];
182 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] +
183 a[10 *
N +
n] *
b[25 *
N +
n];
184 c[8 *
N +
n] =
a[8 *
N +
n];
185 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] +
186 a[9 *
N +
n] +
a[10 *
N +
n] *
b[27 *
N +
n];
187 c[10 *
N +
n] =
a[6 *
N +
n] *
b[4 *
N +
n] +
a[7 *
N +
n] *
b[10 *
N +
n] +
a[10 *
N +
n];
188 c[11 *
N +
n] =
a[8 *
N +
n] *
b[17 *
N +
n] +
a[11 *
N +
n];
189 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] +
190 a[16 *
N +
n] *
b[24 *
N +
n];
191 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] +
192 a[16 *
N +
n] *
b[25 *
N +
n];
193 c[14 *
N +
n] =
a[14 *
N +
n];
194 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] +
195 a[15 *
N +
n] +
a[16 *
N +
n] *
b[27 *
N +
n];
196 c[16 *
N +
n] =
a[12 *
N +
n] *
b[4 *
N +
n] +
a[13 *
N +
n] *
b[10 *
N +
n] +
a[16 *
N +
n];
197 c[17 *
N +
n] =
a[14 *
N +
n] *
b[17 *
N +
n] +
a[17 *
N +
n];
198 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] +
199 a[22 *
N +
n] *
b[24 *
N +
n];
200 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] +
201 a[22 *
N +
n] *
b[25 *
N +
n];
202 c[20 *
N +
n] =
a[20 *
N +
n];
203 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] +
204 a[21 *
N +
n] +
a[22 *
N +
n] *
b[27 *
N +
n];
205 c[22 *
N +
n] =
a[18 *
N +
n] *
b[4 *
N +
n] +
a[19 *
N +
n] *
b[10 *
N +
n] +
a[22 *
N +
n];
206 c[23 *
N +
n] =
a[20 *
N +
n] *
b[17 *
N +
n] +
a[23 *
N +
n];
207 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] +
208 a[28 *
N +
n] *
b[24 *
N +
n];
209 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] +
210 a[28 *
N +
n] *
b[25 *
N +
n];
211 c[26 *
N +
n] =
a[26 *
N +
n];
212 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] +
213 a[27 *
N +
n] +
a[28 *
N +
n] *
b[27 *
N +
n];
214 c[28 *
N +
n] =
a[24 *
N +
n] *
b[4 *
N +
n] +
a[25 *
N +
n] *
b[10 *
N +
n] +
a[28 *
N +
n];
215 c[29 *
N +
n] =
a[26 *
N +
n] *
b[17 *
N +
n] +
a[29 *
N +
n];
216 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] +
217 a[34 *
N +
n] *
b[24 *
N +
n];
218 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] +
219 a[34 *
N +
n] *
b[25 *
N +
n];
220 c[32 *
N +
n] =
a[32 *
N +
n];
221 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] +
222 a[33 *
N +
n] +
a[34 *
N +
n] *
b[27 *
N +
n];
223 c[34 *
N +
n] =
a[30 *
N +
n] *
b[4 *
N +
n] +
a[31 *
N +
n] *
b[10 *
N +
n] +
a[34 *
N +
n];
224 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) {
233 for (
int j = 0;
j < 6; ++
j) {
235 for (
int k = 0;
k < 6; ++
k)
245 for (
int n = 0;
n <
NN; ++
n) {
246 for (
int i = 0;
i < 6; ++
i) {
247 for (
int j = 0;
j < 6; ++
j) {
249 for (
int k = 0;
k < 6; ++
k)
259 for (
int n = 0;
n <
NN; ++
n) {
260 for (
int i = 0;
i < 6; ++
i) {
261 for (
int j = 0;
j < 6; ++
j) {
263 for (
int k = 0;
k < 6; ++
k)
273 for (
int n = 0;
n <
NN; ++
n) {
274 for (
int i = 0;
i < 6; ++
i) {
275 for (
int j = 0;
j < 6; ++
j) {
277 for (
int k = 0;
k < 6; ++
k)
301 for (
int n = 0;
n <
NN; ++
n) {
303 errorProp(
n, 0, 0) = 1.f;
304 errorProp(
n, 1, 1) = 1.f;
305 errorProp(
n, 2, 2) = 1.f;
306 errorProp(
n, 3, 3) = 1.f;
307 errorProp(
n, 4, 4) = 1.f;
308 errorProp(
n, 5, 5) = 1.f;
315 dprint_np(
n,
"distance less than 1mum, skip");
319 const float ipt = inPar.
constAt(
n, 3, 0);
320 const float phiin = inPar.
constAt(
n, 4, 0);
324 errorPropTmp(
n, 2, 2) = 1.f;
325 errorPropTmp(
n, 3, 3) = 1.f;
326 errorPropTmp(
n, 4, 4) = 1.f;
327 errorPropTmp(
n, 5, 5) = 1.f;
329 float cosah = 0., sinah = 0.;
333 float pxin = cosP / ipt;
334 float pyin = sinP / ipt;
340 <<
"attempt propagation from r=" << r0 <<
" to r=" <<
r << std::endl
341 <<
"x=" << outPar.
At(
n, 0, 0) <<
" y=" << outPar.
At(
n, 1, 0) <<
" z=" << outPar.
At(
n, 2, 0)
343 <<
" pz=" << 1.f / (ipt *
tan(
theta)) <<
" q=" << inChg.
constAt(
n, 0, 0) << std::endl);
346 const float ialpha = (
r - r0) * ipt /
k;
350 sincos4(ialpha * 0.5
f, sinah, cosah);
355 const float cosa = 1.f - 2.f * sinah * sinah;
356 const float sina = 2.f * sinah * cosah;
359 const float dadx = -outPar.
At(
n, 0, 0) * ipt / (
k * r0);
360 const float dady = -outPar.
At(
n, 1, 0) * ipt / (
k * r0);
361 const float dadipt = (
r - r0) /
k;
363 outPar.
At(
n, 0, 0) = outPar.
constAt(
n, 0, 0) + 2.f *
k * sinah * (pxin * cosah - pyin * sinah);
364 outPar.
At(
n, 1, 0) = outPar.
constAt(
n, 1, 0) + 2.f *
k * sinah * (pyin * cosah + pxin * sinah);
365 const float pxinold = pxin;
366 pxin = pxin * cosa - pyin * sina;
367 pyin = pyin * cosa + pxinold * sina;
374 outPar.
At(
n, 2, 0) = outPar.
constAt(
n, 2, 0) +
k * ialpha * cosT / (ipt * sinT);
375 outPar.
At(
n, 3, 0) = ipt;
376 outPar.
At(
n, 4, 0) = outPar.
constAt(
n, 4, 0) + ialpha;
379 errorPropTmp(
n, 0, 0) = 1.f +
k * (cosP * dadx * cosa - sinP * dadx * sina) / ipt;
380 errorPropTmp(
n, 0, 1) =
k * (cosP * dady * cosa - sinP * dady * sina) / ipt;
381 errorPropTmp(
n, 0, 3) =
382 k * (cosP * (ipt * dadipt * cosa - sina) + sinP * ((1.
f - cosa) - ipt * dadipt * sina)) / (ipt * ipt);
383 errorPropTmp(
n, 0, 4) = -
k * (sinP * sina + cosP * (1.f - cosa)) / ipt;
385 errorPropTmp(
n, 1, 0) =
k * (sinP * dadx * cosa + cosP * dadx * sina) / ipt;
386 errorPropTmp(
n, 1, 1) = 1.f +
k * (sinP * dady * cosa + cosP * dady * sina) / ipt;
387 errorPropTmp(
n, 1, 3) =
388 k * (sinP * (ipt * dadipt * cosa - sina) + cosP * (ipt * dadipt * sina - (1.
f - cosa))) / (ipt * ipt);
389 errorPropTmp(
n, 1, 4) =
k * (cosP * sina - sinP * (1.f - cosa)) / ipt;
391 errorPropTmp(
n, 2, 0) =
k * cosT * dadx / (ipt * sinT);
392 errorPropTmp(
n, 2, 1) =
k * cosT * dady / (ipt * sinT);
393 errorPropTmp(
n, 2, 3) =
k * cosT * (ipt * dadipt - ialpha) / (ipt * ipt * sinT);
394 errorPropTmp(
n, 2, 5) = -
k * ialpha / (ipt * sinT * sinT);
396 errorPropTmp(
n, 4, 0) = dadx;
397 errorPropTmp(
n, 4, 1) = dady;
398 errorPropTmp(
n, 4, 3) = dadipt;
400 MultHelixPropTemp(errorProp, errorPropTmp, errorPropSwap,
n);
401 errorProp = errorPropSwap;
406 "propagation end, dump parameters" 408 <<
"pos = " << outPar.
At(
n, 0, 0) <<
" " << outPar.
At(
n, 1, 0) <<
" " << outPar.
At(
n, 2, 0) << std::endl
409 <<
"mom = " <<
std::cos(outPar.
At(
n, 4, 0)) / outPar.
At(
n, 3, 0) <<
" " 411 << 1. / (outPar.
At(
n, 3, 0) *
tan(outPar.
At(
n, 5, 0)))
412 <<
" r=" <<
std::sqrt(outPar.
At(
n, 0, 0) * outPar.
At(
n, 0, 0) + outPar.
At(
n, 1, 0) * outPar.
At(
n, 1, 0))
413 <<
" pT=" << 1. /
std::abs(outPar.
At(
n, 3, 0)) << std::endl);
419 printf(
"%5f %5f %5f %5f %5f %5f\n",
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",
469 #include "PropagationMPlex.icc" 484 helixAtRFromIterativeCCS_impl(inPar, inChg, msRad, outPar, errorProp, outFailFlag, 0,
NN, N_proc, pflags);
512 for (
int kk = 0;
kk < N_proc; ++
kk) {
514 for (
int i = 0;
i < 6; ++
i) {
515 for (
int j = 0;
j < 6; ++
j)
522 for (
int i = 0;
i < 6; ++
i) {
523 for (
int j = 0;
j < 6; ++
j)
537 for (
int n = 0;
n < N_proc; ++
n) {
538 if (failFlag(
n, 0, 0) || (noMatEffPtr && noMatEffPtr->
constAt(
n, 0, 0))) {
539 hitsRl(
n, 0, 0) = 0.f;
540 hitsXi(
n, 0, 0) = 0.f;
544 hitsRl(
n, 0, 0) = (zbin >= 0 && zbin < Config::nBinsZME && rbin >= 0 && rbin <
Config::nBinsRME)
547 hitsXi(
n, 0, 0) = (zbin >= 0 && zbin < Config::nBinsZME && rbin >= 0 && rbin <
Config::nBinsRME)
551 const float r0 =
hipo(inPar(
n, 0, 0), inPar(
n, 1, 0));
552 const float r = msRad(
n, 0, 0);
553 propSign(
n, 0, 0) = (
r > r0 ? 1. : -1.);
565 MultHelixProp(errorProp, outErr,
temp);
566 MultHelixPropTransp(errorProp,
temp, outErr);
585 for (
int i = 0;
i < N_proc; ++
i) {
586 if (failFlag(
i, 0, 0)) {
611 helixAtZ(inPar, inChg, msZ, outPar, errorProp, N_proc, pflags);
615 for (
int kk = 0;
kk < N_proc; ++
kk) {
617 for (
int i = 0;
i < 6; ++
i) {
618 for (
int j = 0;
j < 6; ++
j)
625 for (
int i = 0;
i < 6; ++
i) {
626 for (
int j = 0;
j < 6; ++
j)
640 for (
int n = 0;
n < N_proc; ++
n) {
641 if (noMatEffPtr && noMatEffPtr->
constAt(
n, 0, 0)) {
642 hitsRl(
n, 0, 0) = 0.f;
643 hitsXi(
n, 0, 0) = 0.f;
647 hitsRl(
n, 0, 0) = (zbin >= 0 && zbin < Config::nBinsZME && rbin >= 0 && rbin <
Config::nBinsRME)
650 hitsXi(
n, 0, 0) = (zbin >= 0 && zbin < Config::nBinsZME && rbin >= 0 && rbin <
Config::nBinsRME)
654 const float zout = msZ.
constAt(
n, 0, 0);
655 const float zin = inPar.
constAt(
n, 2, 0);
666 MultHelixPropEndcap(errorProp, outErr,
temp);
667 MultHelixPropTranspEndcap(errorProp,
temp, outErr);
707 for (
int n = 0;
n <
NN; ++
n) {
709 errorProp(
n, 0, 0) = 1.f;
710 errorProp(
n, 1, 1) = 1.f;
711 errorProp(
n, 3, 3) = 1.f;
712 errorProp(
n, 4, 4) = 1.f;
713 errorProp(
n, 5, 5) = 1.f;
721 for (
int n = 0;
n <
NN; ++
n) {
733 for (
int n = 0;
n <
NN; ++
n) {
739 for (
int n = 0;
n <
NN; ++
n) {
746 for (
int n = 0;
n <
NN; ++
n) {
747 kinv[
n] = 1.f /
k[
n];
751 for (
int n = 0;
n <
NN; ++
n) {
754 <<
"input parameters" 755 <<
" inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 0, 0)
756 <<
" inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 1, 0)
757 <<
" inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 2, 0)
758 <<
" inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 3, 0)
759 <<
" inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 4, 0)
760 <<
" inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.
constAt(
n, 5, 0));
765 for (
int n = 0;
n <
NN; ++
n) {
766 pt[
n] = 1.f / ipt[
n];
773 for (
int n = 0;
n <
NN; ++
n) {
778 for (
int n = 0;
n <
NN; ++
n) {
785 for (
int n = 0;
n <
NN; ++
n) {
790 for (
int n = 0;
n <
NN; ++
n) {
799 for (
int n = 0;
n <
NN; ++
n) {
800 tanT[
n] = sinT[
n] / cosT[
n];
801 icos2T[
n] = 1.f / (cosT[
n] * cosT[
n]);
802 pxin[
n] = cosP[
n] *
pt[
n];
803 pyin[
n] = sinP[
n] *
pt[
n];
806 for (
int n = 0;
n <
NN; ++
n) {
810 <<
"k=" << std::setprecision(9) <<
k[
n] <<
" pxin=" << std::setprecision(9) << pxin[
n]
811 <<
" pyin=" << std::setprecision(9) << pyin[
n] <<
" cosP=" << std::setprecision(9) << cosP[
n]
812 <<
" sinP=" << std::setprecision(9) << sinP[
n] <<
" pt=" << std::setprecision(9) <<
pt[
n]);
817 for (
int n = 0;
n <
NN; ++
n) {
825 #if !defined(__INTEL_COMPILER) 828 for (
int n = 0;
n <
NN; ++
n) {
832 #if !defined(__INTEL_COMPILER) 835 for (
int n = 0;
n <
NN; ++
n) {
838 #if !defined(__INTEL_COMPILER) 841 for (
int n = 0;
n <
NN; ++
n) {
851 for (
int n = 0;
n <
NN; ++
n) {
852 cosah[
n] = cosahTmp[
n];
853 sinah[
n] = sinahTmp[
n];
854 cosa[
n] = 1.f - 2.f * sinah[
n] * sinah[
n];
855 sina[
n] = 2.f * sinah[
n] * cosah[
n];
859 for (
int n = 0;
n <
NN; ++
n) {
860 outPar.
At(
n, 0, 0) = outPar.
At(
n, 0, 0) + 2.f *
k[
n] * sinah[
n] * (pxin[
n] * cosah[
n] - pyin[
n] * sinah[
n]);
861 outPar.
At(
n, 1, 0) = outPar.
At(
n, 1, 0) + 2.f *
k[
n] * sinah[
n] * (pyin[
n] * cosah[
n] + pxin[
n] * sinah[
n]);
862 outPar.
At(
n, 2, 0) = zout[
n];
867 for (
int n = 0;
n <
NN; ++
n) {
870 <<
"outPar.At(n, 0, 0)=" << outPar.
At(
n, 0, 0) <<
" outPar.At(n, 1, 0)=" << outPar.
At(
n, 1, 0)
871 <<
" pxin=" << pxin[
n] <<
" pyin=" << pyin[
n]);
876 for (
int n = 0;
n <
NN; ++
n) {
877 pxcaMpysa[
n] = pxin[
n] * cosa[
n] - pyin[
n] * sina[
n];
881 for (
int n = 0;
n <
NN; ++
n) {
882 errorProp(
n, 0, 2) = -tanT[
n] * ipt[
n] * pxcaMpysa[
n];
885 (cosP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) + sinP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
886 errorProp(
n, 0, 4) = -2.f *
k[
n] *
pt[
n] * sinah[
n] * (sinP[
n] * cosah[
n] + cosP[
n] * sinah[
n]);
887 errorProp(
n, 0, 5) =
deltaZ[
n] * ipt[
n] * pxcaMpysa[
n] * icos2T[
n];
892 for (
int n = 0;
n <
NN; ++
n) {
893 pycaPpxsa[
n] = pyin[
n] * cosa[
n] + pxin[
n] * sina[
n];
897 for (
int n = 0;
n <
NN; ++
n) {
898 errorProp(
n, 1, 2) = -tanT[
n] * ipt[
n] * pycaPpxsa[
n];
901 (sinP[
n] * (
alpha[
n] * cosa[
n] - sina[
n]) - cosP[
n] * 2.
f * sinah[
n] * (sinah[
n] -
alpha[
n] * cosah[
n]));
902 errorProp(
n, 1, 4) = 2.f *
k[
n] *
pt[
n] * sinah[
n] * (cosP[
n] * cosah[
n] - sinP[
n] * sinah[
n]);
903 errorProp(
n, 1, 5) =
deltaZ[
n] * ipt[
n] * pycaPpxsa[
n] * icos2T[
n];
907 for (
int n = 0;
n <
NN; ++
n) {
908 errorProp(
n, 4, 2) = -ipt[
n] * tanT[
n] * kinv[
n];
909 errorProp(
n, 4, 3) = tanT[
n] *
deltaZ[
n] * kinv[
n];
910 errorProp(
n, 4, 5) = ipt[
n] *
deltaZ[
n] * kinv[
n] * icos2T[
n];
914 for (
int n = 0;
n <
NN; ++
n) {
917 "propagation end, dump parameters" 919 <<
"pos = " << outPar.
At(
n, 0, 0) <<
" " << outPar.
At(
n, 1, 0) <<
" " << outPar.
At(
n, 2, 0) << std::endl
920 <<
"mom = " <<
std::cos(outPar.
At(
n, 4, 0)) / outPar.
At(
n, 3, 0) <<
" " 922 << 1. / (outPar.
At(
n, 3, 0) *
tan(outPar.
At(
n, 5, 0)))
923 <<
" r=" <<
std::sqrt(outPar.
At(
n, 0, 0) * outPar.
At(
n, 0, 0) + outPar.
At(
n, 1, 0) * outPar.
At(
n, 1, 0))
924 <<
" pT=" << 1. /
std::abs(outPar.
At(
n, 3, 0)) << std::endl);
929 for (
int n = 0;
n <
NN; ++
n) {
933 printf(
"%5f %5f %5f %5f %5f %5f\n",
940 printf(
"%5f %5f %5f %5f %5f %5f\n",
947 printf(
"%5f %5f %5f %5f %5f %5f\n",
954 printf(
"%5f %5f %5f %5f %5f %5f\n",
961 printf(
"%5f %5f %5f %5f %5f %5f\n",
968 printf(
"%5f %5f %5f %5f %5f %5f\n",
990 for (
int n = 0;
n <
NN; ++
n) {
991 float radL = hitsRl.
constAt(
n, 0, 0);
995 const float pt = 1.f / outPar.
constAt(
n, 3, 0);
997 const float p2 =
p *
p;
998 constexpr
float mpi = 0.140;
999 constexpr
float mpi2 = mpi * mpi;
1000 const float beta2 =
p2 / (
p2 + mpi2);
1004 radL = radL * invCos;
1012 const float thetaMSC = 0.0136f * (1.f + 0.038f *
std::log(radL)) / (
beta *
p);
1013 const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1014 outErr.
At(
n, 4, 4) += thetaMSC2;
1016 outErr.
At(
n, 5, 5) += thetaMSC2;
1023 const float gamma2 = (
p2 + mpi2) / mpi2;
1025 constexpr
float me = 0.0005;
1026 const float wmax = 2.f *
me * beta2 * gamma2 / (1.f + 2.f *
gamma *
me / mpi +
me *
me / (mpi * mpi));
1027 constexpr
float I = 16.0e-9 * 10.75;
1031 ? (2.f * (hitsXi.
constAt(
n, 0, 0) * invCos *
1032 (0.5f *
std::log(2.
f *
me * beta2 * gamma2 *
wmax / (
I *
I)) - beta2 - deltahalf) / beta2))
1039 outErr.
At(
n, 3, 3) += dP * dP / (
p2 *
pt *
pt);
void copySlot(idx_t n, const MatriplexSym &m)
const MaterialEffects materialEff
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)
void propagateHelixToRMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLS &outErr, MPlexLV &outPar, const int N_proc, const PropagationFlags pflags, const MPlexQI *noMatEffPtr)
void squashPhiMPlex(MPlexLV &par, const int N_proc)
int getRbin(const float r) const
const T & constAt(idx_t n, idx_t i, idx_t j) const
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
void propagateHelixToZMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLS &outErr, MPlexLV &outPar, const int N_proc, const PropagationFlags pflags, const MPlexQI *noMatEffPtr)
int getZbin(const float z) const
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 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)
void helixAtZ(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLV &outPar, MPlexLL &errorProp, const int N_proc, const PropagationFlags pflags)
__host__ __device__ V V wmax