From 6c6d69f54639652b17a04d6747dac28d1f2993c0 Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Wed, 10 Sep 2025 13:01:03 +0200 Subject: [PATCH 1/2] TPC: Apply T/P scaling of VDrift only if T/P change is large enough - suppress error for getting reference T/P in case default VDrift is used --- Detectors/TPC/calibration/src/VDriftHelper.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Detectors/TPC/calibration/src/VDriftHelper.cxx b/Detectors/TPC/calibration/src/VDriftHelper.cxx index 2badf3bb510e8..e9a1591009085 100644 --- a/Detectors/TPC/calibration/src/VDriftHelper.cxx +++ b/Detectors/TPC/calibration/src/VDriftHelper.cxx @@ -164,6 +164,11 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its mIsTPScalingPossible = (vd.refTP > 0) || extractTPForVDrift(vd); } if (mIsTPScalingPossible) { + // if no new VDrift object was loaded and if delta TP is small, do not rescale and return + if (!mUpdated && std::abs(tp - vd.refTP) < 1e-5) { + LOGP(info, "Do not rescale VDrift {}, T/P change is small: {} -> {}", vd.getVDrift(), vd.refTP, tp); + return; + } mUpdated = true; vd.normalize(0, tp); if (vd.creationTime == saveVD.creationTime) { @@ -245,6 +250,11 @@ bool VDriftHelper::extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS) const int64_t tsStart = vdrift.firstTime; const int64_t tsEnd = vdrift.lastTime; + if (tsStart == tsEnd) { + LOGP(warn, "VDriftHelper: Cannot extract T/P for VDrift with identical start/end time {}!", tsStart); + return false; + } + // make sanity check of the time range const auto [minValidTime, maxValidTime] = mPTHelper.getMinMaxTime(); const int64_t minTimeAccepted = static_cast(minValidTime) - 20 * o2::ccdb::CcdbObjectInfo::MINUTE; From b4f5e431c1a4aa153b432fd3ad518ebc90ae921e Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Thu, 11 Sep 2025 12:47:56 +0200 Subject: [PATCH 2/2] remove info message and print warning only once --- Detectors/TPC/calibration/src/VDriftHelper.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Detectors/TPC/calibration/src/VDriftHelper.cxx b/Detectors/TPC/calibration/src/VDriftHelper.cxx index e9a1591009085..71c4e50a63fcf 100644 --- a/Detectors/TPC/calibration/src/VDriftHelper.cxx +++ b/Detectors/TPC/calibration/src/VDriftHelper.cxx @@ -166,7 +166,6 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its if (mIsTPScalingPossible) { // if no new VDrift object was loaded and if delta TP is small, do not rescale and return if (!mUpdated && std::abs(tp - vd.refTP) < 1e-5) { - LOGP(info, "Do not rescale VDrift {}, T/P change is small: {} -> {}", vd.getVDrift(), vd.refTP, tp); return; } mUpdated = true; @@ -251,7 +250,11 @@ bool VDriftHelper::extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS) const int64_t tsEnd = vdrift.lastTime; if (tsStart == tsEnd) { - LOGP(warn, "VDriftHelper: Cannot extract T/P for VDrift with identical start/end time {}!", tsStart); + static bool warned = false; + if (!warned) { + warned = true; + LOGP(warn, "VDriftHelper: Cannot extract T/P for VDrift with identical start/end time {}!", tsStart); + } return false; }