File indexing completed on 2026-01-07 09:25:16
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 "Caen.h"
0023 #include "CompareHGCROCCalib.h"
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 file list (mandatory)"<<std::endl;
0031 std::cout<<"-p set the plotting directory (mandatory)"<<std::endl;
0032 std::cout<<"-h print help"<<std::endl;
0033 std::cout<<"Examples:"<<std::endl;
0034 std::cout<<exe<<"-i input.csv -o output/"<<std::endl;
0035 }
0036
0037 int main(int argc, char* argv[]){
0038 if(argc<1) {
0039 PrintHelp( argv[0] );
0040 return 0;
0041 }
0042
0043 CompareHGCROCCalib compSamples;
0044 int c;
0045 while( (c=getopt(argc,argv,"d:i:p:h"))!=-1){
0046 switch(c){
0047 case 'd':
0048 std::cout << "Enable debug " << optarg << std::endl;
0049 compSamples.EnableDebug( atoi(optarg) );
0050 break;
0051 case 'i':
0052 std::cout << "Input file set to: " << optarg << std::endl;
0053 compSamples.SetInputFile( Form("%s",optarg) );
0054 break;
0055 case 'h':
0056 PrintHelp( argv[0] );
0057 return 0;
0058 case 'p':
0059 std::cout << "Plotting directory set to " << optarg << std::endl;
0060 compSamples.SetPlotDirectory( Form("%s",optarg) );
0061 break;
0062 }
0063 }
0064 if(!compSamples.CheckAndOpenIO()){
0065 std::cout<<"Check input and configurations, inconsistency or error with I/O detected"<<std::endl;
0066 PrintHelp(argv[0]);
0067 return -1;
0068 }
0069
0070 compSamples.Process();
0071 std::cout<<"Exiting"<<std::endl;
0072 return 0;
0073 }