42 #include "tools/waxml/histos"
88 <<
"G4XmlAnalysisManager already exists."
89 <<
"Cannot create another instance.";
90 G4Exception(
"G4XmlAnalysisManager::G4XmlAnalysisManager",
131 const std::vector<tools::histo::h1d*>& h1Vector
133 const std::vector<G4HnInformation*>& hnVector
136 if ( ! h1Vector.size() )
return true;
140 for (
G4int i=0; i<
G4int(h1Vector.size()); ++i ) {
146 tools::histo::h1d* h1 = h1Vector[i];
155 = tools::waxml::write(*hnFile, *h1, path, name);
158 description <<
" " <<
"saving histogram " << name <<
" failed";
180 const std::vector<tools::histo::h2d*>& h2Vector
182 const std::vector<G4HnInformation*>& hnVector
185 if ( ! h2Vector.size() )
return true;
190 for (
G4int i=0; i<
G4int(h2Vector.size()); ++i ) {
196 tools::histo::h2d* h2 = h2Vector[i];
205 = tools::waxml::write(*hnFile, *h2, path, name);
208 description <<
" " <<
"saving histogram " << name <<
" failed";
230 const std::vector<tools::histo::h3d*>& h3Vector
232 const std::vector<G4HnInformation*>& hnVector
235 if ( ! h3Vector.size() )
return true;
240 for (
G4int i=0; i<
G4int(h3Vector.size()); ++i ) {
246 tools::histo::h3d* h3 = h3Vector[i];
255 = tools::waxml::write(*hnFile, *h3, path, name);
258 description <<
" " <<
"saving histogram " << name <<
" failed";
280 const std::vector<tools::histo::p1d*>& p1Vector
282 const std::vector<G4HnInformation*>& hnVector
285 if ( ! p1Vector.size() )
return true;
289 for (
G4int i=0; i<
G4int(p1Vector.size()); ++i ) {
295 tools::histo::p1d*
p1 = p1Vector[i];
304 = tools::waxml::write(*hnFile, *p1, path, name);
307 description <<
" " <<
"saving profile " << name <<
" failed";
329 const std::vector<tools::histo::p2d*>& p2Vector
331 const std::vector<G4HnInformation*>& hnVector
334 if ( ! p2Vector.size() )
return true;
338 for (
G4int i=0; i<
G4int(p2Vector.size()); ++i ) {
344 tools::histo::p2d*
p2 = p2Vector[i];
353 = tools::waxml::write(*hnFile, *p2, path, name);
356 description <<
" " <<
"saving profile " << name <<
" failed";
378 const std::vector<G4XmlNtupleDescription*>& ntupleVector
381 for (
G4int i=0; i<
G4int(ntupleVector.size()); ++i ) {
382 if ( ntupleVector[i]->fNtuple ) ntupleVector[i]->fNtuple->write_trailer();
391 const std::vector<G4XmlNtupleDescription*>& ntupleVector
395 std::vector<G4XmlNtupleDescription*>::const_iterator it;
396 for (it = ntupleVector.begin(); it != ntupleVector.end(); it++ ) {
409 G4bool finalResult =
true;
412 finalResult = finalResult && result;
415 finalResult = finalResult && result;
418 finalResult = finalResult && result;
421 finalResult = finalResult && result;
424 finalResult = finalResult && result;
427 finalResult = finalResult && result;
439 G4bool finalResult =
true;
441 finalResult = finalResult && result;
452 finalResult = finalResult && result;
457 finalResult = finalResult && result;
475 G4bool finalResult =
true;
493 <<
" " <<
"No master G4XmlAnalysisManager instance exists."
495 <<
" " <<
"Histogram data will not be merged.";
501 if ( ! result )
return false;
506 finalResult = finalResult && result;
510 finalResult = finalResult && result;
514 finalResult = finalResult && result;
518 finalResult = finalResult && result;
522 finalResult = finalResult && result;
527 finalResult = finalResult && result;
542 G4bool finalResult =
true;
551 finalResult = finalResult && result;
555 finalResult = finalResult && result;
562 finalResult = finalResult && result;
569 description <<
" " <<
"Resetting data failed";
573 finalResult = finalResult && result;
584 description <<
" " <<
"Removing file "
589 finalResult = finalResult && result;
600 ->
Message(
"close",
"files",
"");
void SetP1Manager(G4VP1Manager *p1Manager)
static G4XmlAnalysisManager * fgMasterInstance
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4XmlFileManager * fFileManager
virtual G4bool CloseFileImpl()
std::ostringstream G4ExceptionDescription
G4String GetProfileDirectoryName() const
void SetH1Manager(G4VH1Manager *h1Manager)
G4H3ToolsManager * fH3Manager
static G4XmlAnalysisManager * Instance()
G4H1ToolsManager * fH1Manager
G4H2ToolsManager * fH2Manager
G4XmlAnalysisManager(G4bool isMaster=true)
#define G4MUTEX_INITIALIZER
static G4ThreadLocal G4XmlAnalysisManager * fgInstance
const G4AnalysisVerbose * GetVerboseL2() const
void SetH3Manager(G4VH3Manager *h3Manager)
void LockProfileDirectoryName()
void SetFileManager(G4XmlFileManager *fileManager)
const std::vector< G4XmlNtupleDescription * > & GetNtupleDescriptionVector() const
const G4AnalysisVerbose * GetVerboseL3() const
virtual G4bool OpenFileImpl(const G4String &fileName)
void SetP2Manager(G4VP2Manager *p2Manager)
const G4AnalysisVerbose * GetVerboseL4() const
G4String GetHistoDirectoryName() const
G4P2ToolsManager * fP2Manager
virtual G4bool CloseFile()
virtual G4bool OpenFile(const G4String &fileName)
virtual G4bool WriteImpl()
void SetFileManager(G4VFileManager *fileManager)
G4bool IsMultithreadedApplication()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetH2Manager(G4VH2Manager *h2Manager)
std::ofstream * GetHnFile() const
G4XmlNtupleManager * fNtupleManager
G4P1ToolsManager * fP1Manager
G4bool CloseNtupleFile(G4XmlNtupleDescription *ntupleDescription)
G4String & append(const G4String &)
void CreateNtuplesFromBooking()
G4bool CloseNtupleFiles()
G4bool GetIsMaster() const
virtual G4bool SetFileName(const G4String &fileName)
void LockHistoDirectoryName()
G4String GetFileName() const
G4AnalysisManagerState fState
G4String GetFullFileName(const G4String &baseFileName="", G4bool isPerThread=true) const
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4bool WriteAscii(const G4String &fileName)