Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Detectors/TPC/calibration/src/VDriftHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ 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) {
return;
}
mUpdated = true;
vd.normalize(0, tp);
if (vd.creationTime == saveVD.creationTime) {
Expand Down Expand Up @@ -245,6 +249,15 @@ bool VDriftHelper::extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS)
const int64_t tsStart = vdrift.firstTime;
const int64_t tsEnd = vdrift.lastTime;

if (tsStart == tsEnd) {
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;
}

// make sanity check of the time range
const auto [minValidTime, maxValidTime] = mPTHelper.getMinMaxTime();
const int64_t minTimeAccepted = static_cast<int64_t>(minValidTime) - 20 * o2::ccdb::CcdbObjectInfo::MINUTE;
Expand Down