Skip to content

Commit 6c6d69f

Browse files
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
1 parent aca5f47 commit 6c6d69f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Detectors/TPC/calibration/src/VDriftHelper.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ 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+
LOGP(info, "Do not rescale VDrift {}, T/P change is small: {} -> {}", vd.getVDrift(), vd.refTP, tp);
170+
return;
171+
}
167172
mUpdated = true;
168173
vd.normalize(0, tp);
169174
if (vd.creationTime == saveVD.creationTime) {
@@ -245,6 +250,11 @@ bool VDriftHelper::extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS)
245250
const int64_t tsStart = vdrift.firstTime;
246251
const int64_t tsEnd = vdrift.lastTime;
247252

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

0 commit comments

Comments
 (0)