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
333fda94
Commit
333fda94
authored
Oct 22, 2021
by
Chad Lantz
Browse files
Added flags for config, alignment, and timing files along with default behaviors for each
parent
d6779df4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Analysis/include/DataReader2021.h
View file @
333fda94
...
...
@@ -50,8 +50,8 @@ class DataReader2021{
void
ReadListOfFiles
(
std
::
string
listname
);
void
LoadAlignmentFile
(
std
::
string
_inFile
=
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/Alignment_2021.xml"
)
);
void
LoadConfigurationFile
(
std
::
string
_inFile
=
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/ConfigFile2021.xml"
)
);
void
LoadAlignmentFile
(
std
::
string
_inFile
=
""
);
void
LoadConfigurationFile
(
std
::
string
_inFile
=
""
);
void
LoadTimingFile
(
std
::
string
_inFile
=
""
);
void
SetDebugMode
(
)
{
m_debug
=
true
;
}
void
SetVerbosity
(
int
_level
){
m_verbose
=
_level
;
}
...
...
Analysis/src/DataReader2021.cpp
View file @
333fda94
...
...
@@ -170,7 +170,7 @@ void DataReader2021::ReadListOfFiles( std::string listname ){
* @param _inFile
*/
void
DataReader2021
::
LoadAlignmentFile
(
std
::
string
_inFile
){
if
(
_inFile
==
""
)
_inFile
=
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/Alignment_2021.xml"
);
m_XMLparser
=
new
XMLSettingsReader
();
if
(
!
m_XMLparser
->
parseFile
(
_inFile
))
{
...
...
@@ -215,7 +215,7 @@ void DataReader2021::LoadAlignmentFile(std::string _inFile ){
* @param _inFile
*/
void
DataReader2021
::
LoadConfigurationFile
(
std
::
string
_inFile
){
if
(
_inFile
==
""
)
_inFile
=
std
::
getenv
(
"JZCaPA"
)
+
std
::
string
(
"/Utils/ConfigFile2021.xml"
);
m_XMLparser
=
new
XMLSettingsReader
();
if
(
!
m_XMLparser
->
parseFile
(
_inFile
))
{
...
...
Analysis/userFunctions/AnalysisExample2021.cpp
View file @
333fda94
...
...
@@ -21,7 +21,8 @@
namespace
{
void
PrintUsage
()
{
std
::
cout
<<
" Usage: AnalysisExample2021 [-d /path/to/input/files/ ] [-f /list/of.root /files/here.root]"
<<
std
::
endl
<<
" [-o /output/directory/] [-n #events] [--help]"
<<
std
::
endl
;
<<
" [-o /output/directory/] [-c /config/file.xml] [-a /alignment/file.xml]"
<<
std
::
endl
<<
" [-t /timing/file.txt] [-n #events] [--help]"
<<
std
::
endl
;
}
}
...
...
@@ -33,6 +34,9 @@ void PrintHelp(){
std
::
cout
<<
" d Path to directory with files to be processed"
<<
std
::
endl
;
std
::
cout
<<
" o Output file directory"
<<
std
::
endl
;
std
::
cout
<<
" n Maximum number of events to be processed for a given run"
<<
std
::
endl
;
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
;
}
...
...
@@ -72,6 +76,9 @@ int main(int argc, char *argv[]){
std
::
string
fNameIn
=
""
;
// Read from directory
std
::
string
output_dir
=
""
;
std
::
string
path_to_datafiles
=
""
;
std
::
string
config_file
=
""
;
std
::
string
alignment_file
=
""
;
std
::
string
timing_file
=
(
std
::
string
)
std
::
getenv
(
"JZCaPA"
)
+
"/Utils/Timing_data/2021_PreliminaryTiming.txt"
;
std
::
vector
<
std
::
string
>
root_files
;
...
...
@@ -89,6 +96,9 @@ int main(int argc, char *argv[]){
}
else
if
(
TString
(
argv
[
i
])
==
"-o"
)
output_dir
=
argv
[
i
+
1
];
else
if
(
TString
(
argv
[
i
])
==
"-n"
)
maxEvents
=
atoi
(
argv
[
i
+
1
]);
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
])
==
"--help"
)
PrintHelp
();
else
{
PrintUsage
();
...
...
@@ -119,7 +129,7 @@ int main(int argc, char *argv[]){
//ADD DETECTORS FOR WF ANALYSIS (PROCESSING OF RAW SIGNALS)
r
->
SelectDetectorForAnalysis
(
true
,
true
,
false
,
true
);
//(_useUEM, _usePFRPD, _useTRPD, _useZDCs)
std
::
cout
<<
std
::
endl
<<
"============ LoadConfigurationFile ============"
<<
std
::
endl
<<
std
::
endl
;
r
->
LoadConfigurationFile
();
r
->
LoadConfigurationFile
(
config_file
);
r
->
GetDetector
(
"PFRPD"
)
->
SetWFAthresholds
(
3.2
,
28
);
// r->GetDetector("TRPD")->SetWFAthresholds( 30, 4 );
...
...
@@ -144,9 +154,9 @@ int main(int argc, char *argv[]){
r
->
AddDetectorAnalysis
(
new
EMAnalysis
()
);
std
::
cout
<<
std
::
endl
<<
"============ LoadAlignmentFile ============"
<<
std
::
endl
<<
std
::
endl
;
r
->
LoadAlignmentFile
();
r
->
LoadAlignmentFile
(
alignment_file
);
std
::
cout
<<
std
::
endl
<<
"============ LoadTimingFile ============"
<<
std
::
endl
<<
std
::
endl
;
r
->
LoadTimingFile
(
(
std
::
string
)
std
::
getenv
(
"JZCaPA"
)
+
"/Utils/Timing_data/2021_PreliminaryTiming.txt"
);
r
->
LoadTimingFile
(
timing_file
);
std
::
cout
<<
"~=~=~=~=~=~ Run Start"
<<
std
::
endl
;
r
->
EnablePlotLabel
();
if
(
maxEvents
!=
0
)
r
->
SetMaxEvents
(
maxEvents
);
...
...
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