34 #include "tools/wroot/file"
35 #include "tools/wroot/ntuple"
41 fNtupleBuilder(ntupleBuilder),
42 fNtupleDirectory(nullptr),
67 if ( ! fNtupleDirectory ) {
71 <<
" " <<
"Ntuple file must be defined first."
73 <<
" " <<
"Cannot create main ntuples from builder.";
74 G4Exception(
"G4RootAnalysisManager::CreateNtuplesFromBooking",
83 ->
Message(
"create",
"main ntuple", ntupleBooking.name());
87 auto ntuple =
new tools::wroot::ntuple(*fNtupleDirectory, ntupleBooking);
89 auto basketSize = fNtupleBuilder->GetBasketSize();
90 ntuple->set_basket_size(basketSize);
92 fNtupleVector.push_back(ntuple);
97 ->
Message(
"create",
"main ntuple", ntupleBooking.name());
107 if ( ! fNtupleDirectory ) {
110 <<
" " <<
"Ntuple file must be defined first."
112 <<
" " <<
"Cannot create main ntuples from builder.";
113 G4Exception(
"G4RootAnalysisManager::CreateNtuplesFromBooking",
118 auto& ntupleDescriptionVector
119 = fNtupleBuilder->GetNtupleDescriptionVector();
121 for (
auto ntupleDescription : ntupleDescriptionVector ) {
129 for (
auto ntuple : fNtupleVector ) {
130 ntuple->merge_number_of_entries();
139 for (
auto ntuple : fNtupleVector ) {
140 if ( deleteNtuple ) {
145 fNtupleVector.clear();
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::ostringstream G4ExceptionDescription
void CreateNtuple(const tools::ntuple_booking &ntupleBooking, G4bool warn=true)
~G4RootMainNtupleManager()
const G4AnalysisVerbose * GetVerboseL3() const
const G4AnalysisVerbose * GetVerboseL4() const
G4bool Reset(G4bool deleteNtuple)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4RootMainNtupleManager(G4RootNtupleManager *ntupleBuilder, const G4AnalysisManagerState &state)
void CreateNtuplesFromBooking()
const G4AnalysisManagerState & fState