2 |
* FTrkScanQLook_EXPERT.cc |
* FTrkScanQLook_EXPERT.cc |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r09 |
* 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 |
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 -event: which event to analyze [default = 0] (if negative analyze the third event after a calibration)\n"); |
28 |
printf("\t -outDir: path of the output directory [default = ./] (with or without final '/')\n"); |
printf("\t -outDir: path of the output directory [default = ./] (with or without final '/')\n"); |
29 |
printf("\t -format: format of the output file (without .) [default = pdf] (accepted formats: pdf, ps, png, jpg, gif)\n"); |
printf("\t -format: format of the output file (without .) [default = pdf] (accepted formats: pdf, ps, png, jpg, gif)\n"); |
30 |
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"); |
34 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
35 |
|
|
36 |
TString FILE,OUTDIR="./",FORMAT="pdf"; |
TString FILE,OUTDIR="./",FORMAT="pdf"; |
37 |
|
Int_t EVENT=0; |
38 |
bool beverbose = false; |
bool beverbose = false; |
39 |
int nul = 0; |
int nul = 0; |
40 |
|
|
41 |
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); |
|
|
} |
|
42 |
if ( !strcmp(argv[1],"--version") ){ |
if ( !strcmp(argv[1],"--version") ){ |
43 |
info(); |
info(); |
44 |
return(0); |
return(0); |
45 |
}; |
}; |
46 |
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>7){ |
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>9){ |
47 |
usage(); |
usage(); |
48 |
return(0); |
return(0); |
49 |
} |
} |
60 |
beverbose = true; |
beverbose = true; |
61 |
|
|
62 |
if (!strcmp(argv[i], "-outDir")){ |
if (!strcmp(argv[i], "-outDir")){ |
63 |
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")){ |
64 |
printf( "\n-outDir needs arguments. \n"); |
printf( "\n-outDir needs arguments. \n"); |
65 |
usage(); |
usage(); |
66 |
return(0); |
return(0); |
71 |
} |
} |
72 |
} |
} |
73 |
if (!strcmp(argv[i], "-format")){ |
if (!strcmp(argv[i], "-format")){ |
74 |
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")){ |
75 |
printf( "\n-format needs arguments. \n"); |
printf( "\n-format needs arguments. \n"); |
76 |
usage(); |
usage(); |
77 |
return(0); |
return(0); |
81 |
continue; |
continue; |
82 |
} |
} |
83 |
} |
} |
84 |
|
|
85 |
|
if (!strcmp(argv[i], "-event")){ |
86 |
|
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format")){ |
87 |
|
printf( "\n-event needs arguments. \n"); |
88 |
|
usage(); |
89 |
|
return(0); |
90 |
|
} |
91 |
|
else{ |
92 |
|
EVENT = atoi(argv[i]); |
93 |
|
continue; |
94 |
|
} |
95 |
|
} |
96 |
|
|
97 |
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")){ |
98 |
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
99 |
usage(); |
usage(); |
100 |
return(0); |
return(0); |
102 |
} |
} |
103 |
} |
} |
104 |
} |
} |
105 |
|
|
106 |
|
else if(argc==1){ |
107 |
|
printf("\n\tYou have to insert at least the file to analyze \n"); |
108 |
|
usage(); |
109 |
|
return(0); |
110 |
|
} |
111 |
|
|
112 |
|
|
113 |
if ( !beverbose ){ |
if ( !beverbose ){ |
120 |
}; |
}; |
121 |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
122 |
// |
// |
123 |
FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT); |
FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,0,FORMAT); |
124 |
// |
// |
125 |
if ( !beverbose ) close(nul); |
if ( !beverbose ) close(nul); |
126 |
return(0); |
return(0); |