46G4int G4CsvRNtupleManager::ReadNtupleImpl(
const G4String& ntupleName,
57 if ( ! isUserFileName ) {
58 fullFileName = fFileManager->GetNtupleFileName(ntupleName);
62 if ( ! dirName.empty() ) {
63 fullFileName =
"./" + dirName +
"/" + fullFileName;
67 if ( ! fFileManager->OpenRFile(fullFileName) )
return kInvalidId;
68 auto ntupleFile = fFileManager->GetRFile(fullFileName);
71 auto rntuple =
new tools::rcsv::ntuple(*ntupleFile);
80G4bool G4CsvRNtupleManager::GetTNtupleRow(
83 auto ntuple = ntupleDescription->
fNtuple;
86 if ( ! isInitialized ) {
88 if ( ! ntuple->initialize(
G4cout, *ntupleBinding) ) {
89 Warn(
"Ntuple initialization failed !!", fkClass,
"GetTNtupleRow");
96 auto next = ntuple->next();
98 if ( ! ntuple->get_row() ) {
99 Warn(
"Ntuple get_row() failed !!", fkClass,
"GetTNtupleRow");
G4GLOB_DLL std::ostream G4cout
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
G4CsvRNtupleManager()=delete
G4int SetNtuple(G4TRNtupleDescription< tools::rcsv::ntuple > *rntupleDescription)
constexpr G4int kInvalidId
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
tools::ntuple_binding * fNtupleBinding