75 fNtupleManager(nullptr),
82 <<
"G4XmlAnalysisManager already exists."
83 <<
"Cannot create another instance.";
84 G4Exception(
"G4XmlAnalysisManager::G4XmlAnalysisManager",
118 if ( ! h1Vector.size() )
return true;
123 auto directoryName =
fFileManager->GetHistoDirectoryName();
124 result =
WriteT(h1Vector, hnVector, directoryName,
"h1");
143 if ( ! h2Vector.size() )
return true;
148 auto directoryName =
fFileManager->GetHistoDirectoryName();
149 result =
WriteT(h2Vector, hnVector, directoryName,
"h2");
168 if ( ! h3Vector.size() )
return true;
173 auto directoryName =
fFileManager->GetHistoDirectoryName();
174 result =
WriteT(h3Vector, hnVector, directoryName,
"h3");
193 if ( ! p1Vector.size() )
return true;
198 auto directoryName =
fFileManager->GetHistoDirectoryName();
199 result =
WriteT(p1Vector, hnVector, directoryName,
"p1");
218 if ( ! p2Vector.size() )
return true;
223 auto directoryName =
fFileManager->GetHistoDirectoryName();
224 result =
WriteT(p2Vector, hnVector, directoryName,
"p2");
242 for (
auto ntuple : ntupleVector ) {
243 if ( ntuple->fNtuple ) ntuple->fNtuple->write_trailer();
255 for (
auto ntupleDescription : ntupleDescriptionVector) {
268 auto finalResult =
true;
271 finalResult = finalResult && result;
274 finalResult = finalResult && result;
286 auto finalResult =
true;
288 finalResult = finalResult && result;
299 finalResult = finalResult && result;
304 finalResult = finalResult && result;
322 auto finalResult =
true;
340 <<
" " <<
"No master G4XmlAnalysisManager instance exists."
342 <<
" " <<
"Histogram data will not be merged.";
348 if ( ! result )
return false;
353 finalResult = finalResult && result;
357 finalResult = finalResult && result;
361 finalResult = finalResult && result;
365 finalResult = finalResult && result;
369 finalResult = finalResult && result;
374 finalResult = finalResult && result;
389 auto finalResult =
true;
398 finalResult = finalResult && result;
402 finalResult = finalResult && result;
406 finalResult = finalResult && result;
412 description <<
" " <<
"Resetting data failed";
416 finalResult = finalResult && result;
423 result = ! std::remove(
fFileManager->GetFullFileName());
427 description <<
" " <<
"Removing file "
432 finalResult = finalResult && result;
443 ->
Message(
"close",
"files",
"");
const std::vector< NtupleDescriptionType * > & GetNtupleDescriptionVector() const
static G4XmlAnalysisManager * fgMasterInstance
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::ostringstream G4ExceptionDescription
virtual G4bool OpenFileImpl(const G4String &fileName) final
static G4XmlAnalysisManager * Instance()
const char * name(G4int ptype)
G4bool WriteT(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, const G4String &directoryName, const G4String &hnType)
G4XmlAnalysisManager(G4bool isMaster=true)
void CreateNtuplesFromBooking()
static G4bool IsInstance()
#define G4MUTEX_INITIALIZER
static G4ThreadLocal G4XmlAnalysisManager * fgInstance
const G4AnalysisVerbose * GetVerboseL2() const
void SetFileManager(std::shared_ptr< G4XmlFileManager > fileManager)
G4bool Reset(G4bool deleteNtuple)
const G4AnalysisVerbose * GetVerboseL4() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
G4XmlNtupleManager * fNtupleManager
virtual G4bool WriteImpl() final
std::shared_ptr< G4XmlFileManager > fFileManager
G4bool CloseNtupleFiles()
G4bool GetIsMaster() const
G4AnalysisManagerState fState
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4bool WriteAscii(const G4String &fileName)
virtual G4bool CloseFileImpl() final