35#include "tools/ntuple_booking"
48void G4Hdf5NtupleManager::CreateTNtuple(
55 auto ntupleFile = ntupleDescription->
GetFile();
57 ntupleFile = fFileManager->GetFile();
63 Warn(
"Cannot create ntuple. Ntuple file does not exist.",
64 fkClass,
"CreateTNtuple");
69 auto directory = std::get<2>(*ntupleFile);
70 auto basketSize = fFileManager->GetBasketSize();
71 auto compressionLevel = fFileManager->GetCompressionLevel();
77 newNtupleName.append(
"_v");
78 newNtupleName.append(std::to_string(
GetCycle()));
79 ntupleBooking.set_name(newNtupleName);
84 new toolx::hdf5::ntuple(
85 G4cout, directory, ntupleBooking, compressionLevel, basketSize));
89void G4Hdf5NtupleManager::CreateTNtupleFromBooking(
93 if (ntupleDescription->
GetFileName().size() != 0u) {
94 fFileManager->CreateNtupleFile(ntupleDescription);
98 CreateTNtuple(ntupleDescription,
true);
102void G4Hdf5NtupleManager::FinishTNtuple(
106 if (ntupleDescription->
GetNtuple() ==
nullptr) {
108 CreateTNtuple(ntupleDescription,
false);
111 fFileManager->LockDirectoryNames();
std::tuple< hid_t, hid_t, hid_t > G4Hdf5File
G4GLOB_DLL std::ostream G4cout
G4Hdf5NtupleManager()=delete
const tools::ntuple_booking & GetNtupleBooking() const
void SetNtuple(NT *ntuple)
std::shared_ptr< FT > GetFile() const
G4String GetFileName() const
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)