Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
2a471846
Commit
2a471846
authored
2 years ago
by
Lukas Chlad
Browse files
Options
Downloads
Patches
Plain Diff
Automatic insertion of caller function name in CheckOutFileName
parent
640b4962
No related branches found
No related tags found
1 merge request
!1295
Improvements to PWG_common_production
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
macro/PWG/common/production/run_analysis_tree_maker_json_config.C
+4
-5
4 additions, 5 deletions
...G/common/production/run_analysis_tree_maker_json_config.C
macro/PWG/common/production/run_reco_json_config.C
+4
-5
4 additions, 5 deletions
macro/PWG/common/production/run_reco_json_config.C
with
8 additions
and
10 deletions
macro/PWG/common/production/run_analysis_tree_maker_json_config.C
+
4
−
5
View file @
2a471846
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
macro/PWG/common/production/run_reco_json_config.C
+
4
−
5
View file @
2a471846
...
...
@@ -92,12 +92,11 @@
**/
// ----- 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_reco_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
;
}
...
...
@@ -106,11 +105,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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment