diff --git a/GPU/GPUTracking/Base/GPUParam.cxx b/GPU/GPUTracking/Base/GPUParam.cxx index 17fcf6d2c9a72..1b67cbd26d45c 100644 --- a/GPU/GPUTracking/Base/GPUParam.cxx +++ b/GPU/GPUTracking/Base/GPUParam.cxx @@ -120,6 +120,7 @@ void GPUParam::SetDefaults(float solenoidBz) par.toyMCEventsFlag = false; par.continuousTracking = false; continuousMaxTimeBin = 0; + tpcCutTimeBin = 0; par.debugLevel = 0; par.earlyTpcTransform = false; } @@ -132,6 +133,7 @@ void GPUParam::UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessi par.toyMCEventsFlag = g->homemadeEvents; par.continuousTracking = g->grpContinuousMaxTimeBin != 0; continuousMaxTimeBin = g->grpContinuousMaxTimeBin == -1 ? GPUSettings::TPC_MAX_TF_TIME_BIN : g->grpContinuousMaxTimeBin; + tpcCutTimeBin = g->tpcCutTimeBin; } par.earlyTpcTransform = rec.tpc.forceEarlyTransform == -1 ? (!par.continuousTracking) : rec.tpc.forceEarlyTransform; qptB5Scaler = CAMath::Abs(bzkG) > 0.1f ? CAMath::Abs(bzkG) / 5.006680f : 1.f; // Repeat here, since passing in g is optional diff --git a/GPU/GPUTracking/Base/GPUParam.h b/GPU/GPUTracking/Base/GPUParam.h index fd380c0a39593..ce9ac30b7c35b 100644 --- a/GPU/GPUTracking/Base/GPUParam.h +++ b/GPU/GPUTracking/Base/GPUParam.h @@ -59,6 +59,7 @@ struct GPUParam_t { int8_t dodEdxDownscaled; int32_t continuousMaxTimeBin; + int32_t tpcCutTimeBin; GPUTPCGeometry tpcGeometry; // TPC Geometry GPUTPCGMPolynomialField polynomialField; // Polynomial approx. of magnetic field for TPC GM diff --git a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx index f443809d15ef5..e86955d6da500 100644 --- a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx +++ b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx @@ -24,4 +24,7 @@ void GPUNewCalibValues::updateFrom(const GPUNewCalibValues* from) if (from->newContinuousMaxTimeBin) { continuousMaxTimeBin = from->continuousMaxTimeBin; } + if (from->newTPCTimeBinCut) { + tpcTimeBinCut = from->tpcTimeBinCut; + } } diff --git a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h index 802306e996553..5d5a31785928c 100644 --- a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h +++ b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h @@ -25,8 +25,10 @@ namespace gpu struct GPUNewCalibValues { bool newSolenoidField = false; bool newContinuousMaxTimeBin = false; + bool newTPCTimeBinCut = false; float solenoidField = 0.f; uint32_t continuousMaxTimeBin = 0; + int32_t tpcTimeBinCut = 0; void updateFrom(const GPUNewCalibValues* from); }; diff --git a/GPU/GPUTracking/DataTypes/GPUSettings.h b/GPU/GPUTracking/DataTypes/GPUSettings.h index 69bfb15e3f4b0..b967a7ce42620 100644 --- a/GPU/GPUTracking/DataTypes/GPUSettings.h +++ b/GPU/GPUTracking/DataTypes/GPUSettings.h @@ -60,6 +60,7 @@ struct GPUSettingsGRP { int32_t grpContinuousMaxTimeBin = -2; // 0 for triggered events, -1 for automatic setting, -2 invalid default int32_t needsClusterer = 0; // Set to true if the data requires the clusterizer int32_t doCompClusterDecode = 0; // Set to true if the data contains compressed TPC clusters + int32_t tpcCutTimeBin = 0; // Cut TPC clusters and digits >= this cut }; // Parameters of the current time frame diff --git a/GPU/GPUTracking/Global/GPUChainTracking.cxx b/GPU/GPUTracking/Global/GPUChainTracking.cxx index 8c2599604387b..abb44ec31ae22 100644 --- a/GPU/GPUTracking/Global/GPUChainTracking.cxx +++ b/GPU/GPUTracking/Global/GPUChainTracking.cxx @@ -641,7 +641,9 @@ int32_t GPUChainTracking::DoQueuedUpdates(int32_t stream, bool updateSlave) if (mNewCalibValues->newContinuousMaxTimeBin) { grp->grpContinuousMaxTimeBin = mNewCalibValues->continuousMaxTimeBin; } - } + if (mNewCalibValues->newTPCTimeBinCut) { + grp->tpcCutTimeBin = mNewCalibValues->tpcTimeBinCut; + } } if (GetProcessingSettings().tpcDownscaledEdx != 0) { p = &GetProcessingSettings(); diff --git a/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx b/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx index 98109447de034..46ef8bb23fcce 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx @@ -225,8 +225,8 @@ int32_t GPUChainTracking::RunTPCDecompression() GPUError("Error decompressing clusters"); return 1; } - if (GetProcessingSettings().tpcApplyCFCutsAtDecoding) { - RunTPCClusterFilter(mClusterNativeAccess.get(), allocatorFinal, true); + if (GetProcessingSettings().tpcApplyCFCutsAtDecoding || param().tpcCutTimeBin > 0) { + RunTPCClusterFilter(mClusterNativeAccess.get(), allocatorFinal, GetProcessingSettings().tpcApplyCFCutsAtDecoding); } decompressTimer.Stop(); mIOPtrs.clustersNative = mClusterNativeAccess.get(); diff --git a/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx b/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx index f8a64e9d4faaa..5cd86277245d1 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx @@ -315,6 +315,9 @@ void GPUChainTracking::RunTPCClusterFilter(o2::tpc::ClusterNativeAccess* cluster keep = keep && cl.qTot > param().rec.tpc.cfQTotCutoff && cl.qMax > param().rec.tpc.cfQMaxCutoff; keep = keep && (!(cl.getFlags() & o2::tpc::ClusterNative::flagSingle) || ((cl.sigmaPadPacked || cl.qMax > param().rec.tpc.cfQMaxCutoffSinglePad) && (cl.sigmaTimePacked || cl.qMax > param().rec.tpc.cfQMaxCutoffSingleTime))); } + if (param().tpcCutTimeBin > 0) { + keep = keep & cl.getTime() < param().tpcCutTimeBin; + } keep = keep && (!GetProcessingSettings().tpcApplyDebugClusterFilter || clusterFilter.filter(iSector, iRow, cl)); if (iPhase && keep) { outputBuffer[countTotal] = cl; diff --git a/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h b/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h index b218a21306a34..eda3b28c6cff6 100644 --- a/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h +++ b/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h @@ -233,6 +233,7 @@ class GPURecoWorkflowSpec : public o2::framework::Task bool mITSGeometryCreated = false; bool mTRDGeometryCreated = false; bool mPropagatorInstanceCreated = false; + int32_t mTPCCutAtTimeBin = -1; }; } // end namespace gpu diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 37ae734845667..06942eab476c6 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1013,9 +1013,8 @@ void GPURecoWorkflowSpec::doCalibUpdates(o2::framework::ProcessingContext& pc, c LOG(info) << "Updating solenoid field " << newCalibValues.solenoidField; } if (mAutoContinuousMaxTimeBin) { - mConfig->configGRP.grpContinuousMaxTimeBin = GPUO2InterfaceUtils::getTpcMaxTimeBinFromNHbf(mTFSettings->nHBFPerTF); newCalibValues.newContinuousMaxTimeBin = true; - newCalibValues.continuousMaxTimeBin = mConfig->configGRP.grpContinuousMaxTimeBin; + newCalibValues.continuousMaxTimeBin = mConfig->configGRP.grpContinuousMaxTimeBin = GPUO2InterfaceUtils::getTpcMaxTimeBinFromNHbf(mTFSettings->nHBFPerTF); LOG(info) << "Updating max time bin " << newCalibValues.continuousMaxTimeBin << " (" << mTFSettings->nHBFPerTF << " orbits)"; } @@ -1050,6 +1049,11 @@ void GPURecoWorkflowSpec::doCalibUpdates(o2::framework::ProcessingContext& pc, c if (mSpecConfig.runITSTracking) { needCalibUpdate = fetchCalibsCCDBITS(pc) || needCalibUpdate; } + if (mTPCCutAtTimeBin != mConfig->configGRP.tpcCutTimeBin) { + newCalibValues.newTPCTimeBinCut = true; + newCalibValues.tpcTimeBinCut = mConfig->configGRP.tpcCutTimeBin = mTPCCutAtTimeBin; + needCalibUpdate = true; + } if (needCalibUpdate) { LOG(info) << "Updating GPUReconstruction calibration objects"; mGPUReco->UpdateCalibration(newCalibObjects, newCalibValues); @@ -1098,6 +1102,7 @@ Inputs GPURecoWorkflowSpec::inputs() if (mSpecConfig.outputTracks || mSpecConfig.caClusterer) { // calibration objects for TPC clusterization inputs.emplace_back("tpcgain", gDataOriginTPC, "PADGAINFULL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalPadGainFull))); + inputs.emplace_back("tpcaltrosync", gDataOriginTPC, "ALTROSYNCSIGNAL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::AltroSyncSignal))); } if (mSpecConfig.outputTracks) { // calibration objects for TPC tracking diff --git a/GPU/Workflow/src/GPUWorkflowTPC.cxx b/GPU/Workflow/src/GPUWorkflowTPC.cxx index 97bf3aed26368..ae91716825271 100644 --- a/GPU/Workflow/src/GPUWorkflowTPC.cxx +++ b/GPU/Workflow/src/GPUWorkflowTPC.cxx @@ -308,6 +308,10 @@ bool GPURecoWorkflowSpec::fetchCalibsCCDBTPC(ProcessingCon pc.inputs().get*>("tpcgain"); } + if (mSpecConfig.outputTracks || mSpecConfig.caClusterer) { + mTPCCutAtTimeBin = pc.inputs().get*>("tpcaltrosync")->getTB2Cut(pc.services().get().tfCounter); + } + // these calibrations are only defined for the tracking if (mSpecConfig.outputTracks) { // update the calibration objects in case they changed in the CCDB