106GPUdic(2, 1)
void GPUTPCTrackletConstructor::UpdateTracklet(int32_t , int32_t , int32_t , int32_t ,
GPUsharedref() T&
s, GPUTPCThreadMemory&
GPUrestrict()
r,
GPUconstantref()
GPUTPCTracker&
GPUrestrict() tracker,
GPUTPCTrackParam&
GPUrestrict() tParam, int32_t iRow,
calink& rowHit,
calink* rowHits)
111 float y0 =
row.Grid().YMin();
112 float stepY =
row.HstepY();
113 float z0 =
row.Grid().ZMin() - tParam.ZOffset();
114 float stepZ =
row.HstepZ();
121 if ((iRow -
r.mStartRow) & 1) {
129 r.mCurrIH = tracker.HitLinkUpData(
row)[
r.mCurrIH];
132 float y =
y0 + hh.
x * stepY;
133 float z = z0 + hh.
y * stepZ;
135 if (tracker.Param().par.continuousTracking) {
136 tParam.ConstrainZ(
z, tracker.ISector(), z0,
r.mLastZ);
138 tracker.GetConstantMem()->calibObjects.fastTransform->TransformXYZ(tracker.ISector(), iRow,
x,
y,
z);
141 if (tracker.Param().par.continuousTracking) {
142 float refZ = ((
z > 0) ? tracker.Param().rec.tpc.defaultZOffsetOverR : -tracker.Param().rec.tpc.defaultZOffsetOverR) *
x;
144 tracker.GetConstantMem()->calibObjects.fastTransform->TransformXYZ(tracker.ISector(), iRow,
x,
y, zTmp);
146 tParam.SetZOffset(
z - refZ);
152 tParam.SetZOffset(0.f);
157 CADEBUG(printf(
"Tracklet %5d: FIT INIT ROW %3d X %8.3f -",
r.mISH, iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
159 float dx =
x - tParam.X();
161 if (
r.mNHits >= 10) {
171 float ri = 1.f / CAMath::Sqrt(dx * dx + dy * dy);
172 if (iRow == (
int32_t)
r.mStartRow + 2) {
173 tParam.SetSinPhi(dy * ri);
174 tParam.SetSignCosPhi(dx);
175 tParam.SetDzDs(dz * ri);
177 tracker.GetErrors2Seeding(iRow, tParam, -1.f, err2Y, err2Z);
178 tParam.SetCov(0, err2Y);
179 tParam.SetCov(2, err2Z);
181 float sinPhi, cosPhi;
182 if (
r.mNHits >= 10 && CAMath::Abs(tParam.SinPhi()) < constants::MAX_SIN_PHI_LOW) {
183 sinPhi = tParam.SinPhi();
184 cosPhi = CAMath::Sqrt(1 - sinPhi * sinPhi);
189 CADEBUG(printf(
"%14s: FIT TRACK ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
190 if (!tParam.TransportToX(
x, sinPhi, cosPhi, tracker.Param().bzCLight, constants::MAX_SIN_PHI)) {
194 CADEBUG(printf(
"%5s hits %3d: FIT PROP ROW %3d X %8.3f -",
"",
r.mNHits, iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
196 tracker.GetErrors2Seeding(iRow, tParam.GetZ(), sinPhi, tParam.GetDzDs(), -1.f, err2Y, err2Z);
198 if (
r.mNHits >= 10) {
199 const float sErr2 = tracker.Param().GetSystematicClusterErrorIFC2(
x, tParam.GetY(), tParam.GetZ(), tracker.ISector() >= 18);
202 const float kFactor = tracker.Param().rec.tpc.hitPickUpFactor * tracker.Param().rec.tpc.hitPickUpFactor * 3.5f * 3.5f;
203 float sy2 = kFactor * (tParam.Err2Y() + err2Y);
204 float sz2 = kFactor * (tParam.Err2Z() + err2Z);
205 if (sy2 > tracker.Param().rec.tpc.hitSearchArea2) {
206 sy2 = tracker.Param().rec.tpc.hitSearchArea2;
208 if (sz2 > tracker.Param().rec.tpc.hitSearchArea2) {
209 sz2 = tracker.Param().rec.tpc.hitSearchArea2;
213 if (dy * dy > sy2 || dz * dz > sz2) {
214 if (++
r.mNMissed >= tracker.Param().rec.tpc.trackFollowingMaxRowGapSeed) {
222 if (!tParam.Filter(
y,
z, err2Y, err2Z, constants::MAX_SIN_PHI_LOW)) {
226 CADEBUG(printf(
"%14s: FIT FILT ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
229 r.mNHitsEndRow = ++
r.mNHits;
241 r.mLastY = tParam.Y();
242 r.mLastZ = tParam.Z();
243 if (CAMath::Abs(tParam.SinPhi()) > constants::MAX_SIN_PHI) {
249 if (
r.mStage == 2 && iRow > (
int32_t)
r.mEndRow) {
252 if (
r.mNMissed > tracker.Param().rec.tpc.trackFollowingMaxRowGap) {
262 if (!tParam.GetPropagatedYZ(tracker.Param().bzCLight,
x, tmpY, tmpZ)) {
267 if (tracker.Param().par.continuousTracking) {
268 tParam.ConstrainZ(tmpZ, tracker.ISector(), z0,
r.mLastZ);
270 tracker.GetConstantMem()->calibObjects.fastTransform->InverseTransformYZtoX(tracker.ISector(), iRow, tmpY, tmpZ,
x);
273 CADEBUG(printf(
"%14s: SEA TRACK ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
274 if (!tParam.TransportToX(
x, tParam.SinPhi(), tParam.GetCosPhi(), tracker.Param().bzCLight, constants::MAX_SIN_PHI_LOW)) {
279 CADEBUG(printf(
"%14s: SEA PROP ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
281 [[maybe_unused]]
bool found =
false;
282 float yUncorrected = tParam.GetY(), zUncorrected = tParam.GetZ();
284 if (
row.NHits() < 1) {
291 tracker.GetConstantMem()->calibObjects.fastTransform->InverseTransformYZtoNominalYZ(tracker.ISector(), iRow, yUncorrected, zUncorrected, yUncorrected, zUncorrected);
293 if (tracker.Param().rec.tpc.rejectEdgeClustersInSeeding && tracker.Param().rejectEdgeClusterByY(yUncorrected, iRow, CAMath::Sqrt(tParam.Err2Y()))) {
300 tracker.GetErrors2Seeding(iRow, *((
GPUTPCTrackParam*)&tParam), -1.f, err2Y, err2Z);
301 if (
r.mNHits >= 10) {
302 const float sErr2 = tracker.Param().GetSystematicClusterErrorIFC2(
x, tParam.GetY(), tParam.GetZ(), tracker.ISector() >= 18);
306 if (CAMath::Abs(yUncorrected) <
x * GPUTPCRow::getTPCMaxY1X()) {
307 const float kFactor = tracker.Param().rec.tpc.hitPickUpFactor * tracker.Param().rec.tpc.hitPickUpFactor * 7.0f * 7.0f;
308 const float maxWindow2 = tracker.Param().rec.tpc.hitSearchArea2;
309 const float sy2 = CAMath::Min(maxWindow2, kFactor * (tParam.Err2Y() + err2Y));
310 const float sz2 = CAMath::Min(maxWindow2, kFactor * (tParam.Err2Z() + err2Z));
313 row.Grid().GetBinArea(yUncorrected, zUncorrected + tParam.ZOffset(), CAMath::Sqrt(sy2), CAMath::Sqrt(sz2), bin, ny, nz);
317 for (
int32_t k = -1; ++k <= nz; ) {
319 for (
int32_t k = 0; k <= nz; k++) {
322 int32_t mybin = bin + k * nBinsY;
324 uint32_t hitLst = firsthit[mybin + ny + 1];
326 for (
uint32_t ih = hitFst - 1; ++ih < hitLst; ) {
328 for (
uint32_t ih = hitFst; ih < hitLst; ih++) {
331 float y =
y0 + hh.
x * stepY;
332 float z = z0 + hh.
y * stepZ;
333 float dy =
y - yUncorrected;
334 float dz =
z - zUncorrected;
335 if (dy * dy < sy2 && dz * dz < sz2) {
336 float dds = tracker.Param().rec.tpc.trackFollowingYFactor * CAMath::Abs(dy) + CAMath::Abs(dz);
347 if (
r.mNHits == 0 &&
r.mStage < 3) {
359 float y =
y0 + hh.
x * stepY + tParam.GetY() - yUncorrected;
360 float z = z0 + hh.
y * stepZ + tParam.GetZ() - zUncorrected;
362 CADEBUG(printf(
"%14s: SEA Hit %5d (%8.3f %8.3f), Res %f %f\n",
"", best,
y,
z, tParam.Y() -
y, tParam.Z() -
z));
365 if (oldHit != best && !tParam.Filter(
y,
z, err2Y, err2Z, constants::MAX_SIN_PHI_LOW, oldHit !=
CALINK_INVAL) &&
r.mNHits != 0) {
373 CADEBUG(printf(
"%5s hits %3d: SEA FILT ROW %3d X %8.3f -",
"",
r.mNHits, iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
380 if (!found && tracker.GetConstantMem()->calibObjects.dEdxCalibContainer) {
381 uint32_t pad = CAMath::Float2UIntRn(GPUTPCGeometry::LinearY2Pad(tracker.ISector(), iRow, yUncorrected));
382 if (pad < GPUTPCGeometry::NPads(iRow) && tracker.GetConstantMem()->calibObjects.dEdxCalibContainer->isDead(tracker.ISector(), iRow, pad)) {
394 const cahit2 hh1 = hits1[rowHits[
r.mFirstRow]];
395 const cahit2 hh2 = hits2[rowHits[
r.mLastRow]];
396 const float z1 = row1.Grid().ZMin() + hh1.
y * row1.HstepZ();
397 const float z2 = row2.Grid().ZMin() + hh2.
y * row2.HstepZ();
398 float oldOffset = tParam.ZOffset();
399 tParam.ShiftZ(z1, z2, GPUTPCGeometry::Row2X(
r.mFirstRow), GPUTPCGeometry::Row2X(
r.mLastRow), tracker.Param().bzCLight, tracker.Param().rec.tpc.defaultZOffsetOverR);
400 r.mLastZ -= tParam.ZOffset() - oldOffset;
401 CADEBUG(printf(
"Shifted z from %f to %f\n", oldOffset, tParam.ZOffset()));
407 int32_t iRow = 0, iRowEnd = GPUTPCGeometry::NROWS;
409 calink rowHits[GPUTPCGeometry::NROWS];
413 r.mStartRow =
r.mEndRow =
r.mFirstRow =
r.mLastRow =
id.RowIndex();
414 r.mCurrIH =
id.HitIndex();
417 GPUTPCTrackletConstructor::InitTracklet(tParam);
421 CADEBUG(printf(
"Start tracklet\n"));
424 for (
int32_t iStage = -1; ++iStage < 2; ) {
426 for (
int32_t iStage = 0; iStage < 2; iStage++) {
428 for (; iRow != iRowEnd; iRow +=
r.mStage == 2 ? -1 : 1) {
432 UpdateTracklet(0, 0, 0, 0,
s,
r, tracker, tParam, iRow, rowHits[iRow], rowHits);
434 if (!
r.mGo &&
r.mStage == 2) {
435 for (; iRow >= (
int32_t)
r.mStartRow; iRow--) {
440 StoreTracklet(0, 0, 0, 0,
s,
r, tracker, tParam, rowHits);
446 float x = tracker.Row(
r.mEndRow).X();
449 if (tParam.GetPropagatedYZ(tracker.Param().bzCLight,
x, tmpY, tmpZ)) {
450 if (tracker.ISector() < GPUTPCGeometry::NSECTORS / 2 ? (tmpZ < 0) : (tmpZ > 0)) {
452 }
else if (tracker.ISector() < GPUTPCGeometry::NSECTORS / 2 ? (tmpZ > GPUTPCGeometry::TPCLength()) : (tmpZ < -GPUTPCGeometry::TPCLength())) {
453 tmpZ = tracker.ISector() < GPUTPCGeometry::NSECTORS / 2 ? GPUTPCGeometry::TPCLength() : -GPUTPCGeometry::TPCLength();
455 tracker.GetConstantMem()->calibObjects.fastTransform->InverseTransformYZtoX(tracker.ISector(), iRow, tmpY, tmpZ,
x);
461 if ((
r.mGo = (tParam.TransportToX(
x, tracker.Param().bzCLight, constants::MAX_SIN_PHI) && tParam.Filter(
r.mLastY,
r.mLastZ, tParam.Err2Y() * 0.5f, tParam.Err2Z() * 0.5f, constants::MAX_SIN_PHI_LOW,
true)))) {
462 CADEBUG(printf(
"%14s: SEA BACK ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
464 tracker.GetErrors2Seeding(
r.mEndRow, tParam, -1.f, err2Y, err2Z);
465 if (tParam.GetCov(0) < err2Y) {
466 tParam.SetCov(0, err2Y);
468 if (tParam.GetCov(2) < err2Z) {
469 tParam.SetCov(2, err2Z);
471 CADEBUG(printf(
"%14s: SEA ADJUS ROW %3d X %8.3f -",
"", iRow, tParam.X());
for (
int32_t i = 0;
i < 5;
i++) { printf(
" %8.3f", tParam.Par()[
i]); } printf(
" -");
for (
int32_t i = 0;
i < 15;
i++) { printf(
" %8.3f", tParam.Cov()[
i]); } printf(
"\n"));
472 r.mNHits -=
r.mNHitsEndRow;
476 CADEBUG(printf(
"End tracklet\n"));
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