Skip to content
Snippets Groups Projects

Improvements to PWG_common_production

Merged Lukas Chlad requested to merge l.chlad/cbmroot:pwg_common_production into master
1 unresolved thread
2 files
+ 8
10
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -3,12 +3,11 @@
Authors: Viktor Klochkov, Frederic Linz [committer] */
// ----- Check output file name -------------------------------------------
bool CheckOutFileName(TString fileName, Bool_t overwrite)
bool CheckOutFileName(TString fileName, Bool_t overwrite, const char* caller = __builtin_FUNCTION())
{
string fName = "run_analysis_tree_maker_json_config";
// --- Protect against overwriting an existing file
if ((!gSystem->AccessPathName(fileName.Data())) && (!overwrite)) {
cout << fName << ": output file " << fileName << " already exists!";
std::cout << caller << ": output file " << fileName << " already exists!" << std::endl;
return false;
}
@@ -17,11 +16,11 @@ bool CheckOutFileName(TString fileName, Bool_t overwrite)
if (gSystem->AccessPathName(directory)) {
Int_t success = gSystem->mkdir(directory, kTRUE);
if (success == -1) {
cout << fName << ": output directory " << directory << " does not exist and cannot be created!";
std::cout << caller << ": output directory " << directory << " does not exist and cannot be created!" << std::endl;
return false;
}
else
cout << fName << ": created directory " << directory;
std::cout << caller << ": created directory " << directory << std::endl;
}
return true;
}
Loading