47 fFileManager(nullptr),
48 fIsCommentedHeader(true),
61void G4CsvNtupleManager::CreateTNtupleFromBooking(
65 if ( ! fFileManager->CreateNtupleFile(ntupleDescription) )
return;
69 =
new tools::wcsv::ntuple(
75void G4CsvNtupleManager::FinishTNtuple(
81 if ( ! fFileManager->GetFileName().size() )
return;
84 if ( ! ntupleDescription->
fNtuple ) {
85 CreateTNtupleFromBooking(ntupleDescription);
89 if ( ! ntupleDescription->
fNtuple ) {
91 description <<
"Creating ntuple has failed. ";
99 if ( ! WriteHeader(ntupleDescription->
fNtuple) ) {
101 description <<
"Writing ntuple header has failed. ";
108G4bool G4CsvNtupleManager::WriteHeader(tools::wcsv::ntuple* ntuple)
const
115 if ( fIsCommentedHeader ) {
116 return ntuple->write_commented_header(
G4cout);
120 if ( fIsHippoHeader ) {
121 ntuple->write_hippo_header();
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4CsvNtupleManager(const G4AnalysisManagerState &state)
std::vector< tools::wcsv::ntuple * > fNtupleVector
std::shared_ptr< TF > fFile
tools::ntuple_booking fNtupleBooking