@@ -491,8 +491,8 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
491491 trk.SinPhi () = inTrack->Param ().GetSinPhi ();
492492 trk.DzDs () = inTrack->Param ().GetDzDs ();
493493 trk.QPt () = inTrack->Param ().GetQPt ();
494- trk.TZOffset () = GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack->Param ().GetZOffset (), Param ().continuousMaxTimeBin );
495- const auto tmp = sectorTrack.ClusterZTN () > sectorTrack.ClusterZT0 () ? std::array<float , 2 >{sectorTrack.ClusterZTN (), sectorTrack.ClusterZT0 ()} : std::array<float , 2 >{sectorTrack.ClusterZT0 (), sectorTrack.ClusterZTN ()};
494+ trk.TOffset () = GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack->Param ().GetZOffset (), Param ().continuousMaxTimeBin );
495+ const auto tmp = sectorTrack.ClusterTN () > sectorTrack.ClusterT0 () ? std::array<float , 2 >{sectorTrack.ClusterTN (), sectorTrack.ClusterT0 ()} : std::array<float , 2 >{sectorTrack.ClusterT0 (), sectorTrack.ClusterTN ()};
496496 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
497497 sectorTrack.SetX2 (0 .f );
498498 for (int32_t way = 0 ; way < 2 ; way++) {
@@ -514,7 +514,7 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
514514 row = ic.RowIndex ();
515515 const ClusterNative& cl = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear [GetConstantMem ()->ioPtrs .clustersNative ->clusterOffset [sector][0 ] + clusterIndex];
516516 flags = cl.getFlags ();
517- GetConstantMem ()->calibObjects .fastTransformHelper ->Transform (sector, row, cl.getPad (), cl.getTime (), x, y, z, trk.TZOffset ());
517+ GetConstantMem ()->calibObjects .fastTransformHelper ->Transform (sector, row, cl.getPad (), cl.getTime (), x, y, z, trk.TOffset ());
518518 if (prop.PropagateToXAlpha (x, alpha, way == 0 )) {
519519 return way == 0 ;
520520 }
@@ -533,15 +533,15 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
533533 return 0 ;
534534}
535535
536- GPUd () void GPUTPCGMMerger::SetTrackClusterZT (GPUTPCGMSectorTrack& track, int32_t iSector, const GPUTPCTrack* sectorTr)
536+ GPUd () void GPUTPCGMMerger::SetTrackClusterT (GPUTPCGMSectorTrack& track, int32_t iSector, const GPUTPCTrack* sectorTr)
537537{
538538 const GPUTPCTracker& trk = GetConstantMem ()->tpcTrackers [iSector];
539539 const GPUTPCHitId& ic1 = trk.TrackHits ()[sectorTr->FirstHitID ()];
540540 const GPUTPCHitId& ic2 = trk.TrackHits ()[sectorTr->FirstHitID () + sectorTr->NHits () - 1 ];
541541 int32_t clusterIndex1 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic1.RowIndex ()), ic1.HitIndex ());
542542 int32_t clusterIndex2 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic2.RowIndex ()), ic2.HitIndex ());
543543 const ClusterNative* cl = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear + GetConstantMem ()->ioPtrs .clustersNative ->clusterOffset [iSector][0 ];
544- track.SetClusterZT (cl[clusterIndex1].getTime (), cl[clusterIndex2].getTime ());
544+ track.SetClusterT (cl[clusterIndex1].getTime (), cl[clusterIndex2].getTime ());
545545}
546546
547547GPUd () void GPUTPCGMMerger::UnpackSaveNumber(int32_t id)
@@ -564,7 +564,7 @@ GPUd() void GPUTPCGMMerger::UnpackSectorGlobal(int32_t nBlocks, int32_t nThreads
564564 }
565565 uint32_t myTrack = CAMath::AtomicAdd (&mMemory ->nUnpackedTracks , 1u );
566566 GPUTPCGMSectorTrack& track = mSectorTrackInfos [myTrack];
567- SetTrackClusterZT (track, iSector, sectorTr);
567+ SetTrackClusterT (track, iSector, sectorTr);
568568 track.Set (this , sectorTr, alpha, iSector);
569569 track.SetGlobalSectorTrackCov ();
570570 track.SetPrevNeighbour (-1 );
@@ -595,22 +595,12 @@ GPUd() void GPUTPCGMMerger::RefitSectorTracks(int32_t nBlocks, int32_t nThreads,
595595 for (uint32_t itr = iBlock * nThreads + iThread; itr < nLocalTracks; itr += nBlocks * nThreads) {
596596 sectorTr = &trk.Tracks ()[itr];
597597 GPUTPCGMSectorTrack track;
598- SetTrackClusterZT (track, iSector, sectorTr);
599- if (Param (). rec . tpc . mergerCovSource == 0 ) {
600- track.Set (this , sectorTr, alpha, iSector);
598+ SetTrackClusterT (track, iSector, sectorTr);
599+ if (RefitSectorTrack (track, sectorTr, alpha, iSector) ) {
600+ track.Set (this , sectorTr, alpha, iSector); // TODO: Why does the refit fail, it shouldn't, this workaround should be removed
601601 if (!track.FilterErrors (this , iSector, GPUCA_MAX_SIN_PHI, 0 .1f )) {
602602 continue ;
603603 }
604- } else if (Param ().rec .tpc .mergerCovSource == 1 ) {
605- track.Set (this , sectorTr, alpha, iSector);
606- track.CopyBaseTrackCov ();
607- } else if (Param ().rec .tpc .mergerCovSource == 2 ) {
608- if (RefitSectorTrack (track, sectorTr, alpha, iSector)) {
609- track.Set (this , sectorTr, alpha, iSector); // TODO: Why does the refit fail, it shouldn't, this workaround should be removed
610- if (!track.FilterErrors (this , iSector, GPUCA_MAX_SIN_PHI, 0 .1f )) {
611- continue ;
612- }
613- }
614604 }
615605
616606 CADEBUG (GPUInfo (" INPUT Sector %d, Track %u, QPt %f DzDs %f" , iSector, itr, track.QPt (), track.DzDs ()));
@@ -686,7 +676,7 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
686676 }
687677 trackTmp = *trackMin;
688678 track = &trackTmp;
689- if (Param (). rec . tpc . mergerCovSource == 2 && trackTmp.X2 () != 0 .f ) {
679+ if (trackTmp.X2 () != 0 .f ) {
690680 trackTmp.UseParam2 ();
691681 } else {
692682 trackTmp.Set (this , trackMin->OrigTrack (), trackMin->Alpha (), trackMin->Sector ());
@@ -1199,17 +1189,17 @@ GPUd() void GPUTPCGMMerger::ResolveMergeSectors(GPUResolveSharedMemory& smem, in
11991189 }
12001190
12011191 float z1min, z1max, z2min, z2max;
1202- z1min = track1->MinClusterZT ();
1203- z1max = track1->MaxClusterZT ();
1204- z2min = track2->MinClusterZT ();
1205- z2max = track2->MaxClusterZT ();
1192+ z1min = track1->MinClusterT ();
1193+ z1max = track1->MaxClusterT ();
1194+ z2min = track2->MinClusterT ();
1195+ z2max = track2->MaxClusterT ();
12061196 if (track1 != track1Base) {
1207- z1min = CAMath::Min (z1min, track1Base->MinClusterZT ());
1208- z1max = CAMath::Max (z1max, track1Base->MaxClusterZT ());
1197+ z1min = CAMath::Min (z1min, track1Base->MinClusterT ());
1198+ z1max = CAMath::Max (z1max, track1Base->MaxClusterT ());
12091199 }
12101200 if (track2 != track2Base) {
1211- z2min = CAMath::Min (z2min, track2Base->MinClusterZT ());
1212- z2max = CAMath::Max (z2max, track2Base->MaxClusterZT ());
1201+ z2min = CAMath::Min (z2min, track2Base->MinClusterT ());
1202+ z2max = CAMath::Max (z2max, track2Base->MaxClusterT ());
12131203 }
12141204 bool goUp = z2max - z1min > z1max - z2min;
12151205
@@ -1372,8 +1362,8 @@ GPUd() void GPUTPCGMMerger::MergeCE(int32_t nBlocks, int32_t nThreads, int32_t i
13721362 &mClusters [trk[0 ]->FirstClusterRef ()], &mClusters [trk[0 ]->FirstClusterRef () + trk[0 ]->NClusters () - 1 ],
13731363 &mClusters [trk[1 ]->FirstClusterRef ()], &mClusters [trk[1 ]->FirstClusterRef () + trk[1 ]->NClusters () - 1 ], clsmax);
13741364 const float offset = CAMath::Max (tmax - mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->getMaxDriftTime (clsmax->sector , clsmax->row , cls[clsmax->num ].getPad ()), 0 .f );
1375- trk[1 ]->Param ().Z () += mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->convDeltaTimeToDeltaZinTimeFrame (trk[1 ]->CSide () * NSECTORS / 2 , trk[1 ]->Param ().TZOffset () - offset);
1376- trk[1 ]->Param ().TZOffset () = offset;
1365+ trk[1 ]->Param ().Z () += mConstantMem ->calibObjects .fastTransformHelper ->getCorrMap ()->convDeltaTimeToDeltaZinTimeFrame (trk[1 ]->CSide () * NSECTORS / 2 , trk[1 ]->Param ().TOffset () - offset);
1366+ trk[1 ]->Param ().TOffset () = offset;
13771367 }
13781368 int32_t pos = newRef;
13791369#pragma unroll
@@ -1475,19 +1465,19 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
14751465 jtr = mSectorTrackInfos [jtr].NextNeighbour ();
14761466 }
14771467
1478- float mainZT = 1e9 ;
1468+ float mainT = 1e9 ;
14791469 revertSegments = true ;
14801470 for (uint32_t k = 0 ; k < 2 ; k++) { // --------------- check if first or last segment is primary ---------------
14811471 int32_t ichk = k ? lasttr : itr;
14821472 const GPUTPCGMSectorTrack* trchk = &mSectorTrackInfos [ichk];
14831473 while (true ) {
1484- float zt = -trchk->MinClusterZT ();
1485- if (zt < mainZT ) {
1474+ float t = -trchk->MinClusterT ();
1475+ if (t < mainT ) {
14861476 if (k) {
14871477 revertSegments = false ;
14881478 break ;
14891479 }
1490- mainZT = zt ;
1480+ mainT = t ;
14911481 }
14921482 int32_t next = trchk->NextSegmentNeighbour ();
14931483 if (next < 0 || next == ichk) {
@@ -1516,7 +1506,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
15161506 }
15171507 trchk = &mSectorTrackInfos [next];
15181508 }
1519- revertInSegment = longest->ClusterZT0 () < longest->ClusterZTN ();
1509+ revertInSegment = longest->ClusterT0 () < longest->ClusterTN ();
15201510 }
15211511 }
15221512 lastMergedSegment = -1 ;
@@ -1707,7 +1697,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
17071697 p1.Z () = p2.Z ();
17081698 p1.SinPhi () = p2.SinPhi ();
17091699 }
1710- p1.TZOffset () = p2.TZOffset ();
1700+ p1.TOffset () = p2.TOffset ();
17111701 p1.DzDs () = p2.DzDs ();
17121702 p1.QPt () = p2.QPt ();
17131703 mergedTrack.SetAlpha (p2.Alpha ());
@@ -1787,7 +1777,7 @@ GPUd() void GPUTPCGMMerger::PrepareForFit1(int32_t nBlocks, int32_t nThreads, in
17871777 updTrk = &trk;
17881778 while (updTrk->PrevSegment () >= 0 ) {
17891779 updTrk = &mMergedTracks [updTrk->PrevSegment ()];
1790- updTrk->Param ().TZOffset () = trk.Param ().TZOffset ();
1780+ updTrk->Param ().TOffset () = trk.Param ().TOffset ();
17911781 }
17921782 }
17931783 }
@@ -1865,7 +1855,7 @@ GPUd() void GPUTPCGMMerger::MergeLoopersInit(int32_t nBlocks, int32_t nThreads,
18651855 const float qptabs = CAMath::Abs (p.GetQPt ());
18661856 if (trk.NClusters () && qptabs * Param ().qptB5Scaler > 5 .f && qptabs * Param ().qptB5Scaler <= lowPtThresh) {
18671857 const int32_t sector = mClusters [trk.FirstClusterRef () + trk.NClusters () - 1 ].sector ;
1868- const float refz = p.GetZ () + GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convVertexTimeToZOffset (sector, p.GetTZOffset (), Param ().continuousMaxTimeBin ) + (trk.CSide () ? -100 : 100 );
1858+ const float refz = p.GetZ () + GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convVertexTimeToZOffset (sector, p.GetTOffset (), Param ().continuousMaxTimeBin ) + (trk.CSide () ? -100 : 100 );
18691859 float sinA, cosA;
18701860 CAMath::SinCos (trk.GetAlpha (), sinA, cosA);
18711861 float gx = cosA * p.GetX () - sinA * p.GetY ();
@@ -1889,7 +1879,7 @@ GPUd() void GPUTPCGMMerger::MergeLoopersInit(int32_t nBlocks, int32_t nThreads,
18891879 for (uint32_t k = 0;k < trk.NClusters();k++) {
18901880 float xx, yy, zz;
18911881 const ClusterNative& GPUrestrict() cl = GetConstantMem()->ioPtrs.clustersNative->clustersLinear[mClusters[trk.FirstClusterRef() + k].num];
1892- GetConstantMem()->calibObjects.fastTransformHelper->Transform(mClusters[trk.FirstClusterRef() + k].sector, mClusters[trk.FirstClusterRef() + k].row, cl.getPad(), cl.getTime(), xx, yy, zz, p.GetTZOffset ());
1882+ GetConstantMem()->calibObjects.fastTransformHelper->Transform(mClusters[trk.FirstClusterRef() + k].sector, mClusters[trk.FirstClusterRef() + k].row, cl.getPad(), cl.getTime(), xx, yy, zz, p.GetTOffset ());
18931883 float sa2, ca2;
18941884 CAMath::SinCos(Param().Alpha(mClusters[trk.FirstClusterRef() + k].sector), sa2, ca2);
18951885 float cx = ca2 * xx - sa2 * yy;
0 commit comments