@@ -514,8 +514,8 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
514514 trk.SinPhi () = inTrack->Param ().GetSinPhi ();
515515 trk.DzDs () = inTrack->Param ().GetDzDs ();
516516 trk.QPt () = inTrack->Param ().GetQPt ();
517- trk.TZOffset () = GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack->Param ().GetZOffset (), Param ().continuousMaxTimeBin );
518- const auto tmp = sectorTrack.ClusterZTN () > sectorTrack.ClusterZT0 () ? std::array<float , 2 >{sectorTrack.ClusterZTN (), sectorTrack.ClusterZT0 ()} : std::array<float , 2 >{sectorTrack.ClusterZT0 (), sectorTrack.ClusterZTN ()};
517+ trk.TOffset () = GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack->Param ().GetZOffset (), Param ().continuousMaxTimeBin );
518+ const auto tmp = sectorTrack.ClusterTN () > sectorTrack.ClusterT0 () ? std::array<float , 2 >{sectorTrack.ClusterTN (), sectorTrack.ClusterT0 ()} : std::array<float , 2 >{sectorTrack.ClusterT0 (), sectorTrack.ClusterTN ()};
519519 trk.ShiftZ (this , sector, tmp[0 ], tmp[1 ], inTrack->Param ().GetX ()); // We do not store the inner / outer cluster X, so we just use the track X instead
520520 sectorTrack.SetX2 (0 .f );
521521 for (int32_t way = 0 ; way < 2 ; way++) {
@@ -537,7 +537,7 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
537537 row = ic.RowIndex ();
538538 const ClusterNative& cl = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear [GetConstantMem ()->ioPtrs .clustersNative ->clusterOffset [sector][0 ] + clusterIndex];
539539 flags = cl.getFlags ();
540- GetConstantMem ()->calibObjects .fastTransformHelper ->Transform (sector, row, cl.getPad (), cl.getTime (), x, y, z, trk.TZOffset ());
540+ GetConstantMem ()->calibObjects .fastTransformHelper ->Transform (sector, row, cl.getPad (), cl.getTime (), x, y, z, trk.TOffset ());
541541 if (prop.PropagateToXAlpha (x, alpha, way == 0 )) {
542542 return way == 0 ;
543543 }
@@ -556,15 +556,15 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
556556 return 0 ;
557557}
558558
559- GPUd () void GPUTPCGMMerger::SetTrackClusterZT (GPUTPCGMSectorTrack& track, int32_t iSector, const GPUTPCTrack* sectorTr)
559+ GPUd () void GPUTPCGMMerger::SetTrackClusterT (GPUTPCGMSectorTrack& track, int32_t iSector, const GPUTPCTrack* sectorTr)
560560{
561561 const GPUTPCTracker& trk = GetConstantMem ()->tpcTrackers [iSector];
562562 const GPUTPCHitId& ic1 = trk.TrackHits ()[sectorTr->FirstHitID ()];
563563 const GPUTPCHitId& ic2 = trk.TrackHits ()[sectorTr->FirstHitID () + sectorTr->NHits () - 1 ];
564564 int32_t clusterIndex1 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic1.RowIndex ()), ic1.HitIndex ());
565565 int32_t clusterIndex2 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic2.RowIndex ()), ic2.HitIndex ());
566566 const ClusterNative* cl = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear + GetConstantMem ()->ioPtrs .clustersNative ->clusterOffset [iSector][0 ];
567- track.SetClusterZT (cl[clusterIndex1].getTime (), cl[clusterIndex2].getTime ());
567+ track.SetClusterT (cl[clusterIndex1].getTime (), cl[clusterIndex2].getTime ());
568568}
569569
570570GPUd () void GPUTPCGMMerger::UnpackSaveNumber(int32_t id)
@@ -587,7 +587,7 @@ GPUd() void GPUTPCGMMerger::UnpackSectorGlobal(int32_t nBlocks, int32_t nThreads
587587 }
588588 uint32_t myTrack = CAMath::AtomicAdd (&mMemory ->nUnpackedTracks , 1u );
589589 GPUTPCGMSectorTrack& track = mSectorTrackInfos [myTrack];
590- SetTrackClusterZT (track, iSector, sectorTr);
590+ SetTrackClusterT (track, iSector, sectorTr);
591591 track.Set (this , sectorTr, alpha, iSector);
592592 track.SetGlobalSectorTrackCov ();
593593 track.SetPrevNeighbour (-1 );
@@ -618,22 +618,12 @@ GPUd() void GPUTPCGMMerger::RefitSectorTracks(int32_t nBlocks, int32_t nThreads,
618618 for (uint32_t itr = iBlock * nThreads + iThread; itr < nLocalTracks; itr += nBlocks * nThreads) {
619619 sectorTr = &trk.Tracks ()[itr];
620620 GPUTPCGMSectorTrack track;
621- SetTrackClusterZT (track, iSector, sectorTr);
622- if (Param (). rec . tpc . mergerCovSource == 0 ) {
623- track.Set (this , sectorTr, alpha, iSector);
621+ SetTrackClusterT (track, iSector, sectorTr);
622+ if (RefitSectorTrack (track, sectorTr, alpha, iSector) ) {
623+ track.Set (this , sectorTr, alpha, iSector); // TODO: Why does the refit fail, it shouldn't, this workaround should be removed
624624 if (!track.FilterErrors (this , iSector, GPUCA_MAX_SIN_PHI, 0 .1f )) {
625625 continue ;
626626 }
627- } else if (Param ().rec .tpc .mergerCovSource == 1 ) {
628- track.Set (this , sectorTr, alpha, iSector);
629- track.CopyBaseTrackCov ();
630- } else if (Param ().rec .tpc .mergerCovSource == 2 ) {
631- if (RefitSectorTrack (track, sectorTr, alpha, iSector)) {
632- track.Set (this , sectorTr, alpha, iSector); // TODO: Why does the refit fail, it shouldn't, this workaround should be removed
633- if (!track.FilterErrors (this , iSector, GPUCA_MAX_SIN_PHI, 0 .1f )) {
634- continue ;
635- }
636- }
637627 }
638628
639629 CADEBUG (GPUInfo (" INPUT Sector %d, Track %u, QPt %f DzDs %f" , iSector, itr, track.QPt (), track.DzDs ()));
@@ -709,7 +699,7 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
709699 }
710700 trackTmp = *trackMin;
711701 track = &trackTmp;
712- if (Param (). rec . tpc . mergerCovSource == 2 && trackTmp.X2 () != 0 .f ) {
702+ if (trackTmp.X2 () != 0 .f ) {
713703 trackTmp.UseParam2 ();
714704 } else {
715705 trackTmp.Set (this , trackMin->OrigTrack (), trackMin->Alpha (), trackMin->Sector ());
@@ -1222,17 +1212,17 @@ GPUd() void GPUTPCGMMerger::ResolveMergeSectors(GPUResolveSharedMemory& smem, in
12221212 }
12231213
12241214 float z1min, z1max, z2min, z2max;
1225- z1min = track1->MinClusterZT ();
1226- z1max = track1->MaxClusterZT ();
1227- z2min = track2->MinClusterZT ();
1228- z2max = track2->MaxClusterZT ();
1215+ z1min = track1->MinClusterT ();
1216+ z1max = track1->MaxClusterT ();
1217+ z2min = track2->MinClusterT ();
1218+ z2max = track2->MaxClusterT ();
12291219 if (track1 != track1Base) {
1230- z1min = CAMath::Min (z1min, track1Base->MinClusterZT ());
1231- z1max = CAMath::Max (z1max, track1Base->MaxClusterZT ());
1220+ z1min = CAMath::Min (z1min, track1Base->MinClusterT ());
1221+ z1max = CAMath::Max (z1max, track1Base->MaxClusterT ());
12321222 }
12331223 if (track2 != track2Base) {
1234- z2min = CAMath::Min (z2min, track2Base->MinClusterZT ());
1235- z2max = CAMath::Max (z2max, track2Base->MaxClusterZT ());
1224+ z2min = CAMath::Min (z2min, track2Base->MinClusterT ());
1225+ z2max = CAMath::Max (z2max, track2Base->MaxClusterT ());
12361226 }
12371227 bool goUp = z2max - z1min > z1max - z2min;
12381228
@@ -1399,8 +1389,8 @@ GPUd() void GPUTPCGMMerger::MergeCE(int32_t nBlocks, int32_t nThreads, int32_t i
13991389 &mClusters [trk[0 ]->FirstClusterRef ()], &mClusters [trk[0 ]->FirstClusterRef () + trk[0 ]->NClusters () - 1 ],
14001390 &mClusters [trk[1 ]->FirstClusterRef ()], &mClusters [trk[1 ]->FirstClusterRef () + trk[1 ]->NClusters () - 1 ], clsmax);
14011391 const float offset = CAMath::Max (tmax - mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->getMaxDriftTime (clsmax->sector , clsmax->row , cls[clsmax->num ].getPad ()), 0 .f );
1402- trk[1 ]->Param ().Z () += mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->convDeltaTimeToDeltaZinTimeFrame (trk[1 ]->CSide () * NSECTORS / 2 , trk[1 ]->Param ().TZOffset () - offset);
1403- trk[1 ]->Param ().TZOffset () = offset;
1392+ trk[1 ]->Param ().Z () += mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->convDeltaTimeToDeltaZinTimeFrame (trk[1 ]->CSide () * NSECTORS / 2 , trk[1 ]->Param ().TOffset () - offset);
1393+ trk[1 ]->Param ().TOffset () = offset;
14041394 }
14051395 int32_t pos = newRef;
14061396#pragma unroll
@@ -1503,19 +1493,19 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
15031493 jtr = mSectorTrackInfos [jtr].NextNeighbour ();
15041494 }
15051495
1506- float mainZT = 1e9 ;
1496+ float mainT = 1e9 ;
15071497 revertSegments = true ;
15081498 for (uint32_t k = 0 ; k < 2 ; k++) { // --------------- check if first or last segment is primary ---------------
15091499 int32_t ichk = k ? lasttr : itr;
15101500 const GPUTPCGMSectorTrack* trchk = &mSectorTrackInfos [ichk];
15111501 while (true ) {
1512- float zt = -trchk->MinClusterZT ();
1513- if (zt < mainZT ) {
1502+ float t = -trchk->MinClusterT ();
1503+ if (t < mainT ) {
15141504 if (k) {
15151505 revertSegments = false ;
15161506 break ;
15171507 }
1518- mainZT = zt ;
1508+ mainT = t ;
15191509 }
15201510 int32_t next = trchk->NextSegmentNeighbour ();
15211511 if (next < 0 || next == ichk) {
@@ -1544,7 +1534,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
15441534 }
15451535 trchk = &mSectorTrackInfos [next];
15461536 }
1547- revertInSegment = longest->ClusterZT0 () < longest->ClusterZTN ();
1537+ revertInSegment = longest->ClusterT0 () < longest->ClusterTN ();
15481538 }
15491539 }
15501540 lastMergedSegment = -1 ;
@@ -1735,7 +1725,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
17351725 p1.Z () = p2.Z ();
17361726 p1.SinPhi () = p2.SinPhi ();
17371727 }
1738- p1.TZOffset () = p2.TZOffset ();
1728+ p1.TOffset () = p2.TOffset ();
17391729 p1.DzDs () = p2.DzDs ();
17401730 p1.QPt () = p2.QPt ();
17411731 mergedTrack.SetAlpha (p2.Alpha ());
@@ -1823,7 +1813,7 @@ GPUd() void GPUTPCGMMerger::PrepareForFit1(int32_t nBlocks, int32_t nThreads, in
18231813 break ;
18241814 }
18251815 updTrk = next;
1826- updTrk->Param ().TZOffset () = trk.Param ().TZOffset ();
1816+ updTrk->Param ().TOffset () = trk.Param ().TOffset ();
18271817 }
18281818 }
18291819 }
@@ -1901,7 +1891,7 @@ GPUd() void GPUTPCGMMerger::MergeLoopersInit(int32_t nBlocks, int32_t nThreads,
19011891 const float qptabs = CAMath::Abs (p.GetQPt ());
19021892 if (trk.NClusters () && qptabs * Param ().qptB5Scaler > 5 .f && qptabs * Param ().qptB5Scaler <= lowPtThresh) {
19031893 const int32_t sector = mClusters [trk.FirstClusterRef () + trk.NClusters () - 1 ].sector ;
1904- const float refz = p.GetZ () + GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convVertexTimeToZOffset (sector, p.GetTZOffset (), Param ().continuousMaxTimeBin ) + (trk.CSide () ? -100 : 100 );
1894+ const float refz = p.GetZ () + GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convVertexTimeToZOffset (sector, p.GetTOffset (), Param ().continuousMaxTimeBin ) + (trk.CSide () ? -100 : 100 );
19051895 float sinA, cosA;
19061896 CAMath::SinCos (trk.GetAlpha (), sinA, cosA);
19071897 float gx = cosA * p.GetX () - sinA * p.GetY ();
@@ -1925,7 +1915,7 @@ GPUd() void GPUTPCGMMerger::MergeLoopersInit(int32_t nBlocks, int32_t nThreads,
19251915 for (uint32_t k = 0;k < trk.NClusters();k++) {
19261916 float xx, yy, zz;
19271917 const ClusterNative& GPUrestrict() cl = GetConstantMem()->ioPtrs.clustersNative->clustersLinear[mClusters[trk.FirstClusterRef() + k].num];
1928- GetConstantMem()->calibObjects.fastTransformHelper->Transform(mClusters[trk.FirstClusterRef() + k].sector, mClusters[trk.FirstClusterRef() + k].row, cl.getPad(), cl.getTime(), xx, yy, zz, p.GetTZOffset ());
1918+ GetConstantMem()->calibObjects.fastTransformHelper->Transform(mClusters[trk.FirstClusterRef() + k].sector, mClusters[trk.FirstClusterRef() + k].row, cl.getPad(), cl.getTime(), xx, yy, zz, p.GetTOffset ());
19291919 float sa2, ca2;
19301920 CAMath::SinCos(Param().Alpha(mClusters[trk.FirstClusterRef() + k].sector), sa2, ca2);
19311921 float cx = ca2 * xx - sa2 * yy;
0 commit comments