Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Riccardo Longo
JZCaPA
Commits
a4ed697f
Commit
a4ed697f
authored
Oct 25, 2021
by
Chad Lantz
Browse files
Added verbosity flag for event and resource usage
parent
a8c2ea4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Analysis/userFunctions/AnalysisExample2021.cpp
View file @
a4ed697f
...
...
@@ -22,7 +22,7 @@ namespace {
void
PrintUsage
()
{
std
::
cout
<<
" Usage: AnalysisExample2021 [-d /path/to/input/files/ ] [-f /list/of.root /files/here.root]"
<<
std
::
endl
<<
" [-o /output/directory/] [-c /config/file.xml] [-a /alignment/file.xml]"
<<
std
::
endl
<<
" [-t /timing/file.txt] [-n #events] [--help]"
<<
std
::
endl
;
<<
" [-t /timing/file.txt] [-n #events]
[-v (verbose)]
[--help]"
<<
std
::
endl
;
}
}
...
...
@@ -37,6 +37,7 @@ void PrintHelp(){
std
::
cout
<<
" c Configuration file to be used"
<<
std
::
endl
;
std
::
cout
<<
" a Alignment file to be used"
<<
std
::
endl
;
std
::
cout
<<
" t Timing file to be used"
<<
std
::
endl
;
std
::
cout
<<
" v Verbose. Currently prints event#, CPU/RAM usage if flag is used. Takes no argument"
<<
std
::
endl
;
}
...
...
@@ -79,6 +80,7 @@ int main(int argc, char *argv[]){
std
::
string
config_file
=
""
;
std
::
string
alignment_file
=
""
;
std
::
string
timing_file
=
(
std
::
string
)
std
::
getenv
(
"JZCaPA"
)
+
"/Utils/Timing_data/2021_PreliminaryTiming.txt"
;
int
verbosity
=
0
;
std
::
vector
<
std
::
string
>
root_files
;
...
...
@@ -99,6 +101,7 @@ int main(int argc, char *argv[]){
else
if
(
TString
(
argv
[
i
])
==
"-c"
)
config_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-a"
)
alignment_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-t"
)
timing_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-v"
)
verbosity
=
1
;
else
if
(
TString
(
argv
[
i
])
==
"--help"
)
PrintHelp
();
else
{
PrintUsage
();
...
...
@@ -160,11 +163,13 @@ int main(int argc, char *argv[]){
std
::
cout
<<
"~=~=~=~=~=~ Run Start"
<<
std
::
endl
;
r
->
EnablePlotLabel
();
if
(
maxEvents
!=
0
)
r
->
SetMaxEvents
(
maxEvents
);
EventTimer
timer
(
1000
,
r
,
kFALSE
);
timer
.
TurnOn
();
if
(
verbosity
>
0
)
timer
.
TurnOn
();
std
::
cout
<<
"~=~=~=~=~=~ Run Start"
<<
std
::
endl
;
r
->
Run
();
timer
.
TurnOff
();
if
(
verbosity
>
0
)
timer
.
TurnOff
();
std
::
cout
<<
std
::
endl
<<
"~=~=~=~=~=~ Run Stop"
<<
std
::
endl
;
delete
r
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment