Skip to content

Commit 36ccd00

Browse files
committed
Revert "GPU TPC: Dynamically increase the protection / decrease the removal tube at inner pad rows, edge pads, high local occupancy"
This reverts commit a47f8ed.
1 parent c0f7dc1 commit 36ccd00

File tree

5 files changed

+21
-39
lines changed

5 files changed

+21
-39
lines changed

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ void* GPUReconstruction::AllocateDirectMemory(size_t size, int32_t type)
744744
void*& poolend = (type & GPUMemoryResource::MEMORY_GPU) ? mDeviceMemoryPoolEnd : mHostMemoryPoolEnd;
745745
char* retVal;
746746
if ((type & GPUMemoryResource::MEMORY_STACK)) {
747-
poolend = (char*)poolend - size; // TODO: Implement overflow check
747+
poolend = (char*)poolend - size;
748748
poolend = (char*)poolend - GPUProcessor::getAlignmentMod<GPUCA_MEMALIGN>(poolend);
749749
retVal = (char*)poolend;
750750
} else {

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ AddOptionRTC(minNClustersFinalTrack, int32_t, -1, "", 0, "required min number of
6868
AddOptionRTC(searchWindowDZDR, float, 2.5f, "", 0, "Use DZDR window for seeding instead of neighboursSearchArea")
6969
AddOptionRTC(trackReferenceX, float, 1000.f, "", 0, "Transport all tracks to this X after tracking (disabled if > 500, auto = 1000)")
7070
AddOptionRTC(zsThreshold, float, 2.0f, "", 0, "Zero-Suppression threshold")
71-
AddOptionRTC(tubeProtectSigma2, float, 4.f * 4.f, "", 0, "Max sigma2 to mark adjacent cluster for protection")
72-
AddOptionRTC(tubeProtectMaxSize2, float, 2.f * 2.f, "", 0, "Square of max tube size (if smaller than tubeProtectChi2)")
73-
AddOptionRTC(tubeProtectMinSize2, float, 0.5f * 0.5f, "", 0, "Square of min tube size (if larger than tubeProtectChi2)")
74-
AddOptionRTC(tubeRemoveSigma2, float, 1.25f * 1.25f, "", 0, "Max sigma2 to mark adjacent cluster for removal")
75-
AddOptionRTC(tubeRemoveMaxSize2, float, 2.5f * 2.5f, "", 0, "Square of max tube size (if smaller than tubeRejectChi2)")
76-
AddOptionRTC(tubeExtraProtectMinOccupancy, uint32_t, 1500, "", 0, "Increase Protection, decrease removal by factor 2, when above this lokal occupancy / rowx")
71+
AddOptionRTC(tubeProtectSigma2, float, 5.f * 5.f, "", 0, "Max sigma2 to mark adjacent cluster for protection")
72+
AddOptionRTC(tubeProtectMaxSize2, float, 3.5f * 3.5f, "", 0, "Square of max tube size (if smaller than tubeProtectChi2)")
73+
AddOptionRTC(tubeProtectMinSize2, float, 1.0f * 1.0f, "", 0, "Square of min tube size (if larger than tubeProtectChi2)")
74+
AddOptionRTC(tubeRemoveSigma2, float, 1.f * 1.f, "", 0, "Max sigma2 to mark adjacent cluster for removal")
75+
AddOptionRTC(tubeRemoveMaxSize2, float, 1.5f * 1.5f, "", 0, "Square of max tube size (if smaller than tubeRejectChi2)")
7776
AddOptionRTC(clustersShiftTimebins, float, 0, "", 0, "Shift of TPC clusters (applied during CTF cluster decoding)")
7877
AddOptionRTC(clustersShiftTimebinsClusterizer, float, 0, "", 0, "Shift of TPC clusters (applied during CTF clusterization)")
7978
AddOptionRTC(clustersEdgeFixDistance, float, 0.f, "", 0, "If >0, revert cluster.flag edge bit distance to edge exceeds this parameter (fixed during CTF decoding)")
@@ -163,9 +162,6 @@ AddOptionRTC(dEdxClusterRejectionFlagMask, int8_t, o2::gpu::GPUTPCGMMergedTrackH
163162
AddOptionRTC(dEdxClusterRejectionFlagMaskAlt, int8_t, o2::gpu::GPUTPCGMMergedTrackHit::flagEdge, "", 0, "OR mask of TPC flags that will reject the cluster in alternative dEdx")
164163
AddOptionRTC(rejectEdgeClustersInSeeding, int8_t, 0, "", 0, "Reject edge clusters based on uncorrected track Y during seeding")
165164
AddOptionRTC(rejectEdgeClustersInTrackFit, int8_t, 0, "", 0, "Reject edge clusters based on uncorrected track Y during track fit")
166-
AddOptionRTC(tubeExtraProtectMinRow, uint8_t, 20, "", 0, "Increase Protection, decrease removal by factor 2, when below this row")
167-
AddOptionRTC(tubeExtraProtectEdgePads, uint8_t, 2, "", 0, "Increase Protection, decrease removal by factor 2, when on this number of pads from the edge")
168-
169165
AddOptionArray(PID_remap, int8_t, 9, (0, 1, 2, 3, 4, 5, 6, 7, 8), "", 0, "Remap Ipid to PID_reamp[Ipid] (no remap if<0)") // BUG: CUDA cannot yet hand AddOptionArrayRTC
170166
AddHelp("help", 'h')
171167
EndConfig()

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
241241
const float invCharge = merger->GetConstantMem()->ioPtrs.clustersNative ? (1.f / merger->GetConstantMem()->ioPtrs.clustersNative->clustersLinear[cluster.num].qMax) : 0.f;
242242
float invAvgCharge = (sumInvSqrtCharge += invSqrtCharge) / ++nAvgCharge;
243243
invAvgCharge *= invAvgCharge;
244+
244245
prop.GetErr2(err2Y, err2Z, param, zz, cluster.row, clusterState, cluster.sector, time, invAvgCharge, invCharge);
245246

246247
int retValInt = 0;
@@ -484,8 +485,7 @@ GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestric
484485

485486
GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool goodLeg, float Y, float Z)
486487
{
487-
const auto& param = Merger->Param();
488-
if (param.rec.tpc.disableRefitAttachment & 1) {
488+
if (Merger->Param().rec.tpc.disableRefitAttachment & 1) {
489489
return -1e6f;
490490
}
491491
const GPUTPCTracker& GPUrestrict() tracker = *(Merger->GetConstantMem()->tpcTrackers + sector);
@@ -496,40 +496,34 @@ GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestric
496496
return -1e6f;
497497
}
498498

499-
const float zOffset = param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, mTOffset, param.continuousMaxTimeBin) : 0; // TODO: do some validatiomns for the transform conv functions...
499+
const float zOffset = Merger->Param().par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, mTOffset, Merger->Param().continuousMaxTimeBin) : 0;
500500
const float y0 = row.Grid().YMin();
501501
const float stepY = row.HstepY();
502502
const float z0 = row.Grid().ZMin() - zOffset; // We can use our own ZOffset, since this is only used temporarily anyway
503503
const float stepZ = row.HstepZ();
504504
int32_t bin, ny, nz;
505505

506-
float uncorrectedY, uncorrectedZ;
507-
Merger->GetConstantMem()->calibObjects.fastTransformHelper->InverseTransformYZtoNominalYZ(sector, iRow, Y, Z, uncorrectedY, uncorrectedZ);
508-
if (CAMath::Abs(uncorrectedY) > row.getTPCMaxY()) {
509-
return uncorrectedY;
510-
}
506+
bool protect = CAMath::Abs(GetQPt() * Merger->Param().qptB5Scaler) <= Merger->Param().rec.tpc.rejectQPtB5 && goodLeg;
511507

512-
bool protect = CAMath::Abs(GetQPt() * param.qptB5Scaler) <= param.rec.tpc.rejectQPtB5 && goodLeg;
513508
float err2Y, err2Z;
514-
param.GetClusterErrors2(sector, iRow, Z, mP[2], mP[3], -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time/avgCharge
515-
const float tubeMaxSize2 = protect ? param.rec.tpc.tubeProtectMaxSize2 : param.rec.tpc.tubeRemoveMaxSize2;
516-
const float tubeMinSize2 = protect ? param.rec.tpc.tubeProtectMinSize2 : 0.f;
517-
float tubeSigma2 = protect ? param.rec.tpc.tubeProtectSigma2 : param.rec.tpc.tubeRemoveSigma2;
518-
uint32_t pad = CAMath::Float2UIntRn(GPUTPCGeometry::LinearY2Pad(sector, iRow, uncorrectedY));
519-
float time = Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->InverseTransformInTimeFrame(sector, uncorrectedZ + (param.par.continuousTracking ? Merger->GetConstantMem()->calibObjects.fastTransformHelper->getCorrMap()->convVertexTimeToZOffset(sector, mTOffset, param.continuousMaxTimeBin) : 0), param.continuousMaxTimeBin); // TODO: Simplify this call in TPCFastTransform
520-
if (iRow < param.rec.tpc.tubeExtraProtectMinRow ||
521-
pad < param.rec.tpc.tubeExtraProtectEdgePads || pad >= (uint32_t)(GPUTPCGeometry::NPads(iRow) - param.rec.tpc.tubeExtraProtectEdgePads) ||
522-
param.GetUnscaledMult(time) / GPUTPCGeometry::Row2X(iRow) > param.rec.tpc.tubeExtraProtectMinOccupancy) {
523-
tubeSigma2 *= protect ? 2 : 0.5;
524-
}
509+
Merger->Param().GetClusterErrors2(sector, iRow, Z, mP[2], mP[3], -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time/avgCharge
510+
const float tubeMaxSize2 = protect ? Merger->Param().rec.tpc.tubeProtectMaxSize2 : Merger->Param().rec.tpc.tubeRemoveMaxSize2;
511+
const float tubeMinSize2 = protect ? Merger->Param().rec.tpc.tubeProtectMinSize2 : 0.f;
512+
const float tubeSigma2 = protect ? Merger->Param().rec.tpc.tubeProtectSigma2 : Merger->Param().rec.tpc.tubeRemoveSigma2;
525513
const float sy2 = CAMath::Max(tubeMinSize2, CAMath::Min(tubeMaxSize2, tubeSigma2 * (err2Y + CAMath::Abs(mC[0])))); // Cov can be bogus when following circle
526514
const float sz2 = CAMath::Max(tubeMinSize2, CAMath::Min(tubeMaxSize2, tubeSigma2 * (err2Z + CAMath::Abs(mC[2])))); // In that case we should provide the track error externally
527515
const float tubeY = CAMath::Sqrt(sy2);
528516
const float tubeZ = CAMath::Sqrt(sz2);
529517
const float sy21 = 1.f / sy2;
530518
const float sz21 = 1.f / sz2;
519+
float uncorrectedY, uncorrectedZ;
520+
Merger->GetConstantMem()->calibObjects.fastTransformHelper->InverseTransformYZtoNominalYZ(sector, iRow, Y, Z, uncorrectedY, uncorrectedZ);
531521

522+
if (CAMath::Abs(uncorrectedY) > row.getTPCMaxY()) {
523+
return uncorrectedY;
524+
}
532525
row.Grid().GetBinArea(uncorrectedY, uncorrectedZ + zOffset, tubeY, tubeZ, bin, ny, nz);
526+
533527
const int32_t nBinsY = row.Grid().Ny();
534528
const int32_t idOffset = tracker.Data().ClusterIdOffset();
535529
const int32_t* ids = &(tracker.Data().ClusterDataIndex()[row.HitNumberOffset()]);

GPU/GPUTracking/TPCConvert/GPUTPCConvertImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GPUTPCConvertImpl
2828
public:
2929
GPUd() static void convert(const GPUConstantMem& GPUrestrict() cm, int32_t sector, int32_t row, float pad, float time, float& GPUrestrict() x, float& GPUrestrict() y, float& GPUrestrict() z)
3030
{
31-
if (cm.param.par.continuousTracking) { // TODO: This might be wrong, don't we just need to do TransformInTimeframe always
31+
if (cm.param.par.continuousTracking) {
3232
cm.calibObjects.fastTransformHelper->getCorrMap()->TransformInTimeFrame(sector, row, pad, time, x, y, z, cm.param.continuousMaxTimeBin);
3333
} else {
3434
cm.calibObjects.fastTransformHelper->Transform(sector, row, pad, time, x, y, z);

GPU/TPCFastTransformation/TPCFastTransform.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ class TPCFastTransform : public FlatObject
194194

195195
/// Inverse transformation
196196
GPUd() void InverseTransformInTimeFrame(int32_t slice, int32_t row, float /*x*/, float y, float z, float& pad, float& time, float maxTimeBin) const;
197-
GPUd() float InverseTransformInTimeFrame(int32_t slice, float z, float maxTimeBin) const;
198197

199198
/// Inverse transformation: Transformed Y and Z -> transformed X
200199
GPUd() void InverseTransformYZtoX(int32_t slice, int32_t row, float y, float z, float& x, const TPCFastTransform* ref = nullptr, const TPCFastTransform* ref2 = nullptr, float scale = 0.f, float scale2 = 0.f, int32_t scaleMode = 0) const;
@@ -668,13 +667,6 @@ GPUdi() void TPCFastTransform::InverseTransformInTimeFrame(int32_t slice, int32_
668667
convUVtoPadTimeInTimeFrame(slice, row, u, v, pad, time, maxTimeBin);
669668
}
670669

671-
GPUdi() float TPCFastTransform::InverseTransformInTimeFrame(int32_t slice, float z, float maxTimeBin) const
672-
{
673-
float pad, time;
674-
InverseTransformInTimeFrame(slice, 0, 0, 0, z, pad, time, maxTimeBin);
675-
return time;
676-
}
677-
678670
GPUdi() void TPCFastTransform::TransformIdealZ(int32_t slice, float time, float& z, float vertexTime) const
679671
{
680672
/// _______________ The main method: cluster transformation _______________________

0 commit comments

Comments
 (0)