Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -47,6 +47,9 @@ G4bool G4CsvAnalysisManager::WriteT(const std::vector<tools::histo::p1d*>& htVec
|
||||
auto fileName = fFileManager->GetHnFileName(hnType, name);
|
||||
std::ofstream hnFile(fileName);
|
||||
|
||||
// Do nothing if there is no file
|
||||
if ( ! hnFile.is_open() ) return false;
|
||||
|
||||
auto result
|
||||
= tools::wcsv::pto(hnFile, ht->s_cls(), *ht);
|
||||
|
||||
@@ -85,6 +88,9 @@ G4bool G4CsvAnalysisManager::WriteT(const std::vector<tools::histo::p2d*>& htVec
|
||||
auto fileName = fFileManager->GetHnFileName(hnType, name);
|
||||
std::ofstream hnFile(fileName);
|
||||
|
||||
// Do nothing if there is no file
|
||||
if ( ! hnFile.is_open() ) return false;
|
||||
|
||||
auto result
|
||||
= tools::wcsv::pto(hnFile, ht->s_cls(), *ht);
|
||||
|
||||
@@ -123,6 +129,9 @@ G4bool G4CsvAnalysisManager::WriteT(const std::vector<T*>& htVector,
|
||||
auto fileName = fFileManager->GetHnFileName(hnType, name);
|
||||
std::ofstream hnFile(fileName);
|
||||
|
||||
// Do nothing if there is no file
|
||||
if ( ! hnFile.is_open() ) return false;
|
||||
|
||||
auto result
|
||||
= tools::wcsv::hto(hnFile, ht->s_cls(), *ht);
|
||||
if ( ! result ) {
|
||||
|
||||
@@ -85,6 +85,7 @@ G4bool G4CsvFileManager::CreateNtupleFile(
|
||||
|
||||
auto ntupleFile = new std::ofstream(GetNtupleFileName(ntupleName));
|
||||
if ( ntupleFile->fail() ) {
|
||||
delete ntupleFile;
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "Cannot open file "
|
||||
<< GetNtupleFileName(ntupleName);
|
||||
@@ -107,6 +108,9 @@ G4bool G4CsvFileManager::CreateNtupleFile(
|
||||
G4bool G4CsvFileManager::CloseNtupleFile(
|
||||
G4TNtupleDescription<tools::wcsv::ntuple>* ntupleDescription)
|
||||
{
|
||||
// Do nothing if there is no file
|
||||
if ( ! ntupleDescription->fFile ) return true;
|
||||
|
||||
G4String ntupleName = ntupleDescription->fNtupleBooking.name();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
|
||||
Reference in New Issue
Block a user