32 mTimeIntervals.clear();
43 container->
finalize(mMakeGaussianFits);
45 mCalibs.push_back(container->
getCalib());
52 mTFIntervals.emplace_back(startTF, endTF);
53 mTimeIntervals.emplace_back(startTime, endTime);
55 if (mDebugOutputStreamer) {
56 LOGP(info,
"Dumping time slot data to file");
57 auto calibCopy = container->
getCalib();
58 *mDebugOutputStreamer <<
"CalibdEdx"
59 <<
"startTF=" << startTF
61 <<
"startTime=" << startTime
62 <<
"endTime=" << endTime
63 <<
"correction=" << calibCopy
67 if (mDumpHistograms) {
68 const auto fileName = fmt::format(
"o2tpc_CalibratordEdx_Histos_{}_{}_{}_{}.root", startTime, endTime, startTF, endTF);
69 const auto dumpTHn = (mDumpHistograms & 0x1) == 0x1;
70 const auto dumpTree = (mDumpHistograms & 0x2) == 0x2;
75 auto f = std::make_unique<TFile>(fileName.data(), dumpTree ?
"update" :
"recreate");
77 hn->Write(
"calibHist");
86 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
88 auto container = std::make_unique<CalibdEdx>(mdEdxBins, mMindEdx, mMaxdEdx, mAngularBins, mFitSnp);
89 container->setApplyCuts(mApplyCuts);
90 container->setCuts(mCuts);
91 container->setSectorFitThreshold(mFitThreshold[0]);
92 container->set1DFitThreshold(mFitThreshold[1]);
93 container->set2DFitThreshold(mFitThreshold[2]);
94 const auto [cut, iterations, cutLowFactor] = mElectronCut;
95 container->setElectronCut(cut, iterations, cutLowFactor);
96 container->setMaterialType(mMatType);
97 if (mEnableTrackDebug) {
98 const auto fileName = fmt::format(
"o2tpc_CalibratordEdx_TrackDebug_{}_{}.root", tstart, tend);
99 container->enableDebugOutput(fileName);
102 slot.setContainer(std::move(container));
108 mDebugOutputStreamer = std::make_unique<o2::utils::TreeStreamRedirector>(fileName.data(),
"recreate");
114 mDebugOutputStreamer.reset();
119 if (mDebugOutputStreamer) {
120 LOGP(info,
"Closing dump file");
121 mDebugOutputStreamer->Close();
This file provides the container used for time based residual dE/dx calibration.
This file provides the time dependent dE/dx calibrator, tracking the MIP position over time.
Utils and constants for calibration and related workflows.
long getStartTimeMS() const
long getEndTimeMS() const
const Container * getContainer() const
TFType getTFStart() const
Class that creates dE/dx histograms from a sequence of tracks objects.
void finalize(const bool useGausFits=true)
THnF * getRootHist() const
Return calib data as a THn.
const CalibdEdxCorrection & getCalib() const
void finalizeDebugOutput() const
Write debug output to file.
void writeTTree(std::string_view fileName) const
Save the histograms to a TTree.
void initOutput() final
Empty the output vectors.
void disableDebugOutput()
Disable debug output to file. Also writes and closes stored time slots.
void finalizeDebugOutput() const
Write debug output to file.
void finalizeSlot(Slot &) final
Process time slot data and compute its calibration.
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
Creates new time slot.
void enableDebugOutput(std::string_view fileName)
Enable debug output to file of the time slots calibrations outputs and dE/dx histograms.
Global TPC definitions and constants.