46 if ( fgInstance ==
nullptr ) {
57 fNtupleManager(nullptr),
60 if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
64 <<
"G4Hdf5AnalysisReader already exists."
65 <<
"Cannot create another instance.";
66 G4Exception(
"G4Hdf5AnalysisReader::G4Hdf5AnalysisReader()",
69 if ( isMaster ) fgMasterInstance =
this;
93G4bool G4Hdf5AnalysisReader::Reset()
97 auto finalResult =
true;
100 finalResult = finalResult && result;
102 result = fNtupleManager->
Reset();
103 finalResult = finalResult && result;
123 auto h1 = ReadHnImpl<tools::histo::h1d>(h1Name, fileName, dirName);
148 auto h2 = ReadHnImpl<tools::histo::h2d>(h2Name, fileName, dirName);
174 auto h3 = ReadHnImpl<tools::histo::h3d>(h3Name, fileName, dirName);
199 auto p1 = ReadPnImpl<tools::histo::p1d>(p1Name, fileName, dirName);
225 auto p2 = ReadPnImpl<tools::histo::p2d>(p2Name, fileName, dirName);
253 if ( ! isUserFileName ) {
262 auto rntuple =
new tools::hdf5::ntuple(
G4cout, directory, ntupleName);
264 auto id = fNtupleManager->
SetNtuple(rntupleDescription);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
const G4AnalysisVerbose * GetVerboseL2() const
G4bool GetIsMaster() const
const G4AnalysisVerbose * GetVerboseL4() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4String GetFullFileName(const G4String &baseFileName="", G4bool isPerThread=true) const
static G4Hdf5AnalysisReader * Instance()
virtual G4int ReadH3Impl(const G4String &h3Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
virtual ~G4Hdf5AnalysisReader()
virtual G4int ReadNtupleImpl(const G4String &ntupleName, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
virtual G4int ReadH2Impl(const G4String &h2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
G4Hdf5AnalysisReader(G4bool isMaster=true)
virtual G4int ReadP1Impl(const G4String &p1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
virtual G4int ReadH1Impl(const G4String &h1Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
virtual G4int ReadP2Impl(const G4String &p2Name, const G4String &fileName, const G4String &dirName, G4bool isUserFileName) final
hid_t GetNtupleRDirectory(const G4String &fileName, const G4String &dirName, G4bool isPerThread)
G4int SetNtuple(G4TRNtupleDescription< TNTUPLE > *rntupleDescription)
void SetFileManager(G4BaseFileManager *fileManager)
void SetNtupleManager(G4VRNtupleManager *ntupleManager)
G4AnalysisManagerState fState