Skip to content

Commit 84a89e8

Browse files
committed
GPU TPC: Do not use fitWithoutProjection for now, sometimes broken
1 parent a839182 commit 84a89e8

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
555555
prop.SetMaterialTPC();
556556
prop.SetMaxSinPhi(GPUCA_MAX_SIN_PHI);
557557
prop.SetSeedingErrors(true); // Larger errors for seeds, better since we don't start with good hypothesis
558-
prop.SetFitInProjections(false);
558+
prop.SetFitInProjections(true); // TODO: Was false, consider reenabling after fitInProjection is fixed
559559
prop.SetPolynomialField(&Param().polynomialField);
560560
GPUTPCGMTrackParam trk;
561561
trk.X() = inTrack->Param().GetX();
@@ -718,9 +718,6 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
718718
} else if (iBorder == 3) { // transport to the middle of the sector and rotate vertically to the border on the right
719719
dAlpha = -dAlpha;
720720
x0 = GPUTPCGeometry::Row2X(63);
721-
} else if (iBorder == 4) { // transport to the middle of the sßector, w/o rotation
722-
dAlpha = 0;
723-
x0 = GPUTPCGeometry::Row2X(63);
724721
}
725722

726723
const float maxSin = CAMath::Sin(60.f / 180.f * CAMath::Pi());
@@ -783,14 +780,14 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
783780
}
784781

785782
template <>
786-
GPUd() void GPUTPCGMMerger::MergeBorderTracks<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
783+
GPUd() void GPUTPCGMMerger::MergeBorderTracks<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, const GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, const GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
787784
{
788785
CADEBUG(GPUInfo("\nMERGING Sectors %d %d NTracks %d %d CROSS %d", iSector1, iSector2, N1, N2, mergeMode));
789786
GPUTPCGMBorderRange* range1 = mBorderRange[iSector1];
790787
GPUTPCGMBorderRange* range2 = mBorderRange[iSector2] + *GetConstantMem()->tpcTrackers[iSector2].NTracks();
791788
bool sameSector = (iSector1 == iSector2);
792789
for (int32_t itr = iBlock * nThreads + iThread; itr < N1; itr += nThreads * nBlocks) {
793-
GPUTPCGMBorderTrack& b = B1[itr];
790+
const GPUTPCGMBorderTrack& b = B1[itr];
794791
float d = CAMath::Max(0.5f, 3.5f * CAMath::Sqrt(b.Cov()[1]));
795792
if (CAMath::Abs(b.Par()[4]) * Param().qptB5Scaler >= 20) {
796793
d *= 2;
@@ -809,7 +806,7 @@ GPUd() void GPUTPCGMMerger::MergeBorderTracks<0>(int32_t nBlocks, int32_t nThrea
809806
}
810807
if (!sameSector) {
811808
for (int32_t itr = iBlock * nThreads + iThread; itr < N2; itr += nThreads * nBlocks) {
812-
GPUTPCGMBorderTrack& b = B2[itr];
809+
const GPUTPCGMBorderTrack& b = B2[itr];
813810
float d = CAMath::Max(0.5f, 3.5f * CAMath::Sqrt(b.Cov()[1]));
814811
if (CAMath::Abs(b.Par()[4]) * Param().qptB5Scaler >= 20) {
815812
d *= 2;
@@ -827,7 +824,7 @@ GPUd() void GPUTPCGMMerger::MergeBorderTracks<0>(int32_t nBlocks, int32_t nThrea
827824
}
828825

829826
template <>
830-
GPUd() void GPUTPCGMMerger::MergeBorderTracks<1>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
827+
GPUd() void GPUTPCGMMerger::MergeBorderTracks<1>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, const GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, const GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
831828
{
832829
#if !defined(GPUCA_GPUCODE_COMPILEKERNELS)
833830
GPUTPCGMBorderRange* range1 = mBorderRange[iSector1];
@@ -860,7 +857,7 @@ GPUd() void GPUTPCGMMerger::MergeBorderTracks<3>(int32_t nBlocks, int32_t nThrea
860857
}
861858

862859
template <>
863-
GPUd() void GPUTPCGMMerger::MergeBorderTracks<2>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
860+
GPUd() void GPUTPCGMMerger::MergeBorderTracks<2>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, const GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, const GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode)
864861
{
865862
// int32_t statAll = 0, statMerged = 0;
866863
float factor2ys = Param().rec.tpc.trackMergerFactor2YS;
@@ -887,7 +884,7 @@ GPUd() void GPUTPCGMMerger::MergeBorderTracks<2>(int32_t nBlocks, int32_t nThrea
887884
i2++;
888885
}
889886

890-
GPUTPCGMBorderTrack& b1 = B1[r1.fId];
887+
const GPUTPCGMBorderTrack& b1 = B1[r1.fId];
891888
if (b1.NClusters() < minNPartHits) {
892889
continue;
893890
}
@@ -904,7 +901,7 @@ GPUd() void GPUTPCGMMerger::MergeBorderTracks<2>(int32_t nBlocks, int32_t nThrea
904901
}
905902
// do check
906903

907-
GPUTPCGMBorderTrack& b2 = B2[r2.fId];
904+
const GPUTPCGMBorderTrack& b2 = B2[r2.fId];
908905
#if defined(GPUCA_MERGER_BY_MC_LABEL) && !defined(GPUCA_GPUCODE)
909906
int64_t label1 = GetTrackLabel(b1);
910907
int64_t label2 = GetTrackLabel(b2);
@@ -1019,7 +1016,7 @@ GPUd() void GPUTPCGMMerger::MergeWithinSectorsPrepare(int32_t nBlocks, int32_t n
10191016
const float maxSin = CAMath::Sin(60.f / 180.f * CAMath::Pi());
10201017

10211018
for (int32_t itr = iBlock * nThreads + iThread; itr < SectorTrackInfoLocalTotal(); itr += nThreads * nBlocks) {
1022-
GPUTPCGMSectorTrack& track = mSectorTrackInfos[itr];
1019+
const GPUTPCGMSectorTrack& track = mSectorTrackInfos[itr];
10231020
int32_t iSector = track.Sector();
10241021
GPUTPCGMBorderTrack b;
10251022
if (track.TransportToX(this, x0, Param().bzCLight, b, maxSin)) {

GPU/GPUTracking/Merger/GPUTPCGMMerger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class GPUTPCGMMerger : public GPUProcessor
226226
private:
227227
GPUd() void MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iBorder, GPUTPCGMBorderTrack** B, GPUAtomic(uint32_t) * nB, bool useOrigTrackParam = false);
228228
template <int32_t I>
229-
GPUd() void MergeBorderTracks(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode = 0);
229+
GPUd() void MergeBorderTracks(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, int32_t iSector1, const GPUTPCGMBorderTrack* B1, int32_t N1, int32_t iSector2, const GPUTPCGMBorderTrack* B2, int32_t N2, int32_t mergeMode = 0);
230230

231231
GPUd() void MergeCEFill(const GPUTPCGMSectorTrack* track, const GPUTPCGMMergedTrackHit& cls, int32_t itr);
232232

GPU/GPUTracking/Merger/GPUTPCGMSectorTrack.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class GPUTPCGMSectorTrack
5454
GPUd() float SecPhi() const { return mParam.mSecPhi; }
5555
GPUd() float DzDs() const { return mParam.mDzDs; }
5656
GPUd() float QPt() const { return mParam.mQPt; }
57+
GPUd() const auto& Param() const { return mParam; }
5758
GPUd() float TOffset() const { return mTOffset; }
5859

5960
GPUd() int32_t LocalTrackId() const { return mLocalTrackId; }
@@ -75,7 +76,7 @@ class GPUTPCGMSectorTrack
7576
GPUd() void Set(const GPUTPCGMTrackParam& trk, const GPUTPCTrack* sectorTr, float alpha, int32_t sector);
7677
GPUd() void SetParam2(const GPUTPCGMTrackParam& trk);
7778
GPUd() void Set(const GPUTPCGMMerger* merger, const GPUTPCTrack* sectorTr, float alpha, int32_t sector);
78-
GPUd() void UseParam2() { mParam = mParam2; }
79+
GPUd() void UseParam2() { mParam = mParam2; } // TODO: Clean this up!
7980
GPUd() void SetX2(float v) { mParam2.mX = v; }
8081
GPUd() float X2() const { return mParam2.mX; }
8182

0 commit comments

Comments
 (0)