Skip to content

Commit

Permalink
TimeSlotCalibration creates output directory if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Oct 25, 2023
1 parent c0c1787 commit 15da471
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,16 @@ bool TimeSlotCalibration<Container>::saveLastSlot()
if (!updateSaveMetaData()) {
return false;
}

if (!mSaveDirectory.empty() && !std::filesystem::exists(mSaveDirectory)) {
std::filesystem::create_directories(mSaveDirectory);
if (!std::filesystem::exists(mSaveDirectory)) {
LOGP(fatal, "could not create output directory {}", mSaveDirectory);
} else {
LOGP(info, "created calibration directory {}", mSaveDirectory);
}
}

auto pth = getSaveFilePath();
auto pthTmp = pth + ".part";
TFile flout(pthTmp.c_str(), "recreate");
Expand Down

0 comments on commit 15da471

Please sign in to comment.