Skip to content

Commit aecee1b

Browse files
shahor02wiechula
authored andcommitted
Do not store failed laser calib, ignore in VDriftHelper
1 parent d27cf26 commit aecee1b

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

DataFormats/Detectors/TPC/include/DataFormatsTPC/LtrCalibData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ struct LtrCalibData {
4343
std::vector<uint16_t> nTrackTF; ///< number of laser tracks per TF
4444
std::vector<float> dEdx; ///< dE/dx of each track
4545

46+
bool isValid() const
47+
{
48+
return (std::abs(dvCorrectionA - 1.f) < 0.2) || (std::abs(dvCorrectionC - 1.f) < 0.2);
49+
}
50+
4651
float getDriftVCorrection() const
4752
{
4853
float correction = 0;

Detectors/TPC/calibration/src/VDriftHelper.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ void VDriftHelper::accountLaserCalibration(const LtrCalibData* calib, long fallB
5757
if (!calib || mForceParamDrift) { // laser may set only DriftParam (the offset is 0)
5858
return;
5959
}
60+
if (!calib->isValid()) {
61+
LOGP(warn, "Ignoring invalid laser calibration (corrections: A-side={}, C-side={}, NTracks: A-side={} C-side={})", calib->dvCorrectionA, calib->dvCorrectionC, calib->nTracksA, calib->nTracksC);
62+
return;
63+
}
6064
// old entries of laser calib have no update time assigned
6165
long updateTS = calib->creationTime > 0 ? calib->creationTime : fallBackTimeStamp;
6266
LOG(info) << "accountLaserCalibration " << calib->refVDrift << " / " << calib->getDriftVCorrection() << " t " << updateTS << " vs " << mVDLaser.creationTime;

Detectors/TPC/workflow/include/TPCWorkflow/CalibLaserTracksSpec.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ class CalibLaserTracksDevice : public o2::framework::Task
121121

122122
using clbUtils = o2::calibration::Utils;
123123
auto ltrCalib = mCalib.getCalibData();
124+
if (!ltrCalib.isValid()) {
125+
LOGP(error, "Invalid Laser calibration (corrections: A-side={}, C-side={}, NTracks: A-side={} C-side={}), will NOT upload to CCDB", ltrCalib.dvCorrectionA, ltrCalib.dvCorrectionC, ltrCalib.nTracksA, ltrCalib.nTracksC);
126+
return;
127+
}
124128

125129
if (mNormalize) {
126130
ltrCalib.normalize(0.);
127131
LOGP(info, "After normalization: correction factors: {} / {} for A- / C-Side, reference: {}, vdrift correction: {}", ltrCalib.dvCorrectionA, ltrCalib.dvCorrectionC, ltrCalib.refVDrift, ltrCalib.getDriftVCorrection());
128132
}
129-
if (ltrCalib.getDriftVCorrection() == 0) {
130-
LOG(error) << "Extracted drift correction is 0, something is wrong, will not upload the object";
131-
return;
132-
}
133133

134134
o2::ccdb::CcdbObjectInfo w;
135135
auto image = o2::ccdb::CcdbApi::createObjectImage(&ltrCalib, &w);

Detectors/TPC/workflow/include/TPCWorkflow/LaserTracksCalibratorSpec.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ class LaserTracksCalibratorDevice : public o2::framework::Task
8888
const long timeEnd = o2::ccdb::CcdbObjectInfo::INFINITE_TIMESTAMP;
8989
for (uint32_t iCalib = 0; iCalib < calibrations.size(); ++iCalib) {
9090
const auto& object = calibrations[iCalib];
91+
if (!object.isValid()) {
92+
LOGP(error, "Invalid Laser calibration (corrections: A-side={}, C-side={}, NTracks: A-side={} C-side={}), will NOT upload to CCDB", object.dvCorrectionA, object.dvCorrectionC, object.nTracksA, object.nTracksC);
93+
continue;
94+
}
9195
o2::ccdb::CcdbObjectInfo w;
9296
auto image = o2::ccdb::CcdbApi::createObjectImage(&object, &w);
9397

0 commit comments

Comments
 (0)