15#include <FairParRootFileIo.h>
16#include <FairRuntimeDb.h>
19#include <fmt/format.h>
27 FairParRootFileIo* parFileIO =
dynamic_cast<FairParRootFileIo*
>(FairRuntimeDb::instance()->getOutput()))
28 : file_io_{ parFileIO }
29 , old_dir_{ gDirectory }
31 if (file_io_ ==
nullptr)
35 par_root_file_ = parFileIO->getParRootFile();
37 if (!par_root_file_->IsOpen() || !par_root_file_->IsWritable())
49 auto mkdir(std::string_view dir_name) ->
auto*
51 if (par_root_file_->IsZombie())
54 fmt::format(
"File {} is not closed properly! Please delete it and create a new one!",
55 par_root_file_->GetName()));
62 if (not gDirectory->IsWritable())
64 throw R3B::runtime_error(fmt::format(
"Directory {} is not writable currently!", gDirectory->GetName()));
82 R3BLOG(info, fmt::format(R
"("Creating a directory "{}" in "{}"")", dir_name, gDirectory->GetName()));
83 auto* new_dir = gDirectory->mkdir(dir_name.data(), dir_name.data(),
true);
84 if (new_dir ==
nullptr)
92 FairParRootFileIo* file_io_ =
nullptr;
93 FairParRootFile* par_root_file_ =
nullptr;
94 TDirectory* old_dir_ =
nullptr;
#define R3BLOG(severity, x)
ParDirCreator(const ParDirCreator &)=delete
auto operator=(ParDirCreator &&) -> ParDirCreator &=delete
auto mkdir(std::string_view dir_name) -> auto *
ParDirCreator(ParDirCreator &&)=delete
auto operator=(const ParDirCreator &) -> ParDirCreator &=delete
ParDirCreator(FairParRootFileIo *parFileIO=dynamic_cast< FairParRootFileIo * >(FairRuntimeDb::instance() ->getOutput()))
~ParDirCreator() noexcept
Simulation of NeuLAND Bar/Paddle.