36 #include "tools/wroot/file"
42 G4int nofMainManagers)
45 fFileManager(nullptr),
46 fNtupleDirectory(nullptr),
49 for (
G4int i=0; i<nofMainManagers; ++i) {
71 ->
Message(
"set",
"ntuple create mode",
"");
79 createMode =
"G4NtupleCreateMode::kMainAfterOpen";
82 createMode =
"G4NtupleCreateMode::kMainBeforeOpen";
88 createMode =
"G4NtupleCreateMode::kNoMergeAfterOpen";
91 createMode =
"G4NtupleCreateMode::kNoMergeBeforeOpen";
99 ->
Message(
"set",
"ntuple create mode", createMode);
126 =
new tools::wroot::ntuple(
130 ntupleDescription->
fNtuple->set_basket_size(basketSize);
140 if ( ! manager->GetNtupleVector().size() ) {
142 manager->SetNtupleFile(
fFileManager->GetNtupleFile(counter));
143 manager->SetNtupleDirectory(
fFileManager->GetMainNtupleDirectory(counter++));
144 manager->CreateNtuplesFromBooking();
160 manager->SetNtupleFile(
fFileManager->GetNtupleFile(counter));
161 manager->SetNtupleDirectory(
fFileManager->GetMainNtupleDirectory(counter++));
178 auto finalResult =
true;
180 auto result = manager->Reset(
false);
181 finalResult = result && finalResult;
190 auto finalResult =
true;
193 auto result = manager->Merge();
194 finalResult = result && finalResult;
204 G4String inFunction =
"G4RootNtupleManager::::GetMainNtupleManager";
206 description <<
" " <<
"main ntuple manager " << index <<
" does not exist.";
218 G4String inFunction =
"G4RootNtupleManager::::GetBasketSize";
220 description <<
" " <<
"File manager must be defined first.";
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::shared_ptr< G4RootFileManager > fFileManager
std::vector< G4RootMainNtupleManager * > fMainNtupleManagers
std::ostringstream G4ExceptionDescription
G4RootNtupleManager(const G4AnalysisManagerState &state, G4int nofMainManagers=0)
tools::wroot::directory * fNtupleDirectory
std::vector< G4TNtupleDescription< tools::wroot::ntuple > * > fNtupleDescriptionVector
const char * name(G4int ptype)
const G4AnalysisVerbose * GetVerboseL2() const
G4bool Reset(G4bool deleteNtuple)
virtual void CreateTNtupleFromBooking(NtupleDescriptionType *ntupleDescription) final
virtual ~G4RootNtupleManager()
G4RootMainNtupleManager * GetMainNtupleManager(G4int index) const
const G4AnalysisVerbose * GetVerboseL4() const
friend class G4RootMainNtupleManager
G4NtupleCreateMode fCreateMode
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::vector< tools::wroot::ntuple * > fNtupleVector
virtual G4bool Reset(G4bool deleteNtuple)
virtual void FinishTNtuple(NtupleDescriptionType *ntupleDescription) final
virtual void CreateTNtuple(NtupleDescriptionType *ntupleDescription, const G4String &name, const G4String &title) final
unsigned int GetBasketSize() const
tools::ntuple_booking fNtupleBooking
const G4AnalysisManagerState & fState