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 @@ -40,6 +40,7 @@ class CalibratordEdx final : public o2::calibration::TimeSlotCalibration<o2::tpc
using TFType = o2::calibration::TFType;
using Slot = o2::calibration::TimeSlot<CalibdEdx>;
using TFinterval = std::vector<std::pair<TFType, TFType>>;
using TimeInterval = std::vector<std::pair<long, long>>;
using CalibVector = std::vector<CalibdEdxCorrection>;

public:
Expand Down Expand Up @@ -76,8 +77,11 @@ class CalibratordEdx final : public o2::calibration::TimeSlotCalibration<o2::tpc
/// \return the computed calibrations
const CalibVector& getCalibs() const { return mCalibs; }

/// \return CCDB output informations
const TFinterval& getTFinterval() const { return mIntervals; }
/// \return Time frame ID information
const TFinterval& getTFinterval() const { return mTFIntervals; }

/// \return Time frame time information
const TimeInterval& getTimeIntervals() const { return mTimeIntervals; }

/// Enable debug output to file of the time slots calibrations outputs and dE/dx histograms
void enableDebugOutput(std::string_view fileName);
Expand All @@ -104,8 +108,9 @@ class CalibratordEdx final : public o2::calibration::TimeSlotCalibration<o2::tpc
std::pair<float, int> 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<o2::utils::TreeStreamRedirector> mDebugOutputStreamer; ///< Debug output streamer

Expand Down
15 changes: 11 additions & 4 deletions Detectors/TPC/calibration/src/CalibratordEdx.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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";
}
Expand Down
5 changes: 2 additions & 3 deletions Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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);
Expand Down