17#include "GPUParam.inc"
25#ifdef GPUCA_COMPRESSION_TRACK_MODEL_MERGER
28 mProp.SetMaterialTPC();
29 mProp.SetMaxSinPhi(constants::MAX_SIN_PHI);
30 mProp.SetSeedingErrors(
true);
31 mProp.SetFitInProjections(
true);
32 mProp.SetPropagateBzOnly(
true);
33 mProp.SetPolynomialField(&
param.polynomialField);
39 mTrk.QPt() = (qPt - 127.f) * (20.f / 127.f);
40 mTrk.ResetCovariance();
41 mProp.SetTrack(&mTrk,
alpha);
55 mTrk.ConstrainSinPhi();
56 int32_t retVal = mProp.Update(
y,
z, iRow, *mParam, 0, 0,
nullptr,
false,
false, 0.f);
68#elif defined(GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER)
81 mTrk.SetQPt((qPt - 127.f) * (20.f / 127.f));
90 if (
alpha != mAlpha && !mTrk.Rotate(
alpha,
t0, constants::MAX_SIN_PHI)) {
93 int32_t retVal = !mTrk.TransportToX(
x,
t0, mParam->bzCLight, constants::MAX_SIN_PHI);
100 mTrk.ConstrainSinPhi();
102 GPUTPCTracker::GetErrors2Seeding(*mParam, iRow, mTrk, -1.f, err2Y, err2Z);
103 int32_t retVal = !mTrk.Filter(
y,
z, err2Y, err2Z, constants::MAX_SIN_PHI,
false);
120 CAMath::SinCos(
alpha, mSinAlpha, mCosAlpha);
125 mP[4] = (qPt - 127.f) * (20.f / 127.f);
128 mBz =
param.bzCLight;
129 float pti = CAMath::Abs(mP[4]);
136 mTrk.q = (mP[4] >= 0) ? 1.f : -1.f;
142 mTrk.qpt = mTrk.q * pti;
143 calculateMaterialCorrection();
149 if (mP[2] > MaxSinPhi) {
151 }
else if (mP[2] < -MaxSinPhi) {
155 if (CAMath::Abs(
alpha - mAlpha) > 1.e-4f) {
156 if (rotateToAlpha(
alpha) != 0) {
160 if (CAMath::Abs(
x - mX) < 1.e-7f) {
166 PhysicalTrackModel t0e(mTrk);
168 if (CAMath::Abs(
x - t0e.x) < 1.e-8f) {
171 if (propagateToXBzLightNoUpdate(t0e,
x, mBz, dLp)) {
174 updatePhysicalTrackValues(t0e);
175 if (CAMath::Abs(t0e.sinphi) >= MaxSinPhi) {
178 return followLinearization(t0e, mBz, dLp);
185 getClusterErrors2(iRow,
z, mTrk.sinphi, mTrk.dzds, err2Y, err2Z);
198 if (mP[2] > MaxSinPhi) {
200 }
else if (mP[2] < -MaxSinPhi) {
204 const float d00 = mC[0], d01 = mC[1], d02 = mC[3], d03 = mC[6], d04 = mC[10];
205 const float d10 = mC[1], d11 = mC[2], d12 = mC[4], d13 = mC[7], d14 = mC[11];
207 const float z0 =
y - mP[0];
208 const float z1 =
z - mP[1];
211 w0 = 1.f / (err2Y + d00);
213 w2 = 1.f / (err2Z + d11);
215 w0 = d11 + err2Z, w1 = d10, w2 = d00 + err2Y;
217 float det = w0 * w2 - w1 * w1;
218 if (CAMath::Abs(det) < 1.e-10f) {
230 const float k00 = d00 * w0;
231 const float k20 = d02 * w0;
232 const float k40 = d04 * w0;
233 const float k11 = d11 * w2;
234 const float k31 = d13 * w2;
251 const float k00 = d00 * w0 + d01 * w1;
252 const float k01 = d00 * w1 + d10 * w2;
253 const float k10 = d01 * w0 + d11 * w1;
254 const float k11 = d01 * w1 + d11 * w2;
255 const float k20 = d02 * w0 + d12 * w1;
256 const float k21 = d02 * w1 + d12 * w2;
257 const float k30 = d03 * w0 + d13 * w1;
258 const float k31 = d03 * w1 + d13 * w2;
259 const float k40 = d04 * w0 + d14 * w1;
260 const float k41 = d04 * w1 + d14 * w2;
262 mP[0] += k00 * z0 + k01 *
z1;
263 mP[1] += k10 * z0 + k11 *
z1;
264 mP[2] += k20 * z0 + k21 *
z1;
265 mP[3] += k30 * z0 + k31 *
z1;
266 mP[4] += k40 * z0 + k41 *
z1;
268 mC[0] -= k00 * d00 + k01 * d10;
270 mC[2] -= k10 * d01 + k11 * d11;
272 mC[3] -= k20 * d00 + k21 * d10;
273 mC[5] -= k20 * d02 + k21 * d12;
275 mC[7] -= k30 * d01 + k31 * d11;
276 mC[9] -= k30 * d03 + k31 * d13;
278 mC[10] -= k40 * d00 + k41 * d10;
279 mC[12] -= k40 * d02 + k41 * d12;
280 mC[14] -= k40 * d04 + k41 * d14;
282 mC[1] -= k10 * d00 + k11 * d10;
283 mC[4] -= k20 * d01 + k21 * d11;
284 mC[6] -= k30 * d00 + k31 * d10;
285 mC[8] -= k30 * d02 + k31 * d12;
286 mC[11] -= k40 * d01 + k41 * d11;
287 mC[13] -= k40 * d03 + k41 * d13;
294 float dy = -2.f * mTrk.q * mTrk.px / mBz;
298 float sa = -mTrk.cosphi;
305 const float k2 = 1.f / 6.f;
306 const float k4 = 3.f / 40.f;
308 dS = chord + chord * sa2 * (
k2 + k4 * sa2);
312 if (mTrk.sinphi < 0.f) {
316 mTrk.y = mTrk.y + 2.f * dy;
317 mTrk.z = mTrk.z + 2.f * mTrk.dzds * dS;
322 float dL = CAMath::Copysign(dS * mTrk.dlds, -1.f);
324 float& mC40 = mC[10];
325 float& mC41 = mC[11];
326 float& mC42 = mC[12];
327 float& mC43 = mC[13];
328 float& mC44 = mC[14];
331 bool maskMS = (CAMath::Abs(dL) < mMaterial.DLMax);
335 float dLabs = CAMath::Abs(dLmask);
336 float corr = 1.f - mMaterial.EP2 * dLmask;
338 float corrInv = 1.f / corr;
352 mC44 = mC44 * corr * corr + dLabs * mMaterial.sigmadE2;
360 if (CAMath::Abs(px) < 1.e-4f) {
361 px = CAMath::Copysign(1.e-4f, px);
364 trk.pt = CAMath::Sqrt(px * px + trk.py * trk.py);
365 float pti = 1.f / trk.pt;
366 trk.p = CAMath::Sqrt(px * px + trk.py * trk.py + trk.pz * trk.pz);
367 trk.sinphi = trk.py * pti;
368 trk.cosphi = px * pti;
369 trk.secphi = trk.pt / px;
370 trk.dzds = trk.pz * pti;
371 trk.dlds = trk.p * pti;
372 trk.qpt = trk.q * pti;
380 mTrk.sinphi = -mTrk.sinphi;
381 mTrk.dzds = -mTrk.dzds;
382 mTrk.qpt = -mTrk.qpt;
383 updatePhysicalTrackValues(mTrk);
400 float newCosAlpha = 0, newSinAlpha = 0;
401 CAMath::SinCos(newAlpha, newSinAlpha, newCosAlpha);
403 float cc = newCosAlpha * mCosAlpha + newSinAlpha * mSinAlpha;
404 float ss = newSinAlpha * mCosAlpha - newCosAlpha * mSinAlpha;
406 PhysicalTrackModel
t0 = mTrk;
413 if (CAMath::Abs(mP[2]) >= MaxSinPhi || CAMath::Abs(px0) < (1 - MaxSinPhi)) {
418 float px1 = px0 *
cc + py0 * ss;
419 float py1 = -px0 * ss + py0 *
cc;
426 updatePhysicalTrackValues(
t0);
429 if (CAMath::Abs(py1) > MaxSinPhi * mTrk.pt || CAMath::Abs(px1) < (1 - MaxSinPhi)) {
434 float trackX =
x0 *
cc + ss * mP[0];
438 if (propagateToXBzLightNoUpdate(
t0, trackX, mBz, dLp)) {
441 updatePhysicalTrackValues(
t0);
443 if (CAMath::Abs(
t0.sinphi) >= MaxSinPhi) {
460 float j1 = px1 / px0;
466 mP[0] = -
x0 * ss +
cc * mP[0];
468 mP[2] = -CAMath::Sqrt(1.f - mP[2] * mP[2]) * ss + mP[2] *
cc;
473 float c15 =
c[0] * j0 * j2;
474 float c16 =
c[1] * j2;
475 float c17 =
c[3] * j1 * j2;
476 float c18 =
c[6] * j2;
477 float c19 =
c[10] * j2;
478 float c20 =
c[0] * j2 * j2;
488 if (setDirectionAlongX(
t0)) {
505 float j3 = -
t0.py /
t0.px;
506 float j4 = -
t0.pz /
t0.px;
507 float j5 =
t0.qpt * mBz;
516 float h15 = c15 + c20 * j3;
517 float h16 = c16 + c20 * j4;
518 float h17 = c17 + c20 * j5;
520 c[0] += j3 * (c15 + h15);
522 c[2] += j4 * (c16 + h16);
524 c[3] += c17 * j3 + h15 * j5;
525 c[5] += j5 * (c17 + h17);
535 mCosAlpha = newCosAlpha;
536 mSinAlpha = newSinAlpha;
552 float pt2 =
t.px *
t.px +
t.py *
t.py;
554 float pye =
t.py - dx *
b;
555 float pxe2 = pt2 - pye * pye;
557 if (
t.px < (1.f - MaxSinPhi) || pxe2 < (1.f - MaxSinPhi) * (1.f - MaxSinPhi)) {
560 float pxe = CAMath::Sqrt(pxe2);
561 float pti = 1.f / CAMath::Sqrt(pt2);
563 float ty = (
t.py + pye) / (
t.px + pxe);
567 float chord = dx * CAMath::Sqrt(1.f + ty * ty);
568 float sa = 0.5f * chord *
b * pti;
575 const float k2 = 1.f / 6.f;
576 const float k4 = 3.f / 40.f;
578 dS = chord + chord * sa2 * (
k2 + k4 * sa2);
584 float dz =
t.pz * dLp;
608 updatePhysicalTrackValues(
t);
618 float dS = dLp * t0e.pt;
619 float dL = CAMath::Abs(dLp * t0e.p);
623 float ey = mTrk.sinphi;
624 float ex = mTrk.cosphi;
625 float exi = mTrk.secphi;
626 float ey1 = t0e.sinphi;
627 float ex1 = t0e.cosphi;
628 float ex1i = t0e.secphi;
630 float k = -mTrk.qpt * Bz;
631 float dx = t0e.x - mTrk.x;
634 float cci = 1.f /
cc;
636 float dxcci = dx * cci;
637 float hh = dxcci * ex1i * (1.f + ex * ex1 + ey * ey1);
639 float j02 = exi * hh;
640 float j04 = -Bz * dxcci * hh;
642 float j24 = -dx * Bz;
646 float d0 =
p[0] - mTrk.y;
647 float d1 =
p[1] - mTrk.z;
648 float d2 =
p[2] - mTrk.sinphi;
649 float d3 =
p[3] - mTrk.dzds;
650 float d4 =
p[4] - mTrk.qpt;
652 float newSinPhi = ey1 +
d2 + j24 * d4;
653 if (mNDF >= 15 && CAMath::Abs(newSinPhi) > MaxSinPhi) {
659 p[0] = t0e.y + d0 + j02 *
d2 + j04 * d4;
660 p[1] = t0e.z +
d1 + j13 *
d3;
662 p[3] = t0e.dzds +
d3;
683 float c20ph04c42 = c20 + j04 * c42;
684 float j02c22 = j02 * c22;
685 float j04c44 = j04 * c44;
687 float n6 = c30 + j02 * c32 + j04 * c43;
688 float n7 = c31 + j13 * c33;
689 float n10 = c40 + j02 * c42 + j04c44;
690 float n11 = c41 + j13 * c43;
691 float n12 = c42 + j24 * c44;
693 c[0] += j02 * j02c22 + j04 * j04c44 + 2.f * (j02 * c20ph04c42 + j04 * c40);
694 c[1] += j02 * c21 + j04 * c41 + j13 * n6;
695 c[2] += j13 * (c31 + n7);
696 c[3] = c20ph04c42 + j02c22 + j24 * n10;
697 c[4] = c21 + j13 * c32 + j24 * n11;
698 c[5] = c22 + j24 * (c42 + n12);
701 c[8] = c32 + c43 * j24;
712 float xx = 1.f - 0.25f * kdx * kdx * (1.f + tg * tg);
716 xx = CAMath::Sqrt(xx);
717 float yy = CAMath::Sqrt(ss * ss +
cc *
cc);
719 float j12 = dx * mTrk.dzds * tg * (2.f + tg * (ey * exi + ey1 * ex1i)) / (xx * yy);
721 if (CAMath::Abs(mTrk.qpt) > 1.e-6f) {
722 j14 = (2.f * xx * ex1i * dx / yy - dS) * mTrk.dzds / mTrk.qpt;
724 j14 = -mTrk.dzds * Bz * dx * dx * exi * exi * exi * (0.5f * ey + (1.f / 3.f) * kdx * (1 + 2.f * ey * ey) * exi * exi);
727 p[1] += j12 *
d2 + j14 * d4;
729 float h00 = c00 + c20 * j02 + c40 * j04;
731 float h02 = c20 + c22 * j02 + c42 * j04;
733 float h04 = c40 + c42 * j02 + c44 * j04;
735 float h10 = c10 + c20 * j12 + c30 * j13 + c40 * j14;
736 float h11 = c11 + c21 * j12 + c31 * j13 + c41 * j14;
737 float h12 = c21 + c22 * j12 + c32 * j13 + c42 * j14;
738 float h13 = c31 + c32 * j12 + c33 * j13 + c43 * j14;
739 float h14 = c41 + c42 * j12 + c43 * j13 + c44 * j14;
741 float h20 = c20 + c40 * j24;
742 float h21 = c21 + c41 * j24;
743 float h22 = c22 + c42 * j24;
744 float h23 = c32 + c43 * j24;
745 float h24 = c42 + c44 * j24;
747 c[0] = h00 + h02 * j02 + h04 * j04;
749 c[1] = h10 + h12 * j02 + h14 * j04;
750 c[2] = h11 + h12 * j12 + h13 * j13 + h14 * j14;
752 c[3] = h20 + h22 * j02 + h24 * j04;
753 c[4] = h21 + h22 * j12 + h23 * j13 + h24 * j14;
754 c[5] = h22 + h24 * j24;
756 c[6] = c30 + c32 * j02 + c43 * j04;
757 c[7] = c31 + c32 * j12 + c33 * j13 + c43 * j14;
758 c[8] = c32 + c43 * j24;
761 c[10] = c40 + c42 * j02 + c44 * j04;
762 c[11] = c41 + c42 * j12 + c43 * j13 + c44 * j14;
763 c[12] = c42 + c44 * j24;
777 bool maskMS = (CAMath::Abs(dL) < mMaterial.DLMax);
781 float dLabs = CAMath::Abs(dLmask);
786 float corr = 1.f - mMaterial.EP2 * dLmask;
787 float corrInv = 1.f / corr;
801 mC44 = mC44 * corr * corr + dLabs * mMaterial.sigmadE2;
806 mC22 += dLabs * mMaterial.k22 * mTrk.cosphi * mTrk.cosphi;
807 mC33 += dLabs * mMaterial.k33;
808 mC43 += dLabs * mMaterial.k43;
809 mC44 += dLabs * mMaterial.k44;
817 const float mass = 0.13957f;
819 float qpt = mTrk.qpt;
820 if (CAMath::Abs(qpt) > 20) {
824 float w2 = (1.f + mTrk.dzds * mTrk.dzds);
825 float pti2 = qpt * qpt;
830 float mass2 = mass * mass;
831 float beta2 = w2 / (w2 + mass2 * pti2);
833 float p2 = w2 / pti2;
834 float betheRho = approximateBetheBloch(
p2 / mass2) * mMaterial.rho;
835 float E = CAMath::Sqrt(
p2 + mass2);
836 float theta2 = (14.1f * 14.1f / 1.e6f) / (beta2 *
p2) * mMaterial.radLenInv;
838 mMaterial.EP2 = E /
p2;
842 const float knst = 0.07f;
843 mMaterial.sigmadE2 = knst * mMaterial.EP2 * qpt;
844 mMaterial.sigmadE2 = mMaterial.sigmadE2 * mMaterial.sigmadE2;
846 mMaterial.k22 = theta2 * w2;
847 mMaterial.k33 = mMaterial.k22 * w2;
849 mMaterial.k44 = theta2 * mTrk.dzds * mTrk.dzds * pti2;
851 float br = (betheRho > 1.e-8f) ? betheRho : 1.e-8f;
852 mMaterial.DLMax = 0.3f * E / br;
853 mMaterial.EP2 *= betheRho;
854 mMaterial.sigmadE2 = mMaterial.sigmadE2 * betheRho;
865 const float log0 = CAMath::Log(5940.f);
866 const float log1 = CAMath::Log(3.5f * 5940.f);
868 bool bad = (
beta2 >= .999f) || (beta2 < 1.e-8f);
875 float b = 0.5f * CAMath::Log(
a);
876 float d = 0.153e-3f /
beta2;
879 float ret =
d * (log0 +
b +
c);
880 float case1 =
d * (log1 +
c);
882 if (
a > 3.5f * 3.5f) {
891 int32_t rowType = iRow < 97 ? (iRow < 63 ? 0 : 1) : (iRow < 127 ? 2 : 3);
895 constexpr float tpcLength = 250.f - 0.275f;
896 z = CAMath::Abs(tpcLength - CAMath::Abs(
z));
897 float s2 = sinPhi * sinPhi;
898 if (s2 > 0.95f * 0.95f) {
901 float sec2 = 1.f / (1.f - s2);
902 float angleY2 = s2 * sec2;
903 float angleZ2 = DzDs * DzDs * sec2;
905 const float* cY = mParamErrors0[0][rowType];
906 ErrY2 = cY[0] + cY[1] *
z + cY[2] * angleY2;
909 const float* cZ = mParamErrors0[1][rowType];
910 ErrZ2 = cZ[0] + cZ[1] *
z + cZ[2] * angleZ2;
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
GPUd() void GPUTPCCompressionTrackModel
GLfloat GLfloat GLfloat alpha
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
GLdouble GLdouble GLdouble z
float float float float z1
std::vector< o2::mch::ChannelCode > cc