--- quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc 2006/06/01 15:23:13 1.2 +++ quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc 2006/12/06 10:06:27 1.13 @@ -2,10 +2,10 @@ * FTrkScanQLook_EXPERT.cc * * autor: D.Fedele - * version 2.0 + * version v1r.. * Parameters: * file - the path to the root file to analyze - * outdir - total path of output file + * 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) * format - extension of output file (pdf,ps,gif,jpg) @@ -24,29 +24,26 @@ 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 -outdir: output directory [default = ./] \n"); - printf("\t -format: format of the output file (without .) [default = pdf] \n"); + printf("\t -event: which event to analyze [default = 0] (if negative analyze the third event after a calibration)\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 -outDir ~/tmp/\n\n"); } int main(int argc, char* argv[]){ TString FILE,OUTDIR="./",FORMAT="pdf"; + Int_t EVENT=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>9){ usage(); return(0); } @@ -62,9 +59,9 @@ if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") ) beverbose = true; - if (!strcmp(argv[i], "-outdir")){ - if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")){ - printf( "\n-outdir needs arguments. \n"); + if (!strcmp(argv[i], "-outDir")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")||!strcmp(argv[i], "-event")){ + printf( "\n-outDir needs arguments. \n"); usage(); return(0); } @@ -74,7 +71,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")){ printf( "\n-format needs arguments. \n"); usage(); return(0); @@ -84,9 +81,33 @@ continue; } } + + if (!strcmp(argv[i], "-event")){ + if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format")){ + printf( "\n-event needs arguments. \n"); + usage(); + return(0); + } + else{ + EVENT = atoi(argv[i]); + continue; + } + } + + if( strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose") && strcmp(argv[i], "-event")){ + printf( "\n------>Warning: WRONG OPTIONS!\n"); + usage(); + return(0); + } } } } + + else if(argc==1){ + printf("\n\tYou have to insert at least the file to analyze \n"); + usage(); + return(0); + } if ( !beverbose ){ @@ -99,8 +120,7 @@ }; printf("\n Welcome to FTrkScanQLook! \n\n"); // - FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT); - FTrkScanQLook_EXPERT(FILE,OUTDIR,3,0,FORMAT); + FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,0,FORMAT); // if ( !beverbose ) close(nul); return(0);