2 |
* FTrkQLook_BASIC.cc |
* FTrkQLook_BASIC.cc |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 3.0 |
* version v1r.. |
6 |
* Parameters: |
* Parameters: |
7 |
* file - path of the root file to analyze (give at least this parameter) |
* file - path of the root file to analyze (give at least this parameter) |
8 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
9 |
* toevent - last event to analyze |
* toevent - last event to analyze |
10 |
* outdir - total path of output file |
* outDir - total path of output file |
11 |
* format - extension of output file (pdf,ps,gif,jpg) |
* format - extension of output file (pdf,ps,gif,jpg) |
12 |
* |
* |
13 |
*/ |
*/ |
26 |
printf("\t -v: be verbose \n"); |
printf("\t -v: be verbose \n"); |
27 |
printf("\t -fromev: first event to analyze [default = 0] \n"); |
printf("\t -fromev: first event to analyze [default = 0] \n"); |
28 |
printf("\t -toev: last event to analyze [default = 0] \n"); |
printf("\t -toev: last event to analyze [default = 0] \n"); |
29 |
printf("\t -outdir: output directory [default = ./] \n"); |
printf("\t -outDir: path of the output directory [default = ./] (with or without final '/')\n"); |
30 |
printf("\t -format: format for output file (without . )[default = pdf] \n"); |
printf("\t -format: format for output file (without . )[default = pdf] (accepted formats: pdf, ps, png, jpg, gif)\n"); |
31 |
printf("\nExamples:\n\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v \n\n"); |
printf("\nExamples:\n\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v \n\n"); |
32 |
printf("\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg\n\n"); |
printf("\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg\n\n"); |
33 |
printf("\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg -outdir ~/tmp/ \n\n"); |
printf("\tFTrkQLook_BASIC /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg -outDir ~/tmp/ \n\n"); |
34 |
} |
} |
35 |
|
|
36 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
61 |
if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") ) |
if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") ) |
62 |
beverbose = true; |
beverbose = true; |
63 |
|
|
64 |
if (!strcmp(argv[i], "-outdir")){ |
if (!strcmp(argv[i], "-outDir")){ |
65 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev")){ |
66 |
printf( "\n-outdir needs arguments. \n"); |
printf( "\n-outDir needs arguments. \n"); |
67 |
usage(); |
usage(); |
68 |
return(0); |
return(0); |
69 |
} |
} |
74 |
} |
} |
75 |
|
|
76 |
if (!strcmp(argv[i], "-fromev")){ |
if (!strcmp(argv[i], "-fromev")){ |
77 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outdir")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outDir")){ |
78 |
printf( "\n-fromev needs arguments. \n"); |
printf( "\n-fromev needs arguments. \n"); |
79 |
usage(); |
usage(); |
80 |
return(0); |
return(0); |
86 |
} |
} |
87 |
|
|
88 |
if (!strcmp(argv[i], "-toev")){ |
if (!strcmp(argv[i], "-toev")){ |
89 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-outdir")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-outDir")){ |
90 |
printf( "\n-toev needs arguments. \n"); |
printf( "\n-toev needs arguments. \n"); |
91 |
usage(); |
usage(); |
92 |
return(0); |
return(0); |
98 |
} |
} |
99 |
|
|
100 |
if (!strcmp(argv[i], "-format")){ |
if (!strcmp(argv[i], "-format")){ |
101 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outdir")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outDir")){ |
102 |
printf( "\n-format needs arguments. \n"); |
printf( "\n-format needs arguments. \n"); |
103 |
usage(); |
usage(); |
104 |
return(0); |
return(0); |
108 |
continue; |
continue; |
109 |
} |
} |
110 |
} |
} |
111 |
|
|
112 |
|
if(strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose") && strcmp(argv[i], "-fromev") && strcmp(argv[i], "-toev") ){ |
113 |
|
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
114 |
|
usage(); |
115 |
|
return(0); |
116 |
|
} |
117 |
} |
} |
118 |
} |
} |
119 |
} |
} |