File indexing completed on 2026-08-26 08:26:15
0001 #include <iostream>
0002 #include <fstream>
0003 #include <vector>
0004 #include <map>
0005 #include <utility>
0006 #include <unistd.h> // Add for use on Mac OS -> Same goes for Analyses.cc
0007 #include <string>
0008 #include "TString.h"
0009 #include "TFile.h"
0010 #include "TTree.h"
0011 #include "TCanvas.h"
0012 #include "TF1.h"
0013 #include "TH1D.h"
0014 #include "TObjArray.h"
0015 #include "TObjString.h"
0016
0017 #include "Setup.h"
0018 #include "Calib.h"
0019 #include "Event.h"
0020 #include "Tile.h"
0021 #include "HGCROC.h"
0022 #include "EvaluateRecoEffiHGCROC.h"
0023
0024
0025 void PrintHelp(char* exe){
0026 std::cout<<"Usage:"<<std::endl;
0027 std::cout<<exe<<" [-option (arguments)]"<<std::endl;
0028 std::cout<<"Options:"<<std::endl;
0029 std::cout<<"-d [0-n] switch on debug info with debug level 0 to n"<<std::endl;
0030 std::cout<<"-i uuu path to the input file: .txt with list of .root files to process (mandatory)"<<std::endl;
0031 std::cout<<"-o output directory (mandatory)"<<std::endl;
0032 std::cout<<"-r path to the run list file (mandatory)"<<std::endl;
0033 std::cout<<"-u uuu path to unconverted files" << std::endl;
0034 std::cout<<"-h print help"<<std::endl;
0035 std::cout<<"Examples:"<<std::endl;
0036 std::cout<<exe<<"-i input.csv -o output/"<<std::endl;
0037 }
0038
0039
0040 int main(int argc, char* argv[]){
0041 if(argc<1) {
0042 PrintHelp( argv[0] );
0043 return 0;
0044 }
0045
0046 EvaluateRecoEffiGHCROC evaluation;
0047 int c;
0048 while( (c=getopt(argc,argv,"d:i:r:o:u:h"))!=-1){
0049 switch(c){
0050 case 'd':
0051 std::cout << "Enable debug " << optarg << std::endl;
0052 evaluation.EnableDebug( atoi(optarg) );
0053 break;
0054 case 'i':
0055 std::cout << "Input file set to: " << optarg << std::endl;
0056 evaluation.SetInputFile( Form("%s",optarg) );
0057 break;
0058 case 'r':
0059 std::cout << "Input list file set to " << optarg << std::endl;
0060 evaluation.SetRunListInput( Form("%s",optarg) );
0061 break;
0062 case 'o':
0063 std::cout << "Output directory set to: " << optarg << std::endl;
0064 evaluation.SetOutputDirectory( Form("%s", optarg) );
0065 break;
0066 case 'u':
0067 std::cout << "path to unconverted files: " << optarg << std::endl;
0068 evaluation.SetUnconvertedDirectory( Form("%s", optarg) );
0069 break;
0070 case 'h':
0071 PrintHelp( argv[0] );
0072 return 0;
0073 }
0074 }
0075 if( !evaluation.CheckAndOpenIO() ){
0076 std::cout<<"Check input files and configurations, inconsistency or error with I/O detected"<<std::endl;
0077 return -1;
0078 }
0079
0080 evaluation.Process();
0081 std::cout<<"Exiting"<<std::endl;
0082
0083 return 0;
0084 }