Skip to content

Commit

Permalink
GPU Display: make connecting A and C side segments of a track optional
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Nov 14, 2024
1 parent 8aeaa54 commit 1901f38
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 16 deletions.
3 changes: 2 additions & 1 deletion GPU/GPUTracking/Definitions/GPUSettingsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ AddOption(drawTracksAndFilter, bool, false, "", 0, "Use AND filter instead of OR
AddOption(propagateLoopers, bool, false, "", 0, "Enabale propagation of loopers")
AddOption(clustersOnly, bool, false, "", 0, "Visualize clusters only")
AddOption(clustersOnNominalRow, bool, false, "", 0, "Show clusters at nominal x of pad row for early-transformed data")
AddOption(separateGlobalTracks, bool, false, "", 0, "Separate global tracks")
AddOption(separateGlobalTracks, bool, false, "", 0, "Draw track segments propagated to adjacent sectors separately")
AddOption(splitCETracks, int8_t, -1, "", 0, "Split CE tracks when they cross the central electrode (-1 = for triggered data)")
AddOption(markClusters, int32_t, 0, "", 0, "Mark clusters")
AddOption(markFakeClusters, int32_t, 0, "", 0, "Mark fake clusters")
AddOption(markAdjacentClusters, int32_t, 0, "", 0, "Mark adjacent clusters")
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/display/GPUDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ void GPUDisplay::DrawGLScene_internal(float animateTime, bool renderToMixBuffer)
bool showTimer = false;
bool doScreenshot = (mRequestScreenshot || mAnimateScreenshot) && animateTime < 0;

updateOptions();
if (animateTime < 0 && (mUpdateEventData || mResetScene || mUpdateVertexLists) && mIOPtrs) {
disableUnsupportedOptions();
}
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/display/GPUDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class GPUDisplay : public GPUDisplayInterface
void DrawGLScene_drawCommands();
int32_t InitDisplay_internal();
int32_t getNumThreads();
void updateOptions();
void disableUnsupportedOptions();
int32_t buildTrackFilter();
const GPUTPCTracker& sliceTracker(int32_t iSlice);
Expand Down
7 changes: 5 additions & 2 deletions GPU/GPUTracking/display/frontend/GPUDisplayKeys.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const char* HelpText[] = {
"[L] / [K] Draw single collisions (next / previous)",
"[C] Colorcode clusters of different collisions",
"[v] Hide rejected clusters from tracks",
"[j] Show global tracks as additional segments of final tracks",
"[j] Show tracks segments propagated to adjacent sector in different color / splt CE tracks",
"[u] Cycle through track filter",
"[E] / [G] Extrapolate tracks / loopers",
"[t] / [T] Take Screenshot / Record Animation to pictures",
Expand Down Expand Up @@ -164,8 +164,11 @@ void GPUDisplay::HandleKey(uint8_t key)
mPrintInfoText &= 3;
SetInfo("Info text display - console: %s, onscreen %s", (mPrintInfoText & 2) ? "enabled" : "disabled", (mPrintInfoText & 1) ? "enabled" : "disabled");
} else if (key == 'j') {
if (mCfgH.separateGlobalTracks) {
mCfgH.splitCETracks ^= 1;
}
mCfgH.separateGlobalTracks ^= 1;
SetInfo("Seperated display of global tracks %s", mCfgH.separateGlobalTracks ? "enabled" : "disabled");
SetInfo("Seperated display of tracks propagated to adjacent sectors %s / of CE tracks %s", mCfgH.separateGlobalTracks ? "enabled" : "disabled", mCfgH.splitCETracks ? "enabled" : "disabled");
} else if (key == 'c') {
if (mCfgH.markClusters == 0) {
mCfgH.markClusters = 1;
Expand Down
7 changes: 7 additions & 0 deletions GPU/GPUTracking/display/helpers/GPUDisplayHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ int32_t GPUDisplay::getNumThreads()
}
}

void GPUDisplay::updateOptions()
{
if (mCfgH.splitCETracks == -1 && mParam) {
mCfgH.splitCETracks = mParam->continuousMaxTimeBin != 0;
}
}

void GPUDisplay::disableUnsupportedOptions()
{
if (!mIOPtrs->mergedTrackHitAttachment) {
Expand Down
33 changes: 20 additions & 13 deletions GPU/GPUTracking/display/render/GPUDisplayDraw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
using namespace GPUCA_NAMESPACE::gpu;

#define GET_CID(slice, i) (mParam->par.earlyTpcTransform ? mIOPtrs->clusterData[slice][i].id : (mIOPtrs->clustersNative->clusterOffset[slice][0] + i))
#define SEPERATE_GLOBAL_TRACKS_LIMIT (mCfgH.separateGlobalTracks ? tGLOBALTRACK : TRACK_TYPE_ID_LIMIT)

const GPUTRDGeometry* GPUDisplay::trdGeometry() { return (GPUTRDGeometry*)mCalib->trdGeometry; }
const GPUTPCTracker& GPUDisplay::sliceTracker(int32_t iSlice) { return mChain->GetTPCSliceTrackers()[iSlice]; }
Expand Down Expand Up @@ -421,6 +420,8 @@ void GPUDisplay::DrawFinal(int32_t iSlice, int32_t /*iCol*/, GPUTPCGMPropagator*
}

// Print TPC part of track
int32_t separateGlobalTracksLimit = (mCfgH.separateGlobalTracks ? tGLOBALTRACK : TRACK_TYPE_ID_LIMIT);
uint32_t lastSide = -1;
for (int32_t k = 0; k < nClusters; k++) {
if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
if (mCfgH.hideRejectedClusters && (mIOPtrs->mergedTrackHits[track->FirstClusterRef() + k].state & GPUTPCGMMergedTrackHit::flagReject)) {
Expand All @@ -435,31 +436,37 @@ void GPUDisplay::DrawFinal(int32_t iSlice, int32_t /*iCol*/, GPUTPCGMPropagator*
}
int32_t w = mGlobalPos[cid].w;
if (drawing) {
drawPointLinestrip(iSlice, cid, tFINALTRACK, SEPERATE_GLOBAL_TRACKS_LIMIT);
if (mCfgH.splitCETracks && lastSide != (mGlobalPos[cid].z < 0)) {
insertVertexList(vBuf[0], startCountInner, mVertexBuffer[iSlice].size());
drawing = false;
lastCluster = -1;
} else {
drawPointLinestrip(iSlice, cid, tFINALTRACK, separateGlobalTracksLimit);
}
}
if (w == SEPERATE_GLOBAL_TRACKS_LIMIT) {
if (w == separateGlobalTracksLimit) {
if (drawing) {
insertVertexList(vBuf[0], startCountInner, mVertexBuffer[iSlice].size());
}
drawing = false;
} else {
if (!drawing) {
startCountInner = mVertexBuffer[iSlice].size();
}
if (!drawing) {
drawPointLinestrip(iSlice, cid, tFINALTRACK, SEPERATE_GLOBAL_TRACKS_LIMIT);
}
if (!drawing && lastCluster != -1) {
if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
cid = mIOPtrs->mergedTrackHits[track->FirstClusterRef() + lastCluster].num;
} else {
cid = &track->getCluster(mIOPtrs->outputClusRefsTPCO2, lastCluster, *mIOPtrs->clustersNative) - mIOPtrs->clustersNative->clustersLinear;
if (lastCluster != -1 && (!mCfgH.splitCETracks || lastSide == (mGlobalPos[cid].z < 0))) {
int32_t lastcid;
if constexpr (std::is_same_v<T, GPUTPCGMMergedTrack>) {
lastcid = mIOPtrs->mergedTrackHits[track->FirstClusterRef() + lastCluster].num;
} else {
lastcid = &track->getCluster(mIOPtrs->outputClusRefsTPCO2, lastCluster, *mIOPtrs->clustersNative) - mIOPtrs->clustersNative->clustersLinear;
}
drawPointLinestrip(iSlice, lastcid, tFINALTRACK, separateGlobalTracksLimit);
}
drawPointLinestrip(iSlice, cid, 7, SEPERATE_GLOBAL_TRACKS_LIMIT);
drawPointLinestrip(iSlice, cid, tFINALTRACK, separateGlobalTracksLimit);
}
drawing = true;
}
lastCluster = k;
lastSide = mGlobalPos[cid].z < 0;
}

// Print ITS part of track
Expand Down

0 comments on commit 1901f38

Please sign in to comment.