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) |
* va1 - the number of the single va1 to analyze |
11 |
* format - extension of output file (pdf,ps,gif,jpg) |
* format - extension of output file (pdf,ps,gif,jpg) |
12 |
* |
* |
13 |
*/ |
*/ |
15 |
#include <fcntl.h> |
#include <fcntl.h> |
16 |
#include <unistd.h> |
#include <unistd.h> |
17 |
|
|
18 |
extern void FTrkScanQLook_EXPERT(TString file, TString outdir, Int_t event, Int_t DSPprint, TString format); |
extern void FTrkScanQLook_EXPERT(TString file, TString outdir, Int_t event, Int_t va1, TString format); |
19 |
extern void info(); |
extern void info(); |
20 |
|
|
21 |
void usage(){ |
void usage(){ |
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"); |
printf("\t -event: which event to analyze [default = 0] (if negative analyze |event| events after a calibration)\n"); |
28 |
|
printf("\t -va1: which va1 to analyze [default = 0] (the standard is: DSP*100+VA1)\n"); |
29 |
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"); |
30 |
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"); |
31 |
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"); |
32 |
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"); |
33 |
} |
} |
34 |
|
|
35 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
36 |
|
|
37 |
TString FILE,OUTDIR="./",FORMAT="pdf"; |
TString FILE,OUTDIR="./",FORMAT="pdf"; |
38 |
Int_t EVENT=0; |
Int_t EVENT=0,VA1=0; |
39 |
bool beverbose = false; |
bool beverbose = false; |
40 |
int nul = 0; |
int nul = 0; |
41 |
|
|
44 |
info(); |
info(); |
45 |
return(0); |
return(0); |
46 |
}; |
}; |
47 |
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>9){ |
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>11){ |
48 |
usage(); |
usage(); |
49 |
return(0); |
return(0); |
50 |
} |
} |
84 |
} |
} |
85 |
|
|
86 |
if (!strcmp(argv[i], "-event")){ |
if (!strcmp(argv[i], "-event")){ |
87 |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format")){ |
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-va1")){ |
88 |
printf( "\n-event needs arguments. \n"); |
printf( "\n-event needs arguments. \n"); |
89 |
usage(); |
usage(); |
90 |
return(0); |
return(0); |
94 |
continue; |
continue; |
95 |
} |
} |
96 |
} |
} |
97 |
|
|
98 |
|
if (!strcmp(argv[i], "-va1")){ |
99 |
|
if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event")){ |
100 |
|
printf( "\n-va1 needs arguments. \n"); |
101 |
|
usage(); |
102 |
|
return(0); |
103 |
|
} |
104 |
|
else{ |
105 |
|
VA1 = atoi(argv[i]); |
106 |
|
continue; |
107 |
|
} |
108 |
|
} |
109 |
|
|
110 |
if( strcmp(argv[i], "-format") && strcmp(argv[i], "-outDir") && strcmp(argv[i],"-v") && strcmp(argv[i],"--verbose") && strcmp(argv[i], "-event")){ |
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")){ |
111 |
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
printf( "\n------>Warning: WRONG OPTIONS!\n"); |
112 |
usage(); |
usage(); |
113 |
return(0); |
return(0); |
133 |
}; |
}; |
134 |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
printf("\n Welcome to FTrkScanQLook! \n\n"); |
135 |
// |
// |
136 |
FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,0,FORMAT); |
FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,VA1,FORMAT); |
137 |
// |
// |
138 |
if ( !beverbose ) close(nul); |
if ( !beverbose ) close(nul); |
139 |
return(0); |
return(0); |