diff --git a/Detectors/TPC/calibration/include/TPCCalibration/CalibratordEdx.h b/Detectors/TPC/calibration/include/TPCCalibration/CalibratordEdx.h index 95c753f2ea27a..1c6f94846b339 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/CalibratordEdx.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/CalibratordEdx.h @@ -40,6 +40,7 @@ class CalibratordEdx final : public o2::calibration::TimeSlotCalibration; using TFinterval = std::vector>; + using TimeInterval = std::vector>; using CalibVector = std::vector; public: @@ -76,8 +77,11 @@ class CalibratordEdx final : public o2::calibration::TimeSlotCalibration mElectronCut{}; ///< Values passed to CalibdEdx::setElectronCut TrackCuts mCuts; ///< Cut object - TFinterval mIntervals; ///< start and end time frames of each calibration time slots - CalibVector mCalibs; ///< vector of MIP positions, each element is filled in "process" when we finalize one slot (multiple can be finalized during the same "process", which is why we have a vector. Each element is to be considered the output of the device + TFinterval mTFIntervals; ///< start and end time frame IDs of each calibration time slots + TimeInterval mTimeIntervals; ///< start and end times of each calibration time slots + CalibVector mCalibs; ///< vector of MIP positions, each element is filled in "process" when we finalize one slot (multiple can be finalized during the same "process", which is why we have a vector. Each element is to be considered the output of the device std::unique_ptr mDebugOutputStreamer; ///< Debug output streamer diff --git a/Detectors/TPC/calibration/src/CalibratordEdx.cxx b/Detectors/TPC/calibration/src/CalibratordEdx.cxx index 2e399c40a3d86..3dd8aa7a81083 100644 --- a/Detectors/TPC/calibration/src/CalibratordEdx.cxx +++ b/Detectors/TPC/calibration/src/CalibratordEdx.cxx @@ -27,7 +27,8 @@ using namespace o2::tpc; void CalibratordEdx::initOutput() { // Here we initialize the vector of our output objects - mIntervals.clear(); + mTFIntervals.clear(); + mTimeIntervals.clear(); mCalibs.clear(); } @@ -43,14 +44,20 @@ void CalibratordEdx::finalizeSlot(Slot& slot) TFType startTF = slot.getTFStart(); TFType endTF = slot.getTFEnd(); - mIntervals.emplace_back(startTF, endTF); + auto startTime = slot.getStartTimeMS(); + auto endTime = slot.getEndTimeMS(); + + mTFIntervals.emplace_back(startTF, endTF); + mTimeIntervals.emplace_back(startTime, endTime); if (mDebugOutputStreamer) { LOGP(info, "Dumping time slot data to file"); auto calibCopy = container->getCalib(); *mDebugOutputStreamer << "CalibdEdx" - << "startTF=" << startTF // Initial time frame of time slot - << "endTF=" << endTF // Final time frame of time slot + << "startTF=" << startTF // Initial time frame ID of time slot + << "endTF=" << endTF // Final time frame ID of time slot + << "startTime=" << startTime // Initial time frame time of time slot + << "endTime=" << endTime // Final time frame time of time slot << "correction=" << calibCopy // dE/dx corretion << "\n"; } diff --git a/Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx b/Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx index 92c349665e1c5..3b255d0511205 100644 --- a/Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx +++ b/Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx @@ -120,8 +120,7 @@ class CalibratordEdxDevice : public Task void sendOutput(DataAllocator& output) { const auto& calibrations = mCalibrator->getCalibs(); - auto& intervals = mCalibrator->getTFinterval(); - const long timeEnd = o2::ccdb::CcdbObjectInfo::INFINITE_TIMESTAMP; + const auto& intervals = mCalibrator->getTimeIntervals(); for (unsigned int i = 0; i < calibrations.size(); i++) { const auto& object = calibrations[i]; @@ -131,7 +130,7 @@ class CalibratordEdxDevice : public Task info.setPath("TPC/Calib/dEdx"); // FIXME: use time frame timestamp info.setStartValidityTimestamp(intervals[i].first); - info.setEndValidityTimestamp(timeEnd); + info.setEndValidityTimestamp(intervals[i].second + 5); // Add 5ms for safety auto md = info.getMetaData(); md["runNumber"] = std::to_string(mRunNumber);