20#include "GPUParam.inc"
25#if defined(GPUCA_GM_USE_FULL_FIELD)
26#include "AliTracker.h"
36 float gx = getGlobalX(cosAlpha, sinAlpha, X, Y);
37 float gy = getGlobalY(cosAlpha, sinAlpha, X, Y);
39#if defined(GPUCA_GM_USE_FULL_FIELD)
40 const float kCLight = gpu_common_constants::kCLight;
41 double r[3] = {gx, gy, Z};
43 AliTracker::GetBxByBz(
r,
bb);
58 switch (mFieldRegion) {
60 mField->GetFieldIts(gx, gy, Z,
bb);
63 mField->GetFieldTrd(gx, gy, Z,
bb);
67 mField->GetField(gx, gy, Z,
bb);
74 B[0] =
bb[0] * cosAlpha +
bb[1] * sinAlpha;
75 B[1] = -
bb[0] * sinAlpha +
bb[1] * cosAlpha;
88 GetBxByBzBase(cosAlpha, sinAlpha, X, Y, Z,
B);
94 float gx = getGlobalX(cosAlpha, sinAlpha, X, Y);
95 float gy = getGlobalY(cosAlpha, sinAlpha, X, Y);
97#if defined(GPUCA_GM_USE_FULL_FIELD)
98 const float kCLight = gpu_common_constants::kCLight;
99 double r[3] = {gx, gy, Z};
101 AliTracker::GetBxByBz(
r,
bb);
102 return bb[2] * kCLight;
104 switch (mFieldRegion) {
106 return mField->GetFieldItsBz(gx, gy, Z);
108 return mField->GetFieldTrdBz(gx, gy, Z);
111 return mField->GetFieldBz(gx, gy, Z);
123 float newCosAlpha, newSinAlpha;
124 CAMath::SinCos(newAlpha, newSinAlpha, newCosAlpha);
126 float cc = newCosAlpha * mCosAlpha + newSinAlpha * mSinAlpha;
127 float ss = newSinAlpha * mCosAlpha - newCosAlpha * mSinAlpha;
133 float px0 = mT0.Px();
134 float py0 = mT0.Py();
137 if (CAMath::Abs(mT->GetSinPhi()) >= mMaxSinPhi || CAMath::Abs(px0) < (1 - mMaxSinPhi)) {
142 float px1 = px0 *
cc + py0 * ss;
143 float py1 = -px0 * ss + py0 *
cc;
153 if (CAMath::Abs(py1) > mMaxSinPhi * mT0.GetPt() || CAMath::Abs(px1) < (1 - mMaxSinPhi)) {
158 float trackX =
x0 *
cc + ss * mT->Y();
163 if (mPropagateBzOnly) {
164 Bz = GetBzBase(newCosAlpha, newSinAlpha,
t0.X(),
t0.Y(),
t0.Z());
165 if (
t0.PropagateToXBzLight(trackX, Bz, dLp)) {
170 GetBxByBz(newAlpha,
t0.X(),
t0.Y(),
t0.Z(),
B);
172 if (
t0.PropagateToXBxByBz(trackX,
B[0],
B[1],
B[2], dLp)) {
177 if (CAMath::Abs(
t0.SinPhi()) >= mMaxSinPhi) {
194 float j1 = px1 / px0;
200 mT->Y() = -
x0 * ss +
cc * mT->Y();
202 mT->SinPhi() = -CAMath::Sqrt(1.f - mT->SinPhi() * mT->SinPhi()) * ss + mT->SinPhi() *
cc;
205 float*
c = mT->Cov();
207 float c15 =
c[0] * j0 * j2;
208 float c16 =
c[1] * j2;
209 float c17 =
c[3] * j1 * j2;
210 float c18 =
c[6] * j2;
211 float c19 =
c[10] * j2;
212 float c20 =
c[0] * j2 * j2;
222 if (!mFitInProjections && mT->NDF() > 0) {
229 if (
t0.SetDirectionAlongX()) {
230 mT->SinPhi() = -mT->SinPhi();
231 mT->DzDs() = -mT->DzDs();
232 mT->QPt() = -mT->QPt();
246 float j3 = -
t0.Py() /
t0.Px();
247 float j4 = -
t0.Pz() /
t0.Px();
248 float j5 =
t0.QPt() * Bz;
257 float h15 = c15 + c20 * j3;
258 float h16 = c16 + c20 * j4;
259 float h17 = c17 + c20 * j5;
261 c[0] += j3 * (c15 + h15);
263 c[2] += j4 * (c16 + h16);
265 c[3] += c17 * j3 + h15 * j5;
266 c[5] += j5 * (c17 + h17);
275 if (!mFitInProjections && mT->NDF() > 0) {
276 c[1] += c16 * j3 + h15 * j4;
277 c[4] += c17 * j4 + h16 * j5;
285 mCosAlpha = newCosAlpha;
286 mSinAlpha = newSinAlpha;
294 if (mPropagateBzOnly) {
295 return PropagateToXAlphaBz(posX, posAlpha, inFlyDirection);
297 if (CAMath::Abs(posAlpha - mAlpha) > 1.e-4f) {
298 if (RotateToAlpha(posAlpha) != 0) {
302 if (CAMath::Abs(posX - mT->X()) < 1.e-7f) {
308 GetBxByBz(mT0.X(), mT0.Y(), mT0.Z(),
B);
314 if (t0e.PropagateToXBxByBz(posX,
B[0],
B[1],
B[2], dLp) && t0e.PropagateToXBzLight(posX,
B[2], dLp)) {
318 if (CAMath::Abs(t0e.SinPhi()) >= mMaxSinPhi) {
322 return FollowLinearization(t0e,
B[2], dLp, inFlyDirection);
327 if (CAMath::Abs(posAlpha - mAlpha) > 1.e-4f) {
328 if (RotateToAlpha(posAlpha) != 0) {
332 if (CAMath::Abs(posX - mT->X()) < 1.e-7f) {
337 float Bz = GetBz(mT0.X(), mT0.Y(), mT0.Z());
343 if (t0e.PropagateToXBzLight(posX, Bz, dLp)) {
347 if (CAMath::Abs(t0e.SinPhi()) >= mMaxSinPhi) {
351 return FollowLinearization(t0e, Bz, dLp, inFlyDirection);
360 float dS = dLp * t0e.GetPt();
361 float dL = CAMath::Abs(dLp * t0e.GetP());
363 if (inFlyDirection) {
367 float ey = mT0.SinPhi();
368 float ex = mT0.CosPhi();
369 float exi = mT0.SecPhi();
370 float ey1 = t0e.GetSinPhi();
371 float ex1 = t0e.GetCosPhi();
372 float ex1i = t0e.GetSecPhi();
374 float k = -mT0.QPt() * Bz;
375 float dx = t0e.GetX() - mT0.X();
378 float cci = 1.f /
cc;
380 float dxcci = dx * cci;
381 float hh = dxcci * ex1i * (1.f + ex * ex1 + ey * ey1);
383 float j02 = exi * hh;
384 float j04 = -Bz * dxcci * hh;
386 float j24 = -dx * Bz;
388 float* p = mT->Par();
390 float d0 = p[0] - mT0.Y();
391 float d1 = p[1] - mT0.Z();
392 float d2 = p[2] - mT0.SinPhi();
393 float d3 = p[3] - mT0.DzDs();
394 float d4 = p[4] - mT0.QPt();
396 float newSinPhi = ey1 +
d2 + j24 * d4;
406 mT->X() = t0e.GetX();
407 p[0] = t0e.GetY() + d0 + j02 *
d2 + j04 * d4;
408 p[1] = t0e.GetZ() + d1 + j13 * d3;
410 p[3] = t0e.GetDzDs() + d3;
411 p[4] = t0e.GetQPt() + d4;
413 float*
c = mT->Cov();
430 if (mFitInProjections || mT->NDF() <= 0) {
431 float c20ph04c42 = c20 + j04 * c42;
432 float j02c22 = j02 * c22;
433 float j04c44 = j04 * c44;
435 float n6 = c30 + j02 * c32 + j04 * c43;
436 float n7 = c31 + j13 * c33;
437 float n10 = c40 + j02 * c42 + j04c44;
438 float n11 = c41 + j13 * c43;
439 float n12 = c42 + j24 * c44;
441 c[0] += j02 * j02c22 + j04 * j04c44 + 2.f * (j02 * c20ph04c42 + j04 * c40);
442 c[1] += j02 * c21 + j04 * c41 + j13 * n6;
443 c[2] += j13 * (c31 + n7);
444 c[3] = c20ph04c42 + j02c22 + j24 * n10;
445 c[4] = c21 + j13 * c32 + j24 * n11;
446 c[5] = c22 + j24 * (c42 + n12);
449 c[8] = c32 + c43 * j24;
460 float xx = 1.f - 0.25f * kdx * kdx * (1.f + tg * tg);
464 xx = CAMath::Sqrt(xx);
465 float yy = CAMath::Sqrt(ss * ss +
cc *
cc);
467 float j12 = dx * mT0.DzDs() * tg * (2.f + tg * (ey * exi + ey1 * ex1i)) / (xx * yy);
469 if (CAMath::Abs(mT0.QPt()) > 1.e-6f) {
470 j14 = (2.f * xx * ex1i * dx / yy - dS) * mT0.DzDs() / mT0.QPt();
472 j14 = -mT0.DzDs() * Bz * dx * dx * exi * exi * exi * (0.5f * ey + (1.f / 3.f) * kdx * (1 + 2.f * ey * ey) * exi * exi);
475 p[1] += j12 *
d2 + j14 * d4;
477 float h00 = c00 + c20 * j02 + c40 * j04;
479 float h02 = c20 + c22 * j02 + c42 * j04;
481 float h04 = c40 + c42 * j02 + c44 * j04;
483 float h10 = c10 + c20 * j12 + c30 * j13 + c40 * j14;
484 float h11 = c11 + c21 * j12 + c31 * j13 + c41 * j14;
485 float h12 = c21 + c22 * j12 + c32 * j13 + c42 * j14;
486 float h13 = c31 + c32 * j12 + c33 * j13 + c43 * j14;
487 float h14 = c41 + c42 * j12 + c43 * j13 + c44 * j14;
489 float h20 = c20 + c40 * j24;
490 float h21 = c21 + c41 * j24;
491 float h22 = c22 + c42 * j24;
492 float h23 = c32 + c43 * j24;
493 float h24 = c42 + c44 * j24;
495 c[0] = h00 + h02 * j02 + h04 * j04;
497 c[1] = h10 + h12 * j02 + h14 * j04;
498 c[2] = h11 + h12 * j12 + h13 * j13 + h14 * j14;
500 c[3] = h20 + h22 * j02 + h24 * j04;
501 c[4] = h21 + h22 * j12 + h23 * j13 + h24 * j14;
502 c[5] = h22 + h24 * j24;
504 c[6] = c30 + c32 * j02 + c43 * j04;
505 c[7] = c31 + c32 * j12 + c33 * j13 + c43 * j14;
506 c[8] = c32 + c43 * j24;
509 c[10] = c40 + c42 * j02 + c44 * j04;
510 c[11] = c41 + c42 * j12 + c43 * j13 + c44 * j14;
511 c[12] = c42 + c44 * j24;
525 bool maskMS = (CAMath::Abs(dL) < mMaterial.DLMax);
529 float dLabs = CAMath::Abs(dLmask);
533 if (1 || !mToyMCEvents) {
535 float corr = 1.f - mMaterial.EP2 * dLmask;
536 float corrInv = 1.f / corr;
550 mC44 = mC44 * corr * corr + dLabs * mMaterial.sigmadE2;
558 mC22 += dLabs * mMaterial.k22 * mT0.CosPhi() * mT0.CosPhi();
559 mC33 += dLabs * mMaterial.k33;
560 mC43 += dLabs * mMaterial.k43;
561 mC44 += dLabs * mMaterial.k44;
568 float bz = GetBz(mT->X(), mT->Y(), mT->Z());
569 float k = mT0.QPt() * bz;
570 float dx =
x - mT->X();
571 float ex = mT0.CosPhi();
572 float ey = mT0.SinPhi();
573 float ey1 = ey - k * dx;
578 float ex1 = CAMath::Sqrt(1.f - ey1 * ey1);
583 float dxcci = dx /
cc;
584 float dy = dxcci * ss;
585 float norm2 = 1.f + ey * ey1 + ex * ex1;
586 float dl = dxcci * CAMath::Sqrt(norm2 + norm2);
589 float dSin = 0.5f * k * dl;
590 float a = dSin * dSin;
591 const float k2 = 1.f / 6.f;
592 const float k4 = 3.f / 40.f;
593 dS = dl + dl *
a * (k2 +
a * (k4));
595 float dz = dS * mT0.DzDs();
596 projY = mT->Y() + dy;
597 projZ = mT->Z() + dz;
603 GetErr2(err2Y, err2Z,
param, mT0.GetSinPhi(), mT0.DzDs(), posZ, mT->GetX(), mT->GetY(), iRow, clusterState, sector,
time, avgCharge,
charge, mSeedingErrors);
606GPUd()
void GPUTPCGMPropagator::GetErr2(
float&
GPUrestrict() err2Y,
float&
GPUrestrict() err2Z, const
GPUParam&
GPUrestrict()
param,
float snp,
float tgl,
float posZ,
float trackX,
float trackY, int32_t iRow, int16_t clusterState, int8_t sector,
float time,
float avgCharge,
float charge,
bool seedingErrors)
608#ifndef GPUCA_TPC_GEOMETRY_O2
610 param.GetClusterErrorsSeeding2(sector, iRow, posZ, snp, tgl,
time, err2Y, err2Z);
614 param.GetClusterErrors2(sector, iRow, posZ, snp, tgl,
time, avgCharge,
charge, err2Y, err2Z);
616 param.UpdateClusterError2ByState(clusterState, err2Y, err2Z);
617 float statErr2 =
param.GetSystematicClusterErrorIFC2(trackX, trackY, posZ, sector >= (
GPUCA_NSECTORS / 2));
619 statErr2 +=
param.GetSystematicClusterErrorC122(trackX, trackY, sector);
628 GetErr2(err2Y, err2Z,
param, posZ, iRow, clusterState, sector,
time, avgCharge,
charge);
629 return PredictChi2(posY, posZ, err2Y, err2Z);
634 const float* mC = mT->Cov();
635 const float* mP = mT->Par();
636 const float z0 = posY - mP[0];
637 const float z1 = posZ - mP[1];
639 if (!mFitInProjections || mT->NDF() <= 0) {
640 const float w0 = 1.f / (err2Y + mC[0]);
641 const float w2 = 1.f / (err2Z + mC[2]);
642 return w0 * z0 * z0 + w2 *
z1 *
z1;
644 float w0 = mC[2] + err2Z, w1 = mC[1], w2 = mC[0] + err2Y;
646 float det = w0 * w2 - w1 * w1;
647 if (CAMath::Abs(det) < 1.e-10f) {
655 return CAMath::Abs((w0 * z0 + w1 * z1) * z0) + CAMath::Abs((w1 * z0 + w2 * z1) * z1);
659GPUd() int32_t
GPUTPCGMPropagator::Update(
float posY,
float posZ, int32_t iRow, const
GPUParam&
GPUrestrict()
param, int16_t clusterState, int8_t rejectChi2, gputpcgmmergertypes::InterpolationErrorHit* inter,
bool refit, int8_t sector,
float time,
float avgInvCharge,
float invCharge
GPUCA_DEBUG_STREAMER_CHECK(, DebugStreamerVals* debugVals))
662 GetErr2(err2Y, err2Z,
param, posZ, iRow, clusterState, sector,
time, avgInvCharge, invCharge);
665 if (rejectChi2 >= rejectInterFill) {
666 if (rejectChi2 == rejectInterReject && inter->errorY < (GPUCA_MERGER_INTERPOLATION_ERROR_TYPE)0) {
667 rejectChi2 = rejectDirect;
669 int32_t
retVal = InterpolateReject(
param, posY, posZ, clusterState, rejectChi2, inter, err2Y, err2Z);
677 if (mT->NDF() == -5) {
678 mT->ResetCovariance();
679 float* mC = mT->Cov();
680 float* mP = mT->Par();
682 mC[14] = CAMath::Max(0.5f, CAMath::Abs(mP[4]));
683 mC[5] = CAMath::Max(0.2f, CAMath::Abs(mP[2]) / 2);
684 mC[9] = CAMath::Max(0.5f, CAMath::Abs(mP[3]) / 2);
694 return Update(posY, posZ, clusterState, rejectChi2 == rejectDirect, err2Y, err2Z, &
param);
697GPUd() int32_t
GPUTPCGMPropagator::InterpolateReject(const
GPUParam&
GPUrestrict()
param,
float posY,
float posZ, int16_t clusterState, int8_t rejectChi2, gputpcgmmergertypes::InterpolationErrorHit* inter,
float err2Y,
float err2Z)
701 if (rejectChi2 == rejectInterFill) {
704 inter->errorY = mC[0];
705 inter->errorZ = mC[2];
706 }
else if (rejectChi2 == rejectInterReject) {
708 if (mFitInProjections || mT->NDF() <= 0) {
709 const float Iz0 = inter->posY - mP[0];
710 const float Iz1 = inter->posZ - mP[1];
711 const float Iw0 = 1.f / (mC[0] + (
float)inter->errorY);
712 const float Iw2 = 1.f / (mC[2] + (
float)inter->errorZ);
713 const float Ik00 = mC[0] * Iw0;
714 const float Ik11 = mC[2] * Iw2;
715 const float ImP0 = mP[0] + Ik00 * Iz0;
716 const float ImP1 = mP[1] + Ik11 * Iz1;
717 const float ImC0 = mC[0] - Ik00 * mC[0];
718 const float ImC2 = mC[2] - Ik11 * mC[2];
720 const float Jz0 = posY - ImP0;
721 const float Jz1 = posZ - ImP1;
722 const float Jw0 = 1.f / (ImC0 + err2Y);
723 const float Jw2 = 1.f / (ImC2 + err2Z);
724 chiY = Jw0 * Jz0 * Jz0;
725 chiZ = Jw2 * Jz1 * Jz1;
727 const float Iz0 = inter->posY - mP[0];
728 const float Iz1 = inter->posZ - mP[1];
729 float Iw0 = mC[2] + (
float)inter->errorZ;
730 float Iw2 = mC[0] + (
float)inter->errorY;
731 float Idet = CAMath::Max(1e-10f, Iw0 * Iw2 - mC[1] * mC[1]);
734 const float Iw1 = mC[1] * Idet;
736 const float Ik00 = mC[0] * Iw0 + mC[1] * Iw1;
737 const float Ik01 = mC[0] * Iw1 + mC[1] * Iw2;
738 const float Ik10 = mC[1] * Iw0 + mC[2] * Iw1;
739 const float Ik11 = mC[1] * Iw1 + mC[2] * Iw2;
740 const float ImP0 = mP[0] + Ik00 * Iz0 + Ik01 * Iz1;
741 const float ImP1 = mP[1] + Ik10 * Iz0 + Ik11 * Iz1;
742 const float ImC0 = mC[0] - Ik00 * mC[0] + Ik01 * mC[1];
743 const float ImC1 = mC[1] - Ik10 * mC[0] + Ik11 * mC[1];
744 const float ImC2 = mC[2] - Ik10 * mC[1] + Ik11 * mC[2];
745 const float Jz0 = posY - ImP0;
746 const float Jz1 = posZ - ImP1;
747 float Jw0 = ImC2 + err2Z;
748 float Jw2 = ImC0 + err2Y;
749 float Jdet = CAMath::Max(1e-10f, Jw0 * Jw2 - ImC1 * ImC1);
752 const float Jw1 = ImC1 * Jdet;
754 chiY = CAMath::Abs((Jw0 * Jz0 + Jw1 * Jz1) * Jz0);
755 chiZ = CAMath::Abs((Jw1 * Jz0 + Jw2 * Jz1) * Jz1);
757 if (RejectCluster(chiY *
param.rec.tpc.clusterRejectChi2TolleranceY, chiZ *
param.rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) {
758 return updateErrorClusterRejected;
769 const
float d00 = mC[0], d01 = mC[1], d02 = mC[3], d03 = mC[6], d04 = mC[10];
770 const
float d10 = mC[1], d11 = mC[2], d12 = mC[4], d13 = mC[7], d14 = mC[11];
772 const
float z0 = posY - mP[0];
773 const
float z1 = posZ - mP[1];
774 float w0, w1, w2, chiY, chiZ;
775 if (mFitInProjections || mT->NDF() <= 0) {
776 w0 = 1.f / (err2Y + d00);
778 w2 = 1.f / (err2Z + d11);
782 w0 = d11 + err2Z, w1 = d10, w2 = d00 + err2Y;
784 float det = w0 * w2 - w1 * w1;
785 if (CAMath::Abs(det) < 1.e-10f) {
786 return updateErrorFitFailed;
793 chiY = CAMath::Abs((w0 * z0 + w1 * z1) * z0);
794 chiZ = CAMath::Abs((w1 * z0 + w2 * z1) * z1);
796 float dChi2 = chiY + chiZ;
798 if (rejectChi2 == 1 && RejectCluster(chiY *
param->rec.tpc.clusterRejectChi2TolleranceY, chiZ *
param->rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) {
799 return updateErrorClusterRejected;
804 if (mFitInProjections || mT->NDF() <= 0) {
805 const float k00 = d00 * w0;
806 const float k20 = d02 * w0;
807 const float k40 = d04 * w0;
808 const float k11 = d11 * w2;
809 const float k31 = d13 * w2;
826 const float k00 = d00 * w0 + d01 * w1;
827 const float k01 = d00 * w1 + d10 * w2;
828 const float k10 = d01 * w0 + d11 * w1;
829 const float k11 = d01 * w1 + d11 * w2;
830 const float k20 = d02 * w0 + d12 * w1;
831 const float k21 = d02 * w1 + d12 * w2;
832 const float k30 = d03 * w0 + d13 * w1;
833 const float k31 = d03 * w1 + d13 * w2;
834 const float k40 = d04 * w0 + d14 * w1;
835 const float k41 = d04 * w1 + d14 * w2;
837 mP[0] += k00 * z0 + k01 *
z1;
838 mP[1] += k10 * z0 + k11 *
z1;
839 mP[2] += k20 * z0 + k21 *
z1;
840 mP[3] += k30 * z0 + k31 *
z1;
841 mP[4] += k40 * z0 + k41 *
z1;
843 mC[0] -= k00 * d00 + k01 * d10;
845 mC[2] -= k10 * d01 + k11 * d11;
847 mC[3] -= k20 * d00 + k21 * d10;
848 mC[5] -= k20 * d02 + k21 * d12;
850 mC[7] -= k30 * d01 + k31 * d11;
851 mC[9] -= k30 * d03 + k31 * d13;
853 mC[10] -= k40 * d00 + k41 * d10;
854 mC[12] -= k40 * d02 + k41 * d12;
855 mC[14] -= k40 * d04 + k41 * d14;
857 mC[1] -= k10 * d00 + k11 * d10;
858 mC[4] -= k20 * d01 + k21 * d11;
859 mC[6] -= k30 * d00 + k31 * d10;
860 mC[8] -= k30 * d02 + k31 * d12;
861 mC[11] -= k40 * d01 + k41 * d11;
862 mC[13] -= k40 * d03 + k41 * d13;
879 const float log0 = CAMath::Log(5940.f);
880 const float log1 = CAMath::Log(3.5f * 5940.f);
882 bool bad = (
beta2 >= .999f) || (beta2 < 1.e-8f);
889 float b = 0.5f * CAMath::Log(
a);
890 float d = 0.153e-3f /
beta2;
893 float ret = d * (log0 +
b +
c);
894 float case1 = d * (log1 +
c);
896 if (
a > 3.5f * 3.5f) {
910 const float mass = 0.13957f;
912 float qpt = mT0.GetQPt();
913 if (CAMath::Abs(qpt) > 20) {
917 float w2 = (1.f + mT0.GetDzDs() * mT0.GetDzDs());
918 float pti2 = qpt * qpt;
923 float mass2 = mass * mass;
924 float beta2 = w2 / (w2 + mass2 * pti2);
926 float p2 = w2 / pti2;
927 float betheRho = ApproximateBetheBloch(
p2 / mass2) * mMaterial.rho;
928 float E = CAMath::Sqrt(
p2 + mass2);
929 float theta2 = (14.1f * 14.1f / 1.e6f) / (beta2 *
p2) * mMaterial.radLenInv;
931 mMaterial.EP2 = E /
p2;
935 const float knst = 0.0007f;
936 mMaterial.sigmadE2 = knst * mMaterial.EP2 * qpt;
937 mMaterial.sigmadE2 = mMaterial.sigmadE2 * mMaterial.sigmadE2;
939 mMaterial.k22 = theta2 * w2;
940 mMaterial.k33 = mMaterial.k22 * w2;
942 mMaterial.k44 = theta2 * mT0.GetDzDs() * mT0.GetDzDs() * pti2;
944 float br = (betheRho > 1.e-8f) ? betheRho : 1.e-8f;
945 mMaterial.DLMax = 0.3f * E / br;
946 mMaterial.EP2 *= betheRho;
947 mMaterial.sigmadE2 = mMaterial.sigmadE2 * betheRho;
955 mT0.Pz() = -mT0.Pz();
960 mT->QPt() = -mT->QPt();
961 mT->DzDs() = -mT->DzDs();
963 mAlpha = mAlpha + CAMath::Pi();
964 while (mAlpha >= CAMath::Pi()) {
965 mAlpha -= CAMath::TwoPi();
967 while (mAlpha < -CAMath::Pi()) {
968 mAlpha += CAMath::TwoPi();
970 mCosAlpha = -mCosAlpha;
971 mSinAlpha = -mSinAlpha;
973 float*
c = mT->Cov();
984 mT0.Py() = -mT0.Py();
985 mT0.Pz() = -mT0.Pz();
987 mT->SinPhi() = -mT->SinPhi();
988 mT->DzDs() = -mT->DzDs();
989 mT->QPt() = -mT->QPt();
992 float*
c = mT->Cov();
1005 GetBxByBz(mT0.X(), mT0.Y(), mT0.Z(),
B);
1007 if (CAMath::Abs(Bz) < 1.e-8f) {
1011 float dy = -2.f * mT0.Q() * mT0.Px() / Bz;
1015 float sa = -mT0.CosPhi();
1021 float sa2 = sa * sa;
1022 const float k2 = 1.f / 6.f;
1023 const float k4 = 3.f / 40.f;
1025 dS = chord + chord * sa2 * (k2 + k4 * sa2);
1029 if (mT0.SinPhi() < 0.f) {
1033 mT0.Y() = mT0.Y() + dy;
1034 mT0.Z() = mT0.Z() + mT0.DzDs() * dS;
1035 mT0.Px() = mT0.Px();
1036 mT->Y() = mT->Y() + dy;
1037 mT->Z() = mT->Z() + mT0.DzDs() * dS;
1041 if (1 || !mToyMCEvents) {
1044 float dL = CAMath::Abs(dS * mT0.GetDlDs());
1046 if (inFlyDirection) {
1050 float*
c = mT->Cov();
1051 float& mC40 =
c[10];
1052 float& mC41 =
c[11];
1053 float& mC42 =
c[12];
1054 float& mC43 =
c[13];
1055 float& mC44 =
c[14];
1058 bool maskMS = (CAMath::Abs(dL) < mMaterial.DLMax);
1062 float dLabs = CAMath::Abs(dLmask);
1063 float corr = 1.f - mMaterial.EP2 * dLmask;
1065 float corrInv = 1.f / corr;
1066 mT0.Px() *= corrInv;
1067 mT0.Py() *= corrInv;
1068 mT0.Pz() *= corrInv;
1069 mT0.Pt() *= corrInv;
1079 mC44 = mC44 * corr * corr + dLabs * mMaterial.sigmadE2;
1087 return mMatLUT->getMatBudget(
p1[0],
p1[1],
p1[2],
p2[0],
p2[1],
p2[2]);
1092 float xyz1[3] = {getGlobalX(mT0.GetX(), mT0.GetY()), getGlobalY(mT0.GetX(), mT0.GetY()), mT0.GetZ()};
1093 float xyz2[3] = {getGlobalX(t0e.GetX(), t0e.GetY()), getGlobalY(t0e.GetX(), t0e.GetY()), t0e.GetZ()};
#define GPUCA_DEBUG_STREAMER_CHECK(...)
#define GPUCA_MAX_SIN_PHI
GPUd() void GPUTPCGMPropagator
constexpr int p1()
constexpr to accelerate the coordinates changing
GLboolean GLboolean GLboolean b
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLboolean GLboolean GLboolean GLboolean a
GLuint GLfloat GLfloat y0
float float float float z1
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
float length
length in material
float meanRho
mean density, g/cm^3
float meanX2X0
fraction of radiaton lenght
std::vector< o2::mch::ChannelCode > cc