Skip to content
Snippets Groups Projects
Commit 76e85140 authored by Chad Lantz's avatar Chad Lantz
Browse files

Added pmt gain file argument option

parent 3d7978c6
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment