48 ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::fgInstance = 0;
51 ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::Create(
G4bool )
53 if ( fgInstance == 0 ) {
54 fgInstance =
new ExG4HbookAnalysisManager();
61 ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::Instance()
63 if ( fgInstance == 0 ) {
64 fgInstance =
new ExG4HbookAnalysisManager();
71 ExG4HbookAnalysisManager::ExG4HbookAnalysisManager()
82 <<
"G4HbookAnalysisManager is not supported in multi-threading mode.";
83 G4Exception(
"ExG4HbookAnalysisManager::ExG4HbookAnalysisManager()",
90 <<
"G4HbookAnalysisManager already exists."
91 <<
"Cannot create another instance.";
92 G4Exception(
"ExG4HbookAnalysisManager::ExG4HbookAnalysisManager()",
99 fH1Manager =
new ExG4HbookH1Manager(fState);
100 fH2Manager =
new ExG4HbookH2Manager(fState);
101 fNtupleManager =
new ExG4HbookNtupleManager(fState);
102 fFileManager =
new ExG4HbookFileManager(fState);
105 SetH1Manager(fH1Manager);
106 SetH2Manager(fH2Manager);
107 SetNtupleManager(fNtupleManager);
108 SetFileManager(fFileManager);
111 fH1Manager->SetFileManager(fFileManager);
112 fH2Manager->SetFileManager(fFileManager);
113 fNtupleManager->SetFileManager(fFileManager);
116 tools::hbook::CHLIMIT(
setpawc());
121 ExG4HbookAnalysisManager::~ExG4HbookAnalysisManager()
137 fNtupleManager->Reset();
145 G4bool ExG4HbookAnalysisManager::OpenFileImpl(
const G4String& fileName)
147 G4bool finalResult =
true;
149 finalResult = finalResult &&
result;
153 if ( fState.GetVerboseL4() )
154 fState.GetVerboseL4()->Message(
"open",
"analysis file", name);
158 result = fFileManager->OpenFile(fileName);
159 finalResult = finalResult &&
result;
162 fH1Manager->CreateH1sFromBooking();
165 fH2Manager->CreateH2sFromBooking();
168 fNtupleManager->CreateNtuplesFromBooking();
171 if ( fState.GetVerboseL1() )
172 fState.GetVerboseL1()->Message(
"open",
"analysis file", name);
179 G4bool ExG4HbookAnalysisManager::WriteImpl()
181 G4bool finalResult =
true;
183 G4bool result = fFileManager->WriteFile();
184 finalResult = finalResult &&
result;
188 result = WriteAscii(fFileManager->GetFileName());
189 finalResult = finalResult &&
result;
196 G4bool ExG4HbookAnalysisManager::CloseFileImpl()
198 G4bool finalResult =
true;
201 if ( fState.GetVerboseL4() )
202 fState.GetVerboseL4()->Message(
"close",
"file", fFileManager->GetFullFileName());
209 G4bool result = fFileManager->CloseFile();
210 finalResult = finalResult &&
result;
213 if ( fState.GetVerboseL1() )
214 fState.GetVerboseL1()->Message(
"close",
"file", fFileManager->GetFullFileName(),
result);
std::ostringstream G4ExceptionDescription
G4double G4NeutronHPJENDLHEData::G4double result
Definition of the ExG4HbookAnalysisManager class.
INTEGER *4 function setntuc()
Definition of the ExG4HbookNtupleManager class.
Definition of the ExG4HbookH1Manager class.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
ntupleExperimental Reset()
Definition of the ExG4HbookH2Manager class.
INTEGER *4 function setpawc()
Definition of the ExG4HbookFileManager class.