37using std::make_shared;
42 fFileManager(nullptr),
43 fNtupleManager(nullptr)
55G4bool G4XmlNtupleFileManager::CloseNtupleFiles()
59 auto finalResult =
true;
60 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
61 for (
auto ntupleDescription : ntupleVector) {
62 auto result = fFileManager->CloseNtupleFile(ntupleDescription);
63 finalResult = finalResult && result;
76 fNtupleManager = std::make_shared<G4XmlNtupleManager>(
fState);
77 fNtupleManager->SetFileManager(fFileManager);
79 return fNtupleManager;
87 fNtupleManager->CreateNtuplesFromBooking(
96 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
98 for (
auto ntuple : ntupleVector ) {
99 if ( ntuple->fNtuple ) ntuple->fNtuple->write_trailer();
108 auto finalResult =
true;
111 auto result = CloseNtupleFiles();
112 finalResult = finalResult && result;
119 description <<
" " <<
"Resetting data failed";
123 finalResult = finalResult && result;
134 return fNtupleManager->Reset(
true);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::shared_ptr< G4NtupleBookingManager > fBookingManager
const G4AnalysisManagerState & fState
virtual G4bool ActionAtOpenFile(const G4String &fileName) override
~G4XmlNtupleFileManager()
G4XmlNtupleFileManager(const G4AnalysisManagerState &state)
virtual G4bool Reset() override
virtual G4bool ActionAtWrite() override
virtual std::shared_ptr< G4VNtupleManager > CreateNtupleManager() override
virtual G4bool ActionAtCloseFile(G4bool reset) override