39 using namespace G4Analysis;
48 fFileManager(nullptr),
49 fIsCommentedHeader(true),
62 void G4CsvNtupleManager::CreateTNtuple(
68 if ( fFileManager->GetFileName().size() ) {
69 if ( fFileManager->CreateNtupleFile(ntupleDescription) ) {
71 =
new tools::wcsv::ntuple(*(ntupleDescription->
fFile));
73 (ntupleDescription->
fNtuple)->set_title(title);
80 void G4CsvNtupleManager::CreateTNtupleFromBooking(
84 if ( ! fFileManager->CreateNtupleFile(ntupleDescription) )
return;
88 =
new tools::wcsv::ntuple(
94 void G4CsvNtupleManager::FinishTNtuple(
97 if ( ! ntupleDescription->
fNtuple )
return;
100 if ( ! WriteHeader(ntupleDescription->
fNtuple) ) {
103 <<
"Writing ntuple header has failed. ";
110 G4bool G4CsvNtupleManager::WriteHeader(tools::wcsv::ntuple* ntuple)
const
117 if ( fIsCommentedHeader ) {
118 return ntuple->write_commented_header(
G4cout);
122 if ( fIsHippoHeader ) {
123 ntuple->write_hippo_header();
std::ostringstream G4ExceptionDescription
G4CsvNtupleManager(const G4AnalysisManagerState &state)
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::vector< tools::wcsv::ntuple * > fNtupleVector
tools::ntuple_booking fNtupleBooking
G4GLOB_DLL std::ostream G4cerr