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
76e85140
Commit
76e85140
authored
Apr 24, 2022
by
Chad Lantz
Browse files
Added pmt gain file argument option
parent
3d7978c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Analysis/include/DataReader2021.h
View file @
76e85140
...
...
@@ -51,6 +51,7 @@ class DataReader2021{
void
LoadConfigurationFile
(
std
::
string
_inFile
=
""
);
void
LoadTimingFile
(
std
::
string
_inFile
=
""
);
void
LoadSurveyFile
(
std
::
string
_inFile
=
""
);
void
SetPMTgainFile
(
std
::
string
_inFile
=
""
){
m_gain_file
=
_inFile
;
};
void
SetDebugMode
(
)
{
m_debug
=
true
;
}
void
SetVerbosity
(
int
_level
){
m_verbose
=
_level
;
}
void
SetOutputDirectory
(
std
::
string
_dir
){
m_outputDir
=
_dir
;
}
...
...
@@ -88,6 +89,8 @@ class DataReader2021{
std
::
string
m_outputDir
=
""
;
// Output tag for file/directory naming
std
::
string
m_outputTag
=
""
;
// Root file containing TGraphs of PMT gain curves
std
::
string
m_gain_file
=
""
;
//Maximum events to be processed in a run
int
m_maxEvents
=
-
1
;
...
...
Analysis/src/DataReader2021.cpp
View file @
76e85140
...
...
@@ -204,7 +204,13 @@ void DataReader2021::LoadConfigurationFile(std::string _inFile ){
std
::
cout
<<
"Loading .xml Configuration File..."
<<
std
::
endl
;
std
::
cout
<<
"Found "
<<
m_XMLparser
->
getBaseNodeCount
(
"channel"
)
<<
" channel entries "
<<
std
::
endl
;
TFile
gainFile
(
(
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/PMTgain.root"
)).
c_str
(),
"read"
);
std
::
string
gainFP
;
if
(
m_gain_file
==
""
){
gainFP
=
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/PMTgain.root"
);
}
else
{
gainFP
=
m_gain_file
;
}
TFile
gainFile
(
gainFP
.
c_str
(),
"read"
);
std
::
vector
<
Channel
*
>
channelEntries
;
int
first_run
,
last_run
;
...
...
Analysis/userFunctions/AnalysisExample2021.cpp
View file @
76e85140
...
...
@@ -24,7 +24,7 @@ namespace {
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
<<
" [-s /survey/file.xml] [-t /timing/file.txt] [-tag tag] [-n #events]"
<<
std
::
endl
<<
" [-v (verbose)] [--help]"
<<
std
::
endl
;
<<
"
[-g /gain/file.root]
[-v (verbose)] [--help]"
<<
std
::
endl
;
}
}
...
...
@@ -40,6 +40,7 @@ void PrintHelp(){
std
::
cout
<<
" a Alignment file to be used"
<<
std
::
endl
;
std
::
cout
<<
" s Survey file to be used"
<<
std
::
endl
;
std
::
cout
<<
" t Timing file to be used"
<<
std
::
endl
;
std
::
cout
<<
" g Path to root file containing TGraphs with PMT gain curves"
<<
std
::
endl
;
std
::
cout
<<
" tag Tag the output directory/file"
<<
std
::
endl
;
std
::
cout
<<
" v Verbose. Currently prints event#, CPU/RAM usage if flag is used. Takes no argument"
<<
std
::
endl
;
...
...
@@ -84,6 +85,7 @@ int main(int argc, char *argv[]){
std
::
string
config_file
=
""
;
std
::
string
alignment_file
=
""
;
std
::
string
survey_file
=
""
;
std
::
string
gain_file
=
""
;
std
::
string
output_tag
=
""
;
std
::
string
timing_file
=
(
std
::
string
)
std
::
getenv
(
"JZCaPA"
)
+
"/Utils/Timing_data/2021_PreliminaryTiming.txt"
;
int
verbosity
=
0
;
...
...
@@ -107,6 +109,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
])
==
"-s"
)
survey_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-g"
)
gain_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-t"
)
timing_file
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-tag"
)
output_tag
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-v"
)
verbosity
=
1
;
...
...
@@ -188,6 +191,7 @@ int main(int argc, char *argv[]){
std
::
cout
<<
std
::
endl
<<
"============ LoadConfigurationFile ============"
<<
std
::
endl
<<
std
::
endl
;
r
->
SetPMTgainFile
(
gain_file
);
r
->
LoadConfigurationFile
(
config_file
);
//Add pre analysis
...
...
Write
Preview
Supports
Markdown
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