4545using namespace GPUCA_NAMESPACE ::gpu;
4646
4747#define GET_CID (slice, i ) (mParam ->par.earlyTpcTransform ? mIOPtrs ->clusterData[slice][i].id : (mIOPtrs ->clustersNative->clusterOffset[slice][0 ] + i))
48- #define SEPERATE_GLOBAL_TRACKS_LIMIT (mCfgH .separateGlobalTracks ? tGLOBALTRACK : TRACK_TYPE_ID_LIMIT)
4948
5049const GPUTRDGeometry* GPUDisplay::trdGeometry () { return (GPUTRDGeometry*)mCalib ->trdGeometry ; }
5150const GPUTPCTracker& GPUDisplay::sliceTracker (int32_t iSlice) { return mChain ->GetTPCSliceTrackers ()[iSlice]; }
@@ -421,6 +420,8 @@ void GPUDisplay::DrawFinal(int32_t iSlice, int32_t /*iCol*/, GPUTPCGMPropagator*
421420 }
422421
423422 // Print TPC part of track
423+ int32_t separateGlobalTracksLimit = (mCfgH .separateGlobalTracks ? tGLOBALTRACK : TRACK_TYPE_ID_LIMIT);
424+ uint32_t lastSide = -1 ;
424425 for (int32_t k = 0 ; k < nClusters; k++) {
425426 if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
426427 if (mCfgH .hideRejectedClusters && (mIOPtrs ->mergedTrackHits [track->FirstClusterRef () + k].state & GPUTPCGMMergedTrackHit::flagReject)) {
@@ -435,31 +436,37 @@ void GPUDisplay::DrawFinal(int32_t iSlice, int32_t /*iCol*/, GPUTPCGMPropagator*
435436 }
436437 int32_t w = mGlobalPos [cid].w ;
437438 if (drawing) {
438- drawPointLinestrip (iSlice, cid, tFINALTRACK, SEPERATE_GLOBAL_TRACKS_LIMIT);
439+ if (mCfgH .splitCETracks && lastSide != (mGlobalPos [cid].z < 0 )) {
440+ insertVertexList (vBuf[0 ], startCountInner, mVertexBuffer [iSlice].size ());
441+ drawing = false ;
442+ lastCluster = -1 ;
443+ } else {
444+ drawPointLinestrip (iSlice, cid, tFINALTRACK, separateGlobalTracksLimit);
445+ }
439446 }
440- if (w == SEPERATE_GLOBAL_TRACKS_LIMIT ) {
447+ if (w == separateGlobalTracksLimit ) {
441448 if (drawing) {
442449 insertVertexList (vBuf[0 ], startCountInner, mVertexBuffer [iSlice].size ());
443450 }
444451 drawing = false ;
445452 } else {
446453 if (!drawing) {
447454 startCountInner = mVertexBuffer [iSlice].size ();
448- }
449- if (!drawing) {
450- drawPointLinestrip (iSlice, cid, tFINALTRACK, SEPERATE_GLOBAL_TRACKS_LIMIT);
451- }
452- if (!drawing && lastCluster != -1 ) {
453- if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
454- cid = mIOPtrs ->mergedTrackHits [track->FirstClusterRef () + lastCluster].num ;
455- } else {
456- cid = &track->getCluster (mIOPtrs ->outputClusRefsTPCO2 , lastCluster, *mIOPtrs ->clustersNative ) - mIOPtrs ->clustersNative ->clustersLinear ;
455+ if (lastCluster != -1 && (!mCfgH .splitCETracks || lastSide == (mGlobalPos [cid].z < 0 ))) {
456+ int32_t lastcid;
457+ if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
458+ lastcid = mIOPtrs ->mergedTrackHits [track->FirstClusterRef () + lastCluster].num ;
459+ } else {
460+ lastcid = &track->getCluster (mIOPtrs ->outputClusRefsTPCO2 , lastCluster, *mIOPtrs ->clustersNative ) - mIOPtrs ->clustersNative ->clustersLinear ;
461+ }
462+ drawPointLinestrip (iSlice, lastcid, tFINALTRACK, separateGlobalTracksLimit);
457463 }
458- drawPointLinestrip (iSlice, cid, 7 , SEPERATE_GLOBAL_TRACKS_LIMIT );
464+ drawPointLinestrip (iSlice, cid, tFINALTRACK, separateGlobalTracksLimit );
459465 }
460466 drawing = true ;
461467 }
462468 lastCluster = k;
469+ lastSide = mGlobalPos [cid].z < 0 ;
463470 }
464471
465472 // Print ITS part of track
0 commit comments