Skip to content

Commit b9b969c

Browse files
committed
GPU TPC: Add option to apply timebin cut to CTF cluster decoding CPU-only version
1 parent 08d1760 commit b9b969c

File tree

12 files changed

+33
-9
lines changed

12 files changed

+33
-9
lines changed

GPU/GPUTracking/Base/GPUParam.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void GPUParam::SetDefaults(float solenoidBz)
120120
par.toyMCEventsFlag = false;
121121
par.continuousTracking = false;
122122
continuousMaxTimeBin = 0;
123+
tpcCutTimeBin = 0;
123124
par.debugLevel = 0;
124125
par.earlyTpcTransform = false;
125126
}
@@ -132,6 +133,7 @@ void GPUParam::UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessi
132133
par.toyMCEventsFlag = g->homemadeEvents;
133134
par.continuousTracking = g->grpContinuousMaxTimeBin != 0;
134135
continuousMaxTimeBin = g->grpContinuousMaxTimeBin == -1 ? GPUSettings::TPC_MAX_TF_TIME_BIN : g->grpContinuousMaxTimeBin;
136+
tpcCutTimeBin = g->tpcCutTimeBin;
135137
}
136138
par.earlyTpcTransform = rec.tpc.forceEarlyTransform == -1 ? (!par.continuousTracking) : rec.tpc.forceEarlyTransform;
137139
qptB5Scaler = CAMath::Abs(bzkG) > 0.1f ? CAMath::Abs(bzkG) / 5.006680f : 1.f; // Repeat here, since passing in g is optional

GPU/GPUTracking/Base/GPUParam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct GPUParam_t {
5959

6060
int8_t dodEdxDownscaled;
6161
int32_t continuousMaxTimeBin;
62+
int32_t tpcCutTimeBin;
6263

6364
GPUTPCGeometry tpcGeometry; // TPC Geometry
6465
GPUTPCGMPolynomialField polynomialField; // Polynomial approx. of magnetic field for TPC GM

GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ void GPUNewCalibValues::updateFrom(const GPUNewCalibValues* from)
2424
if (from->newContinuousMaxTimeBin) {
2525
continuousMaxTimeBin = from->continuousMaxTimeBin;
2626
}
27+
if (from->newTPCTimeBinCut) {
28+
tpcTimeBinCut = from->tpcTimeBinCut;
29+
}
2730
}

GPU/GPUTracking/DataTypes/GPUNewCalibValues.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ namespace gpu
2525
struct GPUNewCalibValues {
2626
bool newSolenoidField = false;
2727
bool newContinuousMaxTimeBin = false;
28+
bool newTPCTimeBinCut = false;
2829
float solenoidField = 0.f;
2930
uint32_t continuousMaxTimeBin = 0;
31+
int32_t tpcTimeBinCut = 0;
3032

3133
void updateFrom(const GPUNewCalibValues* from);
3234
};

GPU/GPUTracking/DataTypes/GPUSettings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct GPUSettingsGRP {
6060
int32_t grpContinuousMaxTimeBin = -2; // 0 for triggered events, -1 for automatic setting, -2 invalid default
6161
int32_t needsClusterer = 0; // Set to true if the data requires the clusterizer
6262
int32_t doCompClusterDecode = 0; // Set to true if the data contains compressed TPC clusters
63+
int32_t tpcCutTimeBin = 0; // Cut TPC clusters and digits >= this cut
6364
};
6465

6566
// Parameters of the current time frame

GPU/GPUTracking/Global/GPUChainTracking.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,9 @@ int32_t GPUChainTracking::DoQueuedUpdates(int32_t stream, bool updateSlave)
641641
if (mNewCalibValues->newContinuousMaxTimeBin) {
642642
grp->grpContinuousMaxTimeBin = mNewCalibValues->continuousMaxTimeBin;
643643
}
644+
if (mNewCalibValues->newTPCTimeBinCut) {
645+
grp->tpcCutTimeBin = mNewCalibValues->tpcTimeBinCut;
646+
}
644647
}
645648
}
646649
if (GetProcessingSettings().tpcDownscaledEdx != 0) {

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "GPUO2DataTypes.h"
1919
#include "GPUMemorySizeScalers.h"
2020
#include "GPUTrackingInputProvider.h"
21+
#include "GPUNewCalibValues.h"
2122
#include <fstream>
2223

2324
#ifdef GPUCA_O2_LIB

GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,15 @@ int32_t GPUChainTracking::RunTPCDecompression()
219219
return ((tmpBuffer = std::make_unique<ClusterNative[]>(size))).get();
220220
};
221221
auto& decompressTimer = getTimer<TPCClusterDecompressor>("TPCDecompression", 0);
222-
auto allocatorUse = GetProcessingSettings().tpcApplyCFCutsAtDecoding ? std::function<ClusterNative*(size_t)>{allocatorTmp} : std::function<ClusterNative*(size_t)>{allocatorFinal};
222+
bool runFiltering = GetProcessingSettings().tpcApplyCFCutsAtDecoding;
223+
auto allocatorUse = runFiltering ? std::function<ClusterNative*(size_t)>{allocatorTmp} : std::function<ClusterNative*(size_t)>{allocatorFinal};
223224
decompressTimer.Start();
224225
if (decomp.decompress(mIOPtrs.tpcCompressedClusters, *mClusterNativeAccess, allocatorUse, param(), GetProcessingSettings().deterministicGPUReconstruction)) {
225226
GPUError("Error decompressing clusters");
226227
return 1;
227228
}
228-
if (GetProcessingSettings().tpcApplyCFCutsAtDecoding) {
229-
RunTPCClusterFilter(mClusterNativeAccess.get(), allocatorFinal, true);
229+
if (runFiltering) {
230+
RunTPCClusterFilter(mClusterNativeAccess.get(), allocatorFinal, GetProcessingSettings().tpcApplyCFCutsAtDecoding);
230231
}
231232
decompressTimer.Stop();
232233
mIOPtrs.clustersNative = mClusterNativeAccess.get();

GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ void GPUChainTracking::RunTPCClusterFilter(o2::tpc::ClusterNativeAccess* cluster
315315
keep = keep && cl.qTot > param().rec.tpc.cfQTotCutoff && cl.qMax > param().rec.tpc.cfQMaxCutoff;
316316
keep = keep && (!(cl.getFlags() & o2::tpc::ClusterNative::flagSingle) || ((cl.sigmaPadPacked || cl.qMax > param().rec.tpc.cfQMaxCutoffSinglePad) && (cl.sigmaTimePacked || cl.qMax > param().rec.tpc.cfQMaxCutoffSingleTime)));
317317
}
318+
if (param().tpcCutTimeBin > 0) {
319+
keep = keep && cl.getTime() < param().tpcCutTimeBin;
320+
}
318321
keep = keep && (!GetProcessingSettings().tpcApplyDebugClusterFilter || clusterFilter.filter(iSector, iRow, cl));
319322
if (iPhase && keep) {
320323
outputBuffer[countTotal] = cl;

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ class GPURecoWorkflowSpec : public o2::framework::Task
233233
bool mITSGeometryCreated = false;
234234
bool mTRDGeometryCreated = false;
235235
bool mPropagatorInstanceCreated = false;
236+
int32_t mTPCCutAtTimeBin = -1;
236237
};
237238

238239
} // end namespace gpu

0 commit comments

Comments
 (0)