/[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.1 by pam-fi, Wed May 10 09:47:45 2006 UTC revision 1.14 by pam-fi, Fri Dec 8 03:59:34 2006 UTC
# Line 2  Line 2 
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)   *      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   */   */
14  #include <TString.h>  #include <TString.h>
15  #include <fcntl.h>  #include <fcntl.h>
16    #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(){  
# Line 23  void usage(){   Line 24  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 -outdir:      output directory [default = ./] \n");    printf("\t -event:       which event to analyze [default = 0] (if negative analyze |event| events after a calibration)\n");  
28    printf("\t -format:      format of the output file (without .) [default = pdf] \n");    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");
30      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,VA1=0;
39    bool beverbose = false;    bool beverbose = false;
40    int nul = 0;    int nul = 0;
41    
42    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);  
     }  
43      if ( !strcmp(argv[1],"--version") ){      if ( !strcmp(argv[1],"--version") ){
44        info();        info();
45        return(0);        return(0);
46      };      };
47      if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>7){      if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || argc>11){
48        usage();        usage();
49        return(0);        return(0);
50      }      }
# Line 61  int main(int argc, char* argv[]){ Line 60  int main(int argc, char* argv[]){
60          if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") )          if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") )
61            beverbose = true;            beverbose = true;
62                    
63          if (!strcmp(argv[i], "-outdir")){          if (!strcmp(argv[i], "-outDir")){
64            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")){
65              printf( "\n-outdir needs arguments. \n");              printf( "\n-outDir needs arguments. \n");
66              usage();              usage();
67              return(0);              return(0);
68            }            }
# Line 73  int main(int argc, char* argv[]){ Line 72  int main(int argc, char* argv[]){
72            }            }
73          }          }
74          if (!strcmp(argv[i], "-format")){          if (!strcmp(argv[i], "-format")){
75            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")){
76              printf( "\n-format needs arguments. \n");              printf( "\n-format needs arguments. \n");
77              usage();              usage();
78              return(0);              return(0);
# Line 83  int main(int argc, char* argv[]){ Line 82  int main(int argc, char* argv[]){
82              continue;              continue;
83            }            }
84          }          }
85    
86            if (!strcmp(argv[i], "-event")){
87              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");
89                usage();
90                return(0);
91              }
92              else{
93                EVENT = atoi(argv[i]);
94                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") && strcmp(argv[i], "-va1")){
111              printf( "\n------>Warning: WRONG OPTIONS!\n");
112              usage();
113              return(0);
114            }
115        }        }
116      }      }
117    }    }
118    
119      else if(argc==1){
120        printf("\n\tYou have to insert at least the file to analyze \n");
121        usage();
122        return(0);
123      }
124                
125        
126    if ( !beverbose ){    if ( !beverbose ){
# Line 98  int main(int argc, char* argv[]){ Line 133  int main(int argc, char* argv[]){
133    };    };
134    printf("\n Welcome to FTrkScanQLook! \n\n");    printf("\n Welcome to FTrkScanQLook! \n\n");
135    //    //
136    FTrkScanQLook_EXPERT(FILE,OUTDIR,2,0,FORMAT);    FTrkScanQLook_EXPERT(FILE,OUTDIR,EVENT,VA1,FORMAT);
   FTrkScanQLook_EXPERT(FILE,OUTDIR,3,0,FORMAT);  
137    //    //
138    if ( !beverbose ) close(nul);    if ( !beverbose ) close(nul);
139    return(0);    return(0);

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

  ViewVC Help
Powered by ViewVC 1.1.23