38 #include "tools/waxml/histos"
75 <<
"G4XmlAnalysisManager already exists."
76 <<
"Cannot create another instance.";
77 G4Exception(
"G4XmlAnalysisManager::G4XmlAnalysisManager",
112 const std::vector<tools::histo::h1d*>& h1Vector
114 const std::vector<G4HnInformation*>& hnVector
117 if ( ! h1Vector.size() )
return true;
121 for (
G4int i=0; i<
G4int(h1Vector.size()); ++i ) {
127 tools::histo::h1d* h1 = h1Vector[i];
136 = tools::waxml::write(*hnFile, *h1, path, name);
139 description <<
" " <<
"saving histogram " << name <<
" failed";
161 const std::vector<tools::histo::h2d*>& h2Vector
163 const std::vector<G4HnInformation*>& hnVector
166 if ( ! h2Vector.size() )
return true;
171 for (
G4int i=0; i<
G4int(h2Vector.size()); ++i ) {
177 tools::histo::h2d* h2 = h2Vector[i];
186 = tools::waxml::write(*hnFile, *h2, path, name);
189 description <<
" " <<
"saving histogram " << name <<
" failed";
211 const std::vector<G4XmlNtupleDescription*>& ntupleVector
214 for (
G4int i=0; i<
G4int(ntupleVector.size()); ++i ) {
215 if ( ntupleVector[i]->fNtuple ) ntupleVector[i]->fNtuple->write_trailer();
224 const std::vector<G4XmlNtupleDescription*>& ntupleVector
228 std::vector<G4XmlNtupleDescription*>::const_iterator it;
229 for (it = ntupleVector.begin(); it != ntupleVector.end(); it++ ) {
242 G4bool finalResult =
true;
245 finalResult = finalResult && result;
248 finalResult = finalResult && result;
251 finalResult = finalResult && result;
263 G4bool finalResult =
true;
265 finalResult = finalResult && result;
276 finalResult = finalResult && result;
281 finalResult = finalResult && result;
299 G4bool finalResult =
true;
315 <<
" " <<
"No master G4XmlAnalysisManager instance exists."
317 <<
" " <<
"Histogram data will not be merged.";
323 if ( ! result )
return false;
328 finalResult = finalResult && result;
332 finalResult = finalResult && result;
337 finalResult = finalResult && result;
352 G4bool finalResult =
true;
361 finalResult = finalResult && result;
365 finalResult = finalResult && result;
371 finalResult = finalResult && result;
378 description <<
" " <<
"Resetting data failed";
382 finalResult = finalResult && result;
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 GetFullFileName() const
void SetH1Manager(G4VH1Manager *h1Manager)
static G4XmlAnalysisManager * Instance()
G4H1ToolsManager * fH1Manager
void LockHistoDirectoryName()
G4H2ToolsManager * fH2Manager
G4XmlAnalysisManager(G4bool isMaster=true)
#define G4MUTEX_INITIALIZER
static G4ThreadLocal G4XmlAnalysisManager * fgInstance
void SetFileManager(G4XmlFileManager *fileManager)
const G4AnalysisVerbose * GetVerboseL3() const
const std::vector< G4XmlNtupleDescription * > & GetNtupleVector() const
virtual G4bool OpenFileImpl(const G4String &fileName)
const G4AnalysisVerbose * GetVerboseL4() const
G4String GetFileName() const
G4String GetHistoDirectoryName() const
virtual G4bool CloseFile()
virtual G4bool OpenFile(const G4String &fileName)
virtual G4bool WriteImpl()
void SetFileManager(G4VFileManager *fileManager)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetH2Manager(G4VH2Manager *h2Manager)
std::ofstream * GetHnFile() const
G4XmlNtupleManager * fNtupleManager
G4bool CloseNtupleFile(G4XmlNtupleDescription *ntupleDescription)
G4String & append(const G4String &)
void CreateNtuplesFromBooking()
G4bool CloseNtupleFiles()
G4bool GetIsMaster() const
G4bool SetFileName(const G4String &fileName)
G4AnalysisManagerState fState
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4bool WriteAscii(const G4String &fileName)