/[PAMELA software]/quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc
ViewVC logotype

Diff of /quicklook/tracker/flight/src/FTrkScanQLook_EXPERT.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by pam-fi, Fri Dec 8 03:59:34 2006 UTC revision 1.16 by pam-fi, Sun Dec 24 00:59:04 2006 UTC
# Line 15  Line 15 
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 va1, TString format);  extern void FTrkScanQLook_EXPERT(TString file, TString outdir, Int_t event, Int_t va1, Int_t value, TString format);
19  extern void info();  extern void info();
20    
21  void usage(){    void usage(){  
# Line 25  void usage(){   Line 25  void usage(){  
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 |event| events 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");    printf("\t -va1:         which va1 to analyze [default = 0] (the standard is: DSP*100+VA1)\n");  
29      printf("\t -value:       number of events to store in the .dat file with va1 values*10 + # of calibration (if #of cal = 0, select all calibrations)\n");
30    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");
31    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");
32    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");
# Line 35  void usage(){   Line 36  void usage(){  
36  int main(int argc, char* argv[]){  int main(int argc, char* argv[]){
37    
38    TString FILE,OUTDIR="./",FORMAT="pdf";    TString FILE,OUTDIR="./",FORMAT="pdf";
39    Int_t EVENT=0,VA1=0;    Int_t EVENT=0,VA1=0,VALUE=0;
40    bool beverbose = false;    bool beverbose = false;
41    int nul = 0;    int nul = 0;
42    
# Line 44  int main(int argc, char* argv[]){ Line 45  int main(int argc, char* argv[]){
45        info();        info();
46        return(0);        return(0);
47      };      };
48      if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>11){      if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>13){
49        usage();        usage();
50        return(0);        return(0);
51      }      }
# Line 61  int main(int argc, char* argv[]){ Line 62  int main(int argc, char* argv[]){
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], "-event")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format")||!strcmp(argv[i], "-event") || !strcmp(argv[i], "-value") || !strcmp(argv[i], "-va1")){
66              printf( "\n-outDir needs arguments. \n");              printf( "\n-outDir needs arguments. \n");
67              usage();              usage();
68              return(0);              return(0);
# Line 72  int main(int argc, char* argv[]){ Line 73  int main(int argc, char* argv[]){
73            }            }
74          }          }
75          if (!strcmp(argv[i], "-format")){          if (!strcmp(argv[i], "-format")){
76            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")||!strcmp(argv[i], "-event")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")||!strcmp(argv[i], "-event") || !strcmp(argv[i], "-value") || !strcmp(argv[i], "-va1")){
77              printf( "\n-format needs arguments. \n");              printf( "\n-format needs arguments. \n");
78              usage();              usage();
79              return(0);              return(0);
# Line 84  int main(int argc, char* argv[]){ Line 85  int main(int argc, char* argv[]){
85          }          }
86    
87          if (!strcmp(argv[i], "-event")){          if (!strcmp(argv[i], "-event")){
88            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-va1")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-va1") || !strcmp(argv[i], "-value")){
89              printf( "\n-event needs arguments. \n");              printf( "\n-event needs arguments. \n");
90              usage();              usage();
91              return(0);              return(0);
# Line 96  int main(int argc, char* argv[]){ Line 97  int main(int argc, char* argv[]){
97          }          }
98    
99          if (!strcmp(argv[i], "-va1")){          if (!strcmp(argv[i], "-va1")){
100            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event") || !strcmp(argv[i], "-value")){
101              printf( "\n-va1 needs arguments. \n");              printf( "\n-va1 needs arguments. \n");
102              usage();              usage();
103              return(0);              return(0);
# Line 105  int main(int argc, char* argv[]){ Line 106  int main(int argc, char* argv[]){
106              VA1 = atoi(argv[i]);              VA1 = atoi(argv[i]);
107              continue;              continue;
108            }            }
109            }      
110    
111            if (!strcmp(argv[i], "-value")){
112              if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir")|| !strcmp(argv[i], "-format") || !strcmp(argv[i], "-event") || !strcmp(argv[i], "-va1")){
113                printf( "\n-value needs arguments. \n");
114                usage();
115                return(0);
116              }
117              else{
118                VALUE = atoi(argv[i]);
119                continue;
120              }
121          }          }
122                    
123          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")){          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") && strcmp(argv[i], "-value")){
124            printf( "\n------>Warning: WRONG OPTIONS!\n");            printf( "\n------>Warning: WRONG OPTIONS!\n");
125            usage();            usage();
126            return(0);            return(0);
# Line 133  int main(int argc, char* argv[]){ Line 146  int main(int argc, char* argv[]){
146    };    };
147    printf("\n Welcome to FTrkScanQLook! \n\n");    printf("\n Welcome to FTrkScanQLook! \n\n");
148    //    //
149    FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,VA1,FORMAT);    FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,VA1,VALUE,FORMAT);
150    //    //
151    if ( !beverbose ) close(nul);    if ( !beverbose ) close(nul);
152    return(0);    return(0);

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.23