79 fNtupleManager(nullptr),
86 <<
"G4RootAnalysisManager already exists."
87 <<
"Cannot create another instance.";
88 G4Exception(
"G4RootAnalysisManager::G4RootAnalysisManager()",
121 if ( ! h1Vector.size() )
return true;
127 result =
WriteT(h1Vector, hnVector, directory,
"h1");
146 if ( ! h2Vector.size() )
return true;
152 result =
WriteT(h2Vector, hnVector, directory,
"h2");
171 if ( ! h3Vector.size() )
return true;
177 result =
WriteT(h3Vector, hnVector, directory,
"h3");
196 if ( ! p1Vector.size() )
return true;
202 result =
WriteT(p1Vector, hnVector, directory,
"p1");
221 if ( ! p2Vector.size() )
return true;
227 result =
WriteT(p2Vector, hnVector, directory,
"p2");
245 auto finalResult =
true;
248 finalResult = finalResult && result;
251 finalResult = finalResult && result;
263 auto finalResult =
true;
265 finalResult = finalResult && result;
274 finalResult = finalResult && result;
291 auto finalResult =
true;
299 <<
" " <<
"No master G4RootAnalysisManager instance exists."
301 <<
" " <<
"Histogram/profile data will not be merged.";
308 finalResult = finalResult && result;
312 finalResult = finalResult && result;
316 finalResult = finalResult && result;
320 finalResult = finalResult && result;
324 finalResult = finalResult && result;
328 finalResult = finalResult && result;
333 finalResult = finalResult && result;
342 auto finalResult =
true;
351 auto result =
Reset();
354 description <<
" " <<
"Resetting data failed";
358 finalResult = finalResult && result;
371 result = ! std::remove(
fFileManager->GetFullFileName());
375 description <<
" " <<
"Removing file "
380 finalResult = finalResult && result;
virtual G4bool OpenFileImpl(const G4String &fileName) final
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
static G4RootAnalysisManager * fgMasterInstance
G4bool WriteT(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, tools::wroot::directory *directory, const G4String &hnType)
std::ostringstream G4ExceptionDescription
static G4ThreadLocal G4RootAnalysisManager * fgInstance
virtual G4bool CloseFileImpl() final
void CreateNtuplesFromBooking()
static G4bool IsInstance()
#define G4MUTEX_INITIALIZER
G4bool Reset(G4bool deleteNtuple)
G4RootNtupleManager * fNtupleManager
const G4AnalysisVerbose * GetVerboseL4() const
G4RootAnalysisManager(G4bool isMaster=true)
virtual ~G4RootAnalysisManager()
G4bool IsMultithreadedApplication()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
virtual G4bool WriteImpl() final
static G4RootAnalysisManager * Instance()
G4bool GetIsMaster() const
G4AnalysisManagerState fState
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
std::shared_ptr< G4RootFileManager > fFileManager
void SetNtupleDirectory(tools::wroot::directory *directory)
G4bool WriteAscii(const G4String &fileName)