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

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

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

revision 1.2 by pam-fi, Thu Jun 1 15:23:13 2006 UTC revision 1.11 by mocchiut, Fri Jan 17 15:10:43 2014 UTC
# Line 2  Line 2 
2   * FTrkCalibQLook_EXPERT.cc   * FTrkCalibQLook_EXPERT.cc
3   *   *
4   * autor: D.Fedele   * autor: D.Fedele
5   * version 2.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   *      step - select =1 in order to analyze one event at time   *      step - select =1 in order to analyze one event at time
9   *      fromevent - first event to analyze   *      fromevent - first event to analyze
10   *      toevent - last event to analyze   *      toevent - last event to analyze
11   *      outdir - total path of output file   *      outDir - total path of output file
12   *      format - extension of output file (pdf,ps,gif,jpg)   *      format - extension of output file (pdf,ps,gif,jpg)
13   *   *
14   */   */
15  #include <TString.h>  #include <TString.h>
16  #include <fcntl.h>  #include <fcntl.h>
17  #include <unistd.h>  #include <unistd.h>
18    #include <cstdlib>
19    #include <sys/stat.h>
20  extern void FTrkCalibQLook_EXPERT(TString file, Int_t step, Int_t fromevent, Int_t toevent, TString outdir, TString format);  extern void FTrkCalibQLook_EXPERT(TString file, Int_t step, Int_t fromevent, Int_t toevent, TString outdir, TString format);
21  extern void info();  extern void info();
22    
# Line 28  void usage(){   Line 29  void usage(){  
29    printf("\t -step:        select =1 in order to analyze one event at time [default = 0] \n");    printf("\t -step:        select =1 in order to analyze one event at time [default = 0] \n");
30    printf("\t -fromev:      first event to analyze [default = 0] \n");    printf("\t -fromev:      first event to analyze [default = 0] \n");
31    printf("\t -toev:        last event to analyze  [default = 0] \n");    printf("\t -toev:        last event to analyze  [default = 0] \n");
32    printf("\t -outdir:      output directory [default = ./] \n");    printf("\t -outDir:      path of the output directory [default = ./] (with or without final '/')\n");
33    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");
34    printf("\nExamples:\n\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v \n\n");    printf("\nExamples:\n\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v \n\n");
35    printf("\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg\n\n");    printf("\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg\n\n");
36    printf("\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg -outdir ~/tmp/ \n\n");    printf("\tFTrkCalibQLook_EXPERT /home/pamela/filesfromyoda/DW_050523_01600.root -v -format jpg -outDir ~/tmp/ \n\n");
37  }  }
38    
39    
# Line 65  int main(int argc,char* argv[]){ Line 66  int main(int argc,char* argv[]){
66          if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") )          if ( !strcmp(argv[i],"-v") || !strcmp(argv[i],"--verbose") )
67            beverbose = true;            beverbose = true;
68                                    
69          if (!strcmp(argv[i], "-outdir")){          if (!strcmp(argv[i], "-outDir")){
70            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){
71              printf( "\n-outdir needs arguments. \n");              printf( "\n-outDir needs arguments. \n");
72              usage();              usage();
73              return(0);              return(0);
74            }            }
# Line 78  int main(int argc,char* argv[]){ Line 79  int main(int argc,char* argv[]){
79          }          }
80                    
81          if (!strcmp(argv[i], "-step")){          if (!strcmp(argv[i], "-step")){
82            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outdir")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-outDir")){
83              printf( "\n-step needs arguments. \n");              printf( "\n-step needs arguments. \n");
84              usage();              usage();
85              return(0);              return(0);
# Line 90  int main(int argc,char* argv[]){ Line 91  int main(int argc,char* argv[]){
91          }          }
92    
93          if (!strcmp(argv[i], "-fromev")){          if (!strcmp(argv[i], "-fromev")){
94            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-outdir") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-outDir") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){
95              printf( "\n-fromev needs arguments. \n");              printf( "\n-fromev needs arguments. \n");
96              usage();              usage();
97              return(0);              return(0);
# Line 102  int main(int argc,char* argv[]){ Line 103  int main(int argc,char* argv[]){
103          }          }
104                    
105          if (!strcmp(argv[i], "-toev")){          if (!strcmp(argv[i], "-toev")){
106            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-outdir") || !strcmp(argv[i], "-step")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-format") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-outDir") || !strcmp(argv[i], "-step")){
107              printf( "\n-toev needs arguments. \n");              printf( "\n-toev needs arguments. \n");
108              usage();              usage();
109              return(0);              return(0);
# Line 114  int main(int argc,char* argv[]){ Line 115  int main(int argc,char* argv[]){
115          }          }
116    
117          if (!strcmp(argv[i], "-format")){          if (!strcmp(argv[i], "-format")){
118            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outdir") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){            if (++i >= argc || !strcmp(argv[i],"-v") || !strcmp(argv[i], "-outDir") || !strcmp(argv[i], "-fromev") || !strcmp(argv[i], "-toev") || !strcmp(argv[i], "-step")){
119              printf( "\n-format needs arguments. \n");              printf( "\n-format needs arguments. \n");
120              usage();              usage();
121              return(0);              return(0);
# Line 124  int main(int argc,char* argv[]){ Line 125  int main(int argc,char* argv[]){
125              continue;              continue;
126            }            }
127          }          }
128    
129            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") && strcmp(argv[i], "-step")){
130              printf( "\n------>Warning: WRONG OPTIONS!\n");
131              usage();
132              return(0);
133            }
134        }        }
135      }      }
136    }    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.23