34#include "tools/wroot/file"
35#include "tools/wroot/ntuple"
42 std::shared_ptr<G4NtupleBookingManager> bookingManager,
47 fNtupleBuilder(ntupleBuilder),
48 fBookingManager(
std::move(bookingManager)),
50 fFileNumber(fileNumber)
67 Warn(
"Ntuple file must be defined first.\n"
68 "Cannot create main ntuple.",
77 Message(
kVL4,
"create",
"main ntuple", ntupleBooking.name());
80 auto ntuple =
new tools::wroot::ntuple(*std::get<2>(*ntupleFile), ntupleBooking,
fRowWise);
83 ntuple->set_basket_size(basketSize);
88 Message(
kVL3,
"create",
"main ntuple", ntupleBooking.name());
94 std::size_t counter = 0;
97 ntuple->merge_number_of_entries();
100 if ( ntuple->entries() ) {
102 ntupleDescription->fHasFill =
true;
131std::shared_ptr<G4RootFile>
134 auto perThread =
false;
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
std::vector< tools::wroot::ntuple * > fNtupleVector
std::shared_ptr< G4RootFile > GetNtupleFile(RootNtupleDescription *ntupleDescription) const
static constexpr std::string_view fkClass
G4RootMainNtupleManager()=delete
G4RootNtupleManager * fNtupleBuilder
std::shared_ptr< G4RootFileManager > fFileManager
std::vector< RootNtupleDescription * > fNtupleDescriptionVector
void CreateNtuple(RootNtupleDescription *ntupleDescription, G4bool warn=true)
unsigned int GetBasketSize() const
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
tools::ntuple_booking fNtupleBooking