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",
"");
G4bool WriteT(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, const G4String &directoryName, const G4String &hnType)
const G4AnalysisVerbose * GetVerboseL2() const
virtual G4bool WriteImpl() final
std::ostringstream G4ExceptionDescription
G4bool CloseNtupleFiles()
void CreateNtuplesFromBooking()
static G4XmlAnalysisManager * Instance()
virtual G4bool OpenFileImpl(const G4String &fileName) final
#define G4MUTEX_INITIALIZER
G4AnalysisManagerState fState
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool CloseFileImpl() final
G4XmlNtupleManager * fNtupleManager
G4bool Reset(G4bool deleteNtuple)
const std::vector< NtupleDescriptionType * > & GetNtupleDescriptionVector() const
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
G4double G4ParticleHPJENDLHEData::G4double result
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4ThreadLocal G4XmlAnalysisManager * fgInstance
static G4bool IsInstance()
void SetFileManager(std::shared_ptr< G4XmlFileManager > fileManager)
static G4XmlAnalysisManager * fgMasterInstance
void SetNtupleManager(G4VNtupleManager *ntupleManager)
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4bool GetIsMaster() const
G4XmlAnalysisManager(G4bool isMaster=true)
std::shared_ptr< G4XmlFileManager > fFileManager
const G4AnalysisVerbose * GetVerboseL1() const
G4bool WriteAscii(const G4String &fileName)