40 const G4String ExG4HbookFileManager::fgkDefaultNtupleDirectoryName =
"ntuple";
50 ExG4HbookFileManager::~ExG4HbookFileManager()
67 if ( fState.GetVerboseL4() )
68 fState.GetVerboseL4()->Message(
"open",
"analysis file", name);
72 if ( fFile )
delete fFile;
74 tools::hbook::CHCDIR(
"//PAWC",
" ");
76 unsigned int unit = 1;
77 fFile =
new tools::hbook::wfile(std::cout, name, unit);
78 if ( ! fFile->is_valid() ) {
80 description <<
" " <<
"Cannot open file " << fileName;
92 if ( fHistoDirectoryName !=
"" ) {
93 tools::hbook::CHCDIR(
"//PAWC/LUN1",
" ");
94 tools::hbook::CHMDIR(fHistoDirectoryName.data(),
" ");
95 tools::hbook::CHCDIR(
"//LUN1",
" ");
96 tools::hbook::CHMDIR(fHistoDirectoryName.data(),
" ");
102 fLockFileName =
true;
103 fLockHistoDirectoryName =
true;
104 fLockNtupleDirectoryName =
true;
107 if ( fState.GetVerboseL1() )
108 fState.GetVerboseL1()->Message(
"open",
"analysis file", name);
115 G4bool ExG4HbookFileManager::WriteFile()
118 if ( fState.GetVerboseL4() )
119 fState.GetVerboseL4()->Message(
"write",
"file", GetFullFileName());
127 if ( fState.GetVerboseL1() )
128 fState.GetVerboseL1()->Message(
"write",
"file", GetFullFileName(), result);
135 G4bool ExG4HbookFileManager::CloseFile()
138 G4bool result = fFile->close();
139 fLockFileName =
false;
145 void ExG4HbookFileManager::CreateNtupleDirectory()
149 static G4bool isDone =
false;
155 if ( fNtupleDirectoryName ==
"" )
156 fFile->mkcd(fgkDefaultNtupleDirectoryName.data());
158 fFile->mkcd(fNtupleDirectoryName.data());
159 fLockNtupleDirectoryName =
true;
std::ostringstream G4ExceptionDescription
G4double G4NeutronHPJENDLHEData::G4double result
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition of the ExG4HbookFileManager class.