Skip to content

Commit 6c5bbfb

Browse files
TPC: Apply T/P scaling of VDrift only if T/P change is large enough (#14668)
* 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 * remove info message and print warning only once
1 parent f72e1a2 commit 6c5bbfb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Detectors/TPC/calibration/src/VDriftHelper.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its
164164
mIsTPScalingPossible = (vd.refTP > 0) || extractTPForVDrift(vd);
165165
}
166166
if (mIsTPScalingPossible) {
167+
// if no new VDrift object was loaded and if delta TP is small, do not rescale and return
168+
if (!mUpdated && std::abs(tp - vd.refTP) < 1e-5) {
169+
return;
170+
}
167171
mUpdated = true;
168172
vd.normalize(0, tp);
169173
if (vd.creationTime == saveVD.creationTime) {
@@ -245,6 +249,15 @@ bool VDriftHelper::extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS)
245249
const int64_t tsStart = vdrift.firstTime;
246250
const int64_t tsEnd = vdrift.lastTime;
247251

252+
if (tsStart == tsEnd) {
253+
static bool warned = false;
254+
if (!warned) {
255+
warned = true;
256+
LOGP(warn, "VDriftHelper: Cannot extract T/P for VDrift with identical start/end time {}!", tsStart);
257+
}
258+
return false;
259+
}
260+
248261
// make sanity check of the time range
249262
const auto [minValidTime, maxValidTime] = mPTHelper.getMinMaxTime();
250263
const int64_t minTimeAccepted = static_cast<int64_t>(minValidTime) - 20 * o2::ccdb::CcdbObjectInfo::MINUTE;

0 commit comments

Comments
 (0)