43 #include "tools/wroot/to"
44 #include "tools/wroot/file"
93 <<
"G4RootAnalysisManager already exists."
94 <<
"Cannot create another instance.";
95 G4Exception(
"G4RootAnalysisManager::G4RootAnalysisManager()",
135 const std::vector<tools::histo::h1d*>& h1Vector
137 const std::vector<G4HnInformation*>& hnVector
140 if ( ! h1Vector.size() )
return true;
144 for (
G4int i=0; i<
G4int(h1Vector.size()); ++i ) {
150 tools::histo::h1d* h1 = h1Vector[i];
155 tools::wroot::directory* histoDirectory
158 = to(*histoDirectory, *h1, name);
161 description <<
" " <<
"saving histogram " << name <<
" failed";
182 const std::vector<tools::histo::h2d*>& h2Vector
184 const std::vector<G4HnInformation*>& hnVector
187 if ( ! h2Vector.size() )
return true;
191 for (
G4int i=0; i<
G4int(h2Vector.size()); ++i ) {
197 tools::histo::h2d* h2 = h2Vector[i];
202 tools::wroot::directory* histoDirectory
205 = to(*histoDirectory, *h2, name);
208 description <<
" " <<
"saving histogram " << name <<
" failed";
229 const std::vector<tools::histo::h3d*>& h3Vector
231 const std::vector<G4HnInformation*>& hnVector
234 if ( ! h3Vector.size() )
return true;
238 for (
G4int i=0; i<
G4int(h3Vector.size()); ++i ) {
244 tools::histo::h3d* h3 = h3Vector[i];
249 tools::wroot::directory* histoDirectory
252 = to(*histoDirectory, *h3, name);
255 description <<
" " <<
"saving histogram " << name <<
" failed";
276 const std::vector<tools::histo::p1d*>& p1Vector
278 const std::vector<G4HnInformation*>& hnVector
281 if ( ! p1Vector.size() )
return true;
285 for (
G4int i=0; i<
G4int(p1Vector.size()); ++i ) {
291 tools::histo::p1d*
p1 = p1Vector[i];
296 tools::wroot::directory* profileDirectory
299 = to(*profileDirectory, *p1, name);
302 description <<
" " <<
"saving profile " << name <<
" failed";
323 const std::vector<tools::histo::p2d*>& p2Vector
325 const std::vector<G4HnInformation*>& hnVector
328 if ( ! p2Vector.size() )
return true;
332 for (
G4int i=0; i<
G4int(p2Vector.size()); ++i ) {
338 tools::histo::p2d*
p2 = p2Vector[i];
343 tools::wroot::directory* profileDirectory
346 = to(*profileDirectory, *p2, name);
349 description <<
" " <<
"saving profile " << name <<
" failed";
372 G4bool finalResult =
true;
375 finalResult = finalResult && result;
378 finalResult = finalResult && result;
381 finalResult = finalResult && result;
384 finalResult = finalResult && result;
387 finalResult = finalResult && result;
390 finalResult = finalResult && result;
402 G4bool finalResult =
true;
404 finalResult = finalResult && result;
413 finalResult = finalResult && result;
430 G4bool finalResult =
true;
438 <<
" " <<
"No master G4RootAnalysisManager instance exists."
440 <<
" " <<
"Histogram/profile data will not be merged.";
447 finalResult = finalResult && result;
451 finalResult = finalResult && result;
455 finalResult = finalResult && result;
459 finalResult = finalResult && result;
463 finalResult = finalResult && result;
467 finalResult = finalResult && result;
472 finalResult = finalResult && result;
481 G4bool finalResult =
true;
493 description <<
" " <<
"Resetting data failed";
497 finalResult = finalResult && result;
514 description <<
" " <<
"Removing file "
519 finalResult = finalResult && result;
void SetP1Manager(G4VP1Manager *p1Manager)
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
static G4RootAnalysisManager * fgMasterInstance
virtual G4bool CloseFile()
G4RootFileManager * fFileManager
std::ostringstream G4ExceptionDescription
void SetH1Manager(G4VH1Manager *h1Manager)
static G4ThreadLocal G4RootAnalysisManager * fgInstance
virtual G4bool OpenFileImpl(const G4String &fileName)
#define G4MUTEX_INITIALIZER
virtual G4bool WriteFile()
void SetH3Manager(G4VH3Manager *h3Manager)
void CreateNtuplesFromBooking()
const G4AnalysisVerbose * GetVerboseL3() const
void SetP2Manager(G4VP2Manager *p2Manager)
G4RootNtupleManager * fNtupleManager
G4H2ToolsManager * fH2Manager
const G4AnalysisVerbose * GetVerboseL4() const
G4RootAnalysisManager(G4bool isMaster=true)
virtual G4bool WriteImpl()
virtual ~G4RootAnalysisManager()
void SetFileManager(G4VFileManager *fileManager)
G4bool IsMultithreadedApplication()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
tools::wroot::directory * GetNtupleDirectory() const
void SetH2Manager(G4VH2Manager *h2Manager)
G4H1ToolsManager * fH1Manager
virtual G4bool CloseFileImpl()
static G4RootAnalysisManager * Instance()
G4bool GetIsMaster() const
virtual G4bool OpenFile(const G4String &fileName)
G4P2ToolsManager * fP2Manager
virtual G4bool SetFileName(const G4String &fileName)
G4P1ToolsManager * fP1Manager
tools::wroot::directory * GetHistoDirectory() const
G4String GetFileName() const
G4AnalysisManagerState fState
G4String GetFullFileName(const G4String &baseFileName="", G4bool isPerThread=true) const
tools::wroot::directory * GetProfileDirectory() const
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
void SetNtupleDirectory(tools::wroot::directory *directory)
G4H3ToolsManager * fH3Manager
G4bool WriteAscii(const G4String &fileName)