31#ifndef G4Hdf5NtupleManager_h
32#define G4Hdf5NtupleManager_h 1
38#include "toolx/hdf5/ntuple"
55 G4int ntupleId,
G4int columnId,
const std::string& value);
71 void SetFileManager(std::shared_ptr<G4Hdf5FileManager> fileManager);
74 const std::vector<Hdf5NtupleDescription*>& GetNtupleDescriptionVector()
const;
86 static constexpr std::string_view fkClass {
"G4Hdf5NtupleManager" };
89 std::shared_ptr<G4Hdf5FileManager> fFileManager {
nullptr };
97G4Hdf5NtupleManager::SetFileManager(std::shared_ptr<G4Hdf5FileManager> fileManager)
99 fFileManager = std::move(fileManager);
102inline const std::vector<Hdf5NtupleDescription*>&
103G4Hdf5NtupleManager::GetNtupleDescriptionVector()
const
109 G4int ntupleId,
G4int columnId,
const std::string& value)
117 auto ntuple = GetNtupleInFunction(ntupleId,
"FillNtupleTColumn");
118 if (ntuple ==
nullptr)
return false;
121 auto index = columnId - fFirstNtupleColumnId;
122 if ( index < 0 || index >=
G4int(ntuple->columns().size()) ) {
124 "ntupleId " + to_string(ntupleId) +
" columnId " + to_string(columnId) +
125 " does not exist.", fkClass,
"FillNtupleTColumn");
128 auto icolumn = ntuple->columns()[index];
131 auto column =
dynamic_cast<toolx::hdf5::ntuple::column_string*
>(icolumn);
132 if (column ==
nullptr) {
134 "Column type does not match: ntupleId " + to_string(ntupleId) +
135 " columnId " + to_string(columnId) +
" value " + value,
136 fkClass,
"FillNtupleTColumn");
144 " ntupleId " + to_string(ntupleId) +
145 " columnId " + to_string(columnId) +
std::tuple< hid_t, hid_t, hid_t > G4Hdf5File
G4bool GetIsActivation() const
~G4Hdf5NtupleManager() override=default
G4Hdf5NtupleManager()=delete
std::vector< G4TNtupleDescription< toolx::hdf5::ntuple, G4Hdf5File > * > fNtupleDescriptionVector
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
const G4AnalysisManagerState & fState
std::string ToString(const T &value)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)