7 #include "cetlib_except/exception.h" 12 std::string
const& descr,
14 std::string
const& path)
23 for (
auto f : pr.second) {
43 "A TFileService error occured while attempting to make a " 44 "directory or ROOT object.\n"}
45 <<
"File-switching has been enabled for TFileService. All modules " 47 <<
"a callback function to be invoked whenever a file switch occurs. " 49 <<
"must ensure that any pointers to ROOT objects have been " 51 <<
" No callback has been registered for module '" << fpath <<
"'.\n\n" 52 <<
"Contact artists@fnal.gov for guidance.";
56 TDirectory*
dir =
file_->GetDirectory(fpath.c_str());
62 <<
"Can't change directory to path: " <<
path_;
67 dir = dir->mkdir(
dir_.c_str(),
descr_.c_str());
70 <<
"Can't create directory " <<
dir_ <<
" in path: " <<
path_;
73 if (!
file_->cd(fpath.c_str())) {
75 <<
"Can't change directory to path: " << fpath;
std::function< void()> Callback_t
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
void registerCallback(Callback_t)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string fullPath() const
std::map< std::string, std::vector< Callback_t > > callbacks_
cet::coded_exception< error, detail::translate > exception
TFileDirectory(std::string const &dir, std::string const &descr, TFile *file, std::string const &path)
Create a new TFileDirectory object.