Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct TPCVDTglContainer {
}
driftVFullMean = (driftVFullMean * nTFProc + vfull) / (nTFProc + 1);
if (tOffsetRef == 0.f) {
tOffsetRef = data[0].first; // assign 1st full toffset as a reference
tOffsetRef = data[1].first; // assign 1st full toffset as a reference
}
nTFProc++;
}
Expand Down
21 changes: 15 additions & 6 deletions Detectors/TPC/calibration/src/VDriftHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void VDriftHelper::accountLaserCalibration(const LtrCalibData* calib, long fallB
mVDLaser.refVDrift = ref;
mVDLaser.corrFact = 1. / corr;
mVDLaser.creationTime = calib->creationTime;
mVDLaser.refTimeOffset = calib->refTimeOffset;
mUpdated = true;
mSource = Source::Laser;
if (mMayRenormSrc & (0x1U << Source::Laser)) { // this was 1st setting?
Expand All @@ -79,7 +80,7 @@ void VDriftHelper::accountLaserCalibration(const LtrCalibData* calib, long fallB
mMayRenormSrc &= ~(0x1U << Source::Laser); // unset MayRenorm
} else if (ref != prevRef) { // we want to keep the same reference over the run, this may happen if run-time laser calibration is supplied
LOGP(warn, "VDriftHelper: renorming updated TPC refVDrift={}/correction={} previous refVDrift {}, source: {}", mVDLaser.refVDrift, mVDLaser.corrFact, prevRef, getSourceName(mSource));
mVDLaser.normalizeOffset(prevRef);
mVDLaser.normalize(prevRef);
}
}
}
Expand Down Expand Up @@ -134,6 +135,8 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its
// prefer among laser and tgl VDrift the one with the latest update time
auto saveVD = mVD;
mVD = mVDTPCITSTgl.creationTime < mVDLaser.creationTime ? mVDLaser : mVDTPCITSTgl;
auto& loserVD = mVDTPCITSTgl.creationTime < mVDLaser.creationTime ? mVDTPCITSTgl : mVDLaser;

if (mForceParamDrift) {
mVD.refVDrift = saveVD.refVDrift;
mVD.corrFact = saveVD.corrFact;
Expand All @@ -144,13 +147,19 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its
mVD.timeOffsetCorr = 0.f;
}
mSource = mVDTPCITSTgl.creationTime < mVDLaser.creationTime ? Source::Laser : Source::ITSTPCTgl;
LOGP(info, "Will prefer TPC Drift from {} with time {} to {} with time {}",
SourceNames[int(mSource)], mVD.creationTime,
mSource == Source::Laser ? SourceNames[int(Source::ITSTPCTgl)] : SourceNames[int(Source::Laser)],
mSource == Source::Laser ? mVDTPCITSTgl.creationTime : mVDLaser.creationTime);
auto loseCTime = loserVD.creationTime;
loserVD = mVD; // override alternative VD to avoid normalization problems later
std::string rep = fmt::format("Prefer TPC Drift from {} with time {} to {} with time {}",
SourceNames[int(mSource)], mVD.creationTime, mSource == Source::Laser ? SourceNames[int(Source::ITSTPCTgl)] : SourceNames[int(Source::Laser)],
mSource == Source::Laser ? mVDTPCITSTgl.creationTime : mVDLaser.creationTime);
if (mForceParamDrift || mForceParamOffset) {
LOGP(info, "but {} is imposed from the command line", mForceParamDrift ? "VDrift" : "DriftTimeOffset");
std::string impos = mForceParamDrift ? "VDrift" : "";
if (mForceParamOffset) {
impos += mForceParamDrift ? " and DriftTimeOffset" : "DriftTimeOffset";
}
rep += fmt::format(" but {} imposed from command line", impos);
}
LOGP(info, "{}", rep);
}
}

Expand Down