Commit 333fda94 authored by Chad Lantz's avatar Chad Lantz
Browse files

Added flags for config, alignment, and timing files along with default behaviors for each

parent d6779df4
......@@ -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; }
......
......@@ -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)) {
......
......@@ -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 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment