@@ -488,7 +488,7 @@ GPUd() void GPUTPCGMMerger::ClearTrackLinks(int32_t nBlocks, int32_t nThreads, i
488488 }
489489}
490490
491- GPUd () int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack, MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_pointer > inTrack, float alpha, int32_t sector)
491+ GPUd () int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack, MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_reference > inTrack, float alpha, int32_t sector)
492492{
493493 GPUTPCGMPropagator prop;
494494 prop.SetMaterialTPC ();
@@ -497,14 +497,14 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
497497 prop.SetFitInProjections (false );
498498 prop.SetPolynomialField (&Param ().polynomialField );
499499 GPUTPCGMTrackParam trk;
500- trk.X () = inTrack-> Param ().GetX ();
501- trk.Y () = inTrack-> Param ().GetY ();
502- trk.Z () = inTrack-> Param ().GetZ ();
503- trk.SinPhi () = inTrack-> Param ().GetSinPhi ();
504- trk.DzDs () = inTrack-> Param ().GetDzDs ();
505- trk.QPt () = inTrack-> Param ().GetQPt ();
506- trk.TZOffset () = Param ().par .earlyTpcTransform ? inTrack-> Param ().GetZOffset () : GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack-> Param ().GetZOffset (), Param ().continuousMaxTimeBin );
507- trk.ShiftZ (this , sector, sectorTrack.ClusterZT0 (), sectorTrack.ClusterZTN (), inTrack-> Param ().GetX (), inTrack-> Param ().GetX ()); // We do not store the inner / outer cluster X, so we just use the track X instead
500+ trk.X () = inTrack. Param ().GetX ();
501+ trk.Y () = inTrack. Param ().GetY ();
502+ trk.Z () = inTrack. Param ().GetZ ();
503+ trk.SinPhi () = inTrack. Param ().GetSinPhi ();
504+ trk.DzDs () = inTrack. Param ().GetDzDs ();
505+ trk.QPt () = inTrack. Param ().GetQPt ();
506+ trk.TZOffset () = Param ().par .earlyTpcTransform ? inTrack. Param ().GetZOffset () : GetConstantMem ()->calibObjects .fastTransformHelper ->getCorrMap ()->convZOffsetToVertexTime (sector, inTrack. Param ().GetZOffset (), Param ().continuousMaxTimeBin );
507+ trk.ShiftZ (this , sector, sectorTrack.ClusterZT0 (), sectorTrack.ClusterZTN (), inTrack. Param ().GetX (), inTrack. Param ().GetX ()); // We do not store the inner / outer cluster X, so we just use the track X instead
508508 sectorTrack.SetX2 (0 .f );
509509 for (int32_t way = 0 ; way < 2 ; way++) {
510510 if (way) {
@@ -513,14 +513,14 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
513513 }
514514 trk.ResetCovariance ();
515515 prop.SetTrack (&trk, alpha);
516- int32_t start = way ? inTrack-> NHits () - 1 : 0 ;
517- int32_t end = way ? 0 : (inTrack-> NHits () - 1 );
516+ int32_t start = way ? inTrack. NHits () - 1 : 0 ;
517+ int32_t end = way ? 0 : (inTrack. NHits () - 1 );
518518 int32_t incr = way ? -1 : 1 ;
519519 for (int32_t i = start; i != end; i += incr) {
520520 float x, y, z;
521521 int32_t row, flags;
522522 const GPUTPCTracker& tracker = GetConstantMem ()->tpcTrackers [sector];
523- const GPUTPCHitId& ic = tracker.TrackHits ()[inTrack-> FirstHitID () + i];
523+ const GPUTPCHitId& ic = tracker.TrackHits ()[inTrack. FirstHitID () + i];
524524 int32_t clusterIndex = tracker.Data ().ClusterDataIndex (tracker.Data ().Row (ic.RowIndex ()), ic.HitIndex ());
525525 row = ic.RowIndex ();
526526 const ClusterNative& cl = GetConstantMem ()->ioPtrs .clustersNative ->clustersLinear [GetConstantMem ()->ioPtrs .clustersNative ->clusterOffset [sector][0 ] + clusterIndex];
@@ -550,11 +550,11 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
550550 return 0 ;
551551}
552552
553- GPUd () void GPUTPCGMMerger::SetTrackClusterZT(GPUTPCGMSectorTrack& track, int32_t iSector, MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_pointer > sectorTr)
553+ GPUd () void GPUTPCGMMerger::SetTrackClusterZT(GPUTPCGMSectorTrack& track, int32_t iSector, MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_reference > sectorTr)
554554{
555555 const GPUTPCTracker& trk = GetConstantMem ()->tpcTrackers [iSector];
556- const GPUTPCHitId& ic1 = trk.TrackHits ()[sectorTr-> FirstHitID ()];
557- const GPUTPCHitId& ic2 = trk.TrackHits ()[sectorTr-> FirstHitID () + sectorTr-> NHits () - 1 ];
556+ const GPUTPCHitId& ic1 = trk.TrackHits ()[sectorTr. FirstHitID ()];
557+ const GPUTPCHitId& ic2 = trk.TrackHits ()[sectorTr. FirstHitID () + sectorTr. NHits () - 1 ];
558558 int32_t clusterIndex1 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic1.RowIndex ()), ic1.HitIndex ());
559559 int32_t clusterIndex2 = trk.Data ().ClusterDataIndex (trk.Data ().Row (ic2.RowIndex ()), ic2.HitIndex ());
560560 if (Param ().par .earlyTpcTransform ) {
@@ -574,12 +574,11 @@ GPUd() void GPUTPCGMMerger::UnpackSectorGlobal(int32_t nBlocks, int32_t nThreads
574574{
575575 const GPUTPCTracker& trk = GetConstantMem ()->tpcTrackers [iSector];
576576 float alpha = Param ().Alpha (iSector);
577- MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_pointer> sectorTr = mMemory ->firstExtrapolatedTracks [iSector];
578577 uint32_t nLocalTracks = trk.CommonMemory ()->nLocalTracks ;
579578 uint32_t nTracks = *trk.NTracks ();
580579 for (uint32_t itr = nLocalTracks + iBlock * nThreads + iThread; itr < nTracks; itr += nBlocks * nThreads) {
581- sectorTr = & trk.Tracks ()[itr];
582- int32_t localId = mTrackIDs [(sectorTr-> LocalTrackId () >> 24 ) * mNMaxSingleSectorTracks + (sectorTr-> LocalTrackId () & 0xFFFFFF )];
580+ MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_reference> sectorTr = trk.Tracks ()[itr];
581+ int32_t localId = mTrackIDs [(sectorTr. LocalTrackId () >> 24 ) * mNMaxSingleSectorTracks + (sectorTr. LocalTrackId () & 0xFFFFFF )];
583582 if (localId == -1 ) {
584583 continue ;
585584 }
@@ -611,10 +610,9 @@ GPUd() void GPUTPCGMMerger::RefitSectorTracks(int32_t nBlocks, int32_t nThreads,
611610 uint32_t nLocalTracks = trk.CommonMemory ()->nLocalTracks ;
612611
613612 float alpha = Param ().Alpha (iSector);
614- MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_pointer> sectorTr;
615613
616614 for (uint32_t itr = iBlock * nThreads + iThread; itr < nLocalTracks; itr += nBlocks * nThreads) {
617- sectorTr = & trk.Tracks ()[itr];
615+ MemLayout::wrapper<GPUTPCTrackSkeleton, MemLayout::const_reference> sectorTr = trk.Tracks ()[itr];
618616 GPUTPCGMSectorTrack track;
619617 SetTrackClusterZT (track, iSector, sectorTr);
620618 if (Param ().rec .tpc .mergerCovSource == 0 ) {
@@ -642,7 +640,7 @@ GPUd() void GPUTPCGMMerger::RefitSectorTracks(int32_t nBlocks, int32_t nThreads,
642640 track.SetExtrapolatedTrackId (0 , -1 );
643641 track.SetExtrapolatedTrackId (1 , -1 );
644642 uint32_t myTrack = CAMath::AtomicAdd (&mMemory ->nUnpackedTracks , 1u );
645- mTrackIDs [iSector * mNMaxSingleSectorTracks + sectorTr-> LocalTrackId ()] = myTrack;
643+ mTrackIDs [iSector * mNMaxSingleSectorTracks + sectorTr. LocalTrackId ()] = myTrack;
646644 mSectorTrackInfos [myTrack] = track;
647645 }
648646}
@@ -710,7 +708,7 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
710708 if (Param ().rec .tpc .mergerCovSource == 2 && trackTmp.X2 () != 0 .f ) {
711709 trackTmp.UseParam2 ();
712710 } else {
713- trackTmp.Set (this , trackMin->OrigTrack (), trackMin->Alpha (), trackMin->Sector ());
711+ trackTmp.Set (this , * trackMin->OrigTrack (), trackMin->Alpha (), trackMin->Sector ());
714712 }
715713 } else {
716714 if (CAMath::Abs (track->QPt ()) * Param ().qptB5Scaler < Param ().rec .tpc .mergerLooperSecondHorizontalQPtB5Limit ) {
0 commit comments