--- quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc 2006/08/22 15:47:52 1.11 +++ quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc 2014/01/17 15:10:45 1.17 @@ -7,15 +7,16 @@ * file - the path to the root file to analyze * outDir - total path of output file * event - the number of the single event to analyze - * DSPprint - the number of a particular DSP to draw (0 don't draw) + * va1 - the number of the single va1 to analyze * format - extension of output file (pdf,ps,gif,jpg) * */ #include #include #include - -extern void FTrkScanQLook_EXPERT(TString file, TString outdir, Int_t event, Int_t DSPprint, TString format); +#include +#include +extern void FTrkScanQLook_EXPERT(TString file, TString outdir, Int_t event, Int_t va1, Int_t value, TString format); extern void info(); void usage(){ @@ -24,29 +25,28 @@ printf("\t file: path of the root file to analyze (give at least this parameter) \n"); printf("\nOPTIONS:\n"); printf("\t -v be verbose \n"); + printf("\t -event: which event to analyze [default = 0] (if negative analyze |event| events after a calibration)\n"); + printf("\t -va1: which va1 to analyze [default = 0] (the standard is: DSP*100+VA1)\n"); + printf("\t -value: number of events to store in the .dat file with va1 values*10 + # of calibration (if #of cal = 0, select all calibrations)\n"); printf("\t -outDir: path of the output directory [default = ./] (with or without final '/')\n"); printf("\t -format: format of the output file (without .) [default = pdf] (accepted formats: pdf, ps, png, jpg, gif)\n"); printf("\nExamples:\n\tFTrkScanQLook_EXPERT /home/pamela/filesfromyoda/DW_xxxxxx_yyyy.root \n\n"); - printf("\tFTrkScanQLook_EXPERT /home/pamela/filesfromyoda/DW_xxxxxx_yyyy.root -v -outDir ~/tmp/\n\n"); + printf("\tFTrkScanQLook_EXPERT /home/pamela/filesfromyoda/DW_xxxxxx_yyyy.root -v -va1 1123 -outDir ~/tmp/\n\n"); } int main(int argc, char* argv[]){ TString FILE,OUTDIR="./",FORMAT="pdf"; + Int_t EVENT=0,VA1=0,VALUE=0; bool beverbose = false; int nul = 0; if(argc>1){ - if(argc<3){ - printf("\n\tYou have to insert at least the file to analyze \n"); - usage(); - return(0); - } if ( !strcmp(argv[1],"--version") ){ info(); return(0); }; - if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>7){ + if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>13){ usage(); return(0); } @@ -63,7 +63,7 @@ beverbose = true; if (!strcmp(argv[i], "-outDir")){ - if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")||!strcmp(argv[i], "-event") || !strcmp(argv[i], "-value") || !strcmp(argv[i], "-va1")){ printf( "\n-outDir needs arguments. \n"); usage(); return(0); @@ -74,7 +74,7 @@ } } if (!strcmp(argv[i], "-format")){ - if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")||!strcmp(argv[i], "-event") || !strcmp(argv[i], "-value") || !strcmp(argv[i], "-va1")){ printf( "\n-format needs arguments. \n"); usage(); return(0); @@ -84,8 +84,44 @@ continue; } } + + if (!strcmp(argv[i], "-event")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-va1") || !strcmp(argv[i], "-value")){ + printf( "\n-event needs arguments. \n"); + usage(); + return(0); + } + else{ + EVENT = atoi(argv[i]); + continue; + } + } + + if (!strcmp(argv[i], "-va1")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event") || !strcmp(argv[i], "-value")){ + printf( "\n-va1 needs arguments. \n"); + usage(); + return(0); + } + else{ + VA1 = atoi(argv[i]); + continue; + } + } + + if (!strcmp(argv[i], "-value")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event") || !strcmp(argv[i], "-va1")){ + printf( "\n-value needs arguments. \n"); + usage(); + return(0); + } + else{ + VALUE = atoi(argv[i]); + continue; + } + } - if( strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose")){ + if( strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose") && strcmp(argv[i], "-event") && strcmp(argv[i], "-va1") && strcmp(argv[i], "-value")){ printf( "\n------>Warning: WRONG OPTIONS!\n"); usage(); return(0); @@ -93,6 +129,12 @@ } } } + + else if(argc==1){ + printf("\n\tYou have to insert at least the file to analyze \n"); + usage(); + return(0); + } if ( !beverbose ){ @@ -105,7 +147,7 @@ }; printf("\n Welcome to FTrkScanQLook! \n\n"); // - FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT); + FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,VA1,VALUE,FORMAT); // if ( !beverbose ) close(nul); return(0);