36 #include "tools/wroot/file"
38 using namespace G4Analysis;
42 G4int nofMainManagers,
50 for (
G4int i=0; i<nofMainManagers; ++i) {
72 ->
Message(
"set",
"ntuple create mode",
"");
80 createMode =
"G4NtupleCreateMode::kMainAfterOpen";
83 createMode =
"G4NtupleCreateMode::kMainBeforeOpen";
89 createMode =
"G4NtupleCreateMode::kNoMergeAfterOpen";
92 createMode =
"G4NtupleCreateMode::kNoMergeBeforeOpen";
100 ->
Message(
"set",
"ntuple create mode", createMode);
109 G4String inFunction =
"G4RootNtupleManager::::CreateTNtuple";
112 <<
"Cannot create ntuple. Ntuple directory does not exist." <<
G4endl;
122 ntupleDescription->
fNtuple->set_basket_size(basketSize);
141 if ( ! manager->GetNtupleVector().size() ) {
143 manager->SetNtupleFile(
fFileManager->GetNtupleFile(counter));
144 manager->SetNtupleDirectory(
fFileManager->GetMainNtupleDirectory(counter++));
145 manager->CreateNtuplesFromBooking();
170 manager->SetNtupleFile(
fFileManager->GetNtupleFile(counter));
171 manager->SetNtupleDirectory(
fFileManager->GetMainNtupleDirectory(counter++));
188 auto finalResult =
true;
190 auto result = manager->Reset(
false);
191 finalResult =
result && finalResult;
200 auto finalResult =
true;
203 auto result = manager->Merge();
204 finalResult =
result && finalResult;
214 G4String inFunction =
"G4RootNtupleManager::::GetMainNtupleManager";
216 description <<
" " <<
"main ntuple manager " << index <<
" does not exist.";
228 G4String inFunction =
"G4RootNtupleManager::::GetBasketSize";
230 description <<
" " <<
"File manager must be defined first.";
std::vector< G4TNtupleDescription< tools::wroot::ntuple > * > fNtupleDescriptionVector
const G4AnalysisVerbose * GetVerboseL2() const
G4RootMainNtupleManager * GetMainNtupleManager(G4int index) const
std::ostringstream G4ExceptionDescription
G4NtupleCreateMode fCreateMode
G4RootNtupleManager(const G4AnalysisManagerState &state, G4int nofMainManagers=0, G4bool rowWise=true)
std::vector< G4RootMainNtupleManager * > fMainNtupleManagers
unsigned int GetBasketSize() const
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool Reset(G4bool deleteNtuple)
void CreateTNtuple(NtupleDescriptionType *ntupleDescription)
std::shared_ptr< G4RootFileManager > fFileManager
G4bool Reset(G4bool deleteNtuple)
friend class G4RootMainNtupleManager
G4double G4ParticleHPJENDLHEData::G4double result
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual void CreateTNtupleFromBooking(NtupleDescriptionType *ntupleDescription) final
tools::wroot::directory * fNtupleDirectory
virtual void FinishTNtuple(NtupleDescriptionType *ntupleDescription) final
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
tools::ntuple_booking fNtupleBooking
virtual ~G4RootNtupleManager()
std::vector< tools::wroot::ntuple * > fNtupleVector
const G4AnalysisManagerState & fState