13 #include <framework/utilities/RootFileCreationManager.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/core/MetadataService.h>
20 void TFile_Deleter(TFile* file)
22 B2DEBUG(30,
"Closing ROOT file");
38 std::shared_ptr<TFile> ptr =
m_files[fileName].lock();
43 TDirectory::TContext gDirectoryGuard;
45 ptr = std::shared_ptr<TFile>(TFile::Open(fileName.c_str(),
"RECREATE"), TFile_Deleter);
47 if (!ptr || !ptr->IsOpen()) {
48 if (!ignoreErrors) B2ERROR(
"Could not create file " << std::quoted(fileName));