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();
72 auto compressionLevel = 0;
78 newNtupleName.append(
"_v");
79 newNtupleName.append(std::to_string(
GetCycle()));
80 ntupleBooking.set_name(newNtupleName);
85 new toolx::hdf5::ntuple(
86 G4cout, directory, ntupleBooking, compressionLevel, basketSize));
92void G4Hdf5NtupleManager::CreateTNtupleFromBooking(
96 if (ntupleDescription->
GetFileName().size() != 0u) {
97 fFileManager->CreateNtupleFile(ntupleDescription);
101 CreateTNtuple(ntupleDescription,
true);
105void G4Hdf5NtupleManager::FinishTNtuple(
109 if (ntupleDescription->
GetNtuple() ==
nullptr) {
111 CreateTNtuple(ntupleDescription,
false);
114 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
std::vector< toolx::hdf5::ntuple * > fNtupleVector
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)