2 |
* FTrkScanQLook_EXPERT.cc |
* FTrkScanQLook_EXPERT.cc |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r.. |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the path to the root file to analyze |
* file - the path to the root file to analyze |
8 |
* outdir - total path of output file |
* outDir - total path of output file |
9 |
* event - the number of the single event to analyze |
* event - the number of the single event to analyze |
10 |
* DSPprint - the number of a particular DSP to draw (0 don't draw) |
* DSPprint - the number of a particular DSP to draw (0 don't draw) |
11 |
* format - extension of output file (pdf,ps,gif,jpg) |
* format - extension of output file (pdf,ps,gif,jpg) |
24 |
printf("\t file: path of the root file to analyze (give at least this parameter) \n"); |
printf("\t file: path of the root file to analyze (give at least this parameter) \n"); |
25 |
printf("\nOPTIONS:\n"); |
printf("\nOPTIONS:\n"); |
26 |
printf("\t -v be verbose \n"); |
printf("\t -v be verbose \n"); |
27 |
printf("\t -outdir: output directory [default = ./] \n"); |
printf("\t -outDir: path of the output directory [default = ./] (with or without final '/')\n"); |
28 |
printf("\t -format: format of the output file (without .) [default = pdf] \n"); |
printf("\t -format: format of the output file (without .) [default = pdf] (accepted formats: pdf, ps, png, jpg, gif)\n"); |
29 |
printf("\nExamples:\n\tFTrkScanQLook_EXPERT /home/pamela/filesfromyoda/DW_xxxxxx_yyyy.root \n\n"); |
printf("\nExamples:\n\tFTrkScanQLook_EXPERT /home/pamela/filesfromyoda/DW_xxxxxx_yyyy.root \n\n"); |
30 |
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"); |
31 |
} |
} |
32 |
|
|
33 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
37 |
int nul = 0; |
int nul = 0; |
38 |
|
|
39 |
if(argc>1){ |
if(argc>1){ |
|
if(argc<3){ |
|
|
printf("\n\tYou have to insert at least the file to analyze \n"); |
|
|
usage(); |
|
|
return(0); |
|
|
} |
|
40 |
if ( !strcmp(argv[1],"--version") ){ |
if ( !strcmp(argv[1],"--version") ){ |
41 |
info(); |
info(); |
42 |
return(0); |
return(0); |
57 |
if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") ) |
if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") ) |
58 |
beverbose = true; |
beverbose = true; |
59 |
|
|
60 |
if (!strcmp(argv[i], "-outdir")){ |
if (!strcmp(argv[i], "-outDir")){ |
61 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")){ |
62 |
printf( "\n-outdir needs arguments. \n"); |
printf( "\n-outDir needs arguments. \n"); |
63 |
usage(); |
usage(); |
64 |
return(0); |
return(0); |
65 |
} |
} |
69 |
} |
} |
70 |
} |
} |
71 |
if (!strcmp(argv[i], "-format")){ |
if (!strcmp(argv[i], "-format")){ |
72 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outdir")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")){ |
73 |
printf( "\n-format needs arguments. \n"); |
printf( "\n-format needs arguments. \n"); |
74 |
usage(); |
usage(); |
75 |
return(0); |
return(0); |
79 |
continue; |
continue; |
80 |
} |
} |
81 |
} |
} |
82 |
|
|
83 |
|
if( strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose")){ |
84 |
|
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
85 |
|
usage(); |
86 |
|
return(0); |
87 |
|
} |
88 |
} |
} |
89 |
} |
} |
90 |
} |
} |
91 |
|
|
92 |
|
else if(argc==1){ |
93 |
|
printf("\n\tYou have to insert at least the file to analyze \n"); |
94 |
|
usage(); |
95 |
|
return(0); |
96 |
|
} |
97 |
|
|
98 |
|
|
99 |
if ( !beverbose ){ |
if ( !beverbose ){ |
107 |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
108 |
// |
// |
109 |
FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT); |
FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT); |
|
FTrkScanQLook_EXPERT(FILE,OUTDIR,3,0,FORMAT); |
|
110 |
// |
// |
111 |
if ( !beverbose ) close(nul); |
if ( !beverbose ) close(nul); |
112 |
return(0); |
return(0); |