/[PAMELA software]/DarthVader/TrackerLevel2/src/TrkProcess.cpp
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/TrkProcess.cpp

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

revision 1.11 by pam-fi, Mon Aug 20 16:07:16 2007 UTC revision 1.18 by pam-ts, Mon Jun 23 08:34:18 2014 UTC
# Line 16  TrkProcess::TrkProcess(){ Line 16  TrkProcess::TrkProcess(){
16      full1 = 0;      full1 = 0;
17      geth  = 0;      geth  = 0;
18      get2  = 1;      get2  = 1;
19        gete  = 1;
20        gete_ncheck = 10;
21        getn  = 1;
22        extAlgID = 202;
23      standalone = false;      standalone = false;
24      frame2 = "root";      frame2 = "root";
25      frame1 = "root";      frame1 = "root";
26      frameh = "root";      frameh = "root";
27        framee = "root";
28      outdir =  gSystem->WorkingDirectory();      outdir =  gSystem->WorkingDirectory();
29      pfolder = "/TrackerFolder";      pfolder = "/TrackerFolder";
30      if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;                if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;          
# Line 36  TrkProcess::TrkProcess(){ Line 41  TrkProcess::TrkProcess(){
41            
42      ostatus = 0;      ostatus = 0;
43    
44      npar=0;      npar = 0;
45    
46        nskip = 0;
47    
48        watch = false;
49    
50      TrkParams::SetTrackingMode();  //     TrkParams::SetTrackingMode();
51      TrkParams::SetPrecisionFactor();  //     TrkParams::SetPrecisionFactor();
52      TrkParams::SetStepMin();    //     TrkParams::SetStepMin();  
53        TrkParams::SetMiniDefault();
54      TrkParams::SetPFA();      TrkParams::SetPFA();
55  };  };
56                    
# Line 59  TrkProcess::TrkProcess(ULong64_t run, TF Line 69  TrkProcess::TrkProcess(ULong64_t run, TF
69      full1 = 0;      full1 = 0;
70      get2 = 1;      get2 = 1;
71      geth = 0;      geth = 0;
72        gete = 1;
73        gete_ncheck = 10;
74        getn = 1;
75        extAlgID = 202;
76      standalone = false;      standalone = false;
77      frame2 = "root";      frame2 = "root";
78      frame1 = "root";      frame1 = "root";
79      frameh = "root";      frameh = "root";
80        framee = "root";
81      pfolder = "/TrackerFolder";      pfolder = "/TrackerFolder";
82      file1 = "";      file1 = "";
83      if(f2->IsOpen()){      if(f2->IsOpen()){
# Line 89  TrkProcess::TrkProcess(ULong64_t run, TF Line 104  TrkProcess::TrkProcess(ULong64_t run, TF
104            
105      npar=0;      npar=0;
106                    
107      TrkParams::SetTrackingMode();      nskip = 0;
108      TrkParams::SetPrecisionFactor();  
109      TrkParams::SetStepMin();        watch = false;
110    
111    //     TrkParams::SetTrackingMode();
112    //     TrkParams::SetPrecisionFactor();
113    //     TrkParams::SetStepMin();  
114        TrkParams::SetMiniDefault();
115      TrkParams::SetPFA();      TrkParams::SetPFA();
116    
117  };  };
118  /**  /**
119   * Set processing variables according to input custom parameters   * Set processing variables according to input custom parameters
120   */       */    
121  void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){  int TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){
122    
123      for (int i=0; i< ncustom; i++){      for (int i=0; i< ncustom; i++){
124    
125          cout << "Handling Parameter " << i+1  << " of " << ncustom << ": "  << vcustom[i] << endl;
126    
127            // -----------------------------------------------------//
128            if (!strcmp(vcustom[i], "--simu")){
129                cout << "Setting DarthVader to use Simulated Data\n";
130                TrkParams::SetSimuFlag(kTRUE);
131                continue;
132            }  
133          // -----------------------------------------------------//          // -----------------------------------------------------//
134          if (!strcmp(vcustom[i], "-processFolder")){          if (!strcmp(vcustom[i], "-processFolder")){
135              if (++i >= ncustom) throw -3;              if (++i >= ncustom) throw -3;
# Line 126  void TrkProcess::HandleCustomPar(int ncu Line 154  void TrkProcess::HandleCustomPar(int ncu
154              continue;              continue;
155          }            }  
156          // -----------------------------------------------------//              // -----------------------------------------------------//    
157          if (!strcmp(vcustom[i], "--dontget2") ||!strcmp(vcustom[i], "--dontget-level2") ){  //      if (!strcmp(vcustom[i], "--dontget2") ||!strcmp(vcustom[i], "--dontget-level2") ){
158              get2 = 0;  //          get2 = 0;
159    //          gete = 0;
160    //          getn = 0;
161    //          continue;
162    //      }  
163            // -----------------------------------------------------//    
164            if (!strcmp(vcustom[i], "--dontgete") ||!strcmp(vcustom[i], "--dontget-exttrack") ){
165                gete = 0;
166                continue;
167            }  
168            // -----------------------------------------------------//    
169            if (!strcmp(vcustom[i], "-extalg")){
170                if (++i >= ncustom) throw -3;
171                gete = 1;      
172                get2 = 1;      
173                extAlgID = atoi(vcustom[i]);
174                continue;
175            }  
176            // -----------------------------------------------------//    
177            if (!strcmp(vcustom[i], "-extalg-check")){
178                if (++i >= ncustom) throw -3;
179                gete_ncheck = atoi(vcustom[i]);
180                continue;
181            }  
182            // -----------------------------------------------------//    
183            if (!strcmp(vcustom[i], "--dontgetn") ||!strcmp(vcustom[i], "--dontget-nuclei") ){
184                getn = 0;
185              continue;              continue;
186          }            }  
187          // -----------------------------------------------------//              // -----------------------------------------------------//    
# Line 142  void TrkProcess::HandleCustomPar(int ncu Line 196  void TrkProcess::HandleCustomPar(int ncu
196              file1 = vcustom[i];              file1 = vcustom[i];
197              continue;              continue;
198          }            }  
199    //      // -----------------------------------------------------//    
200    //      if (!strcmp(vcustom[i], "-frame1")){
201    //          if (++i >= ncustom)throw -3;
202    //          get1 = 1;
203    //          frame1 = vcustom[i];                                                
204    //          continue;
205    //      }  
206    //      // -----------------------------------------------------//    
207    //      if (!strcmp(vcustom[i], "-frame2")){
208    //          if (++i >= ncustom)throw -3;
209    //          get2 = 1;
210    //          frame2 = vcustom[i];
211    //          continue;
212    //      }  
213    //      // -----------------------------------------------------//    
214    //      if (!strcmp(vcustom[i], "-framee")){
215    //          if (++i >= ncustom)throw -3;
216    //          gete = 1;
217    //          framee = vcustom[i];
218    //          continue;
219    //      }  
220          // -----------------------------------------------------//              // -----------------------------------------------------//    
221          if (!strcmp(vcustom[i], "-frame1")){          if (!strcmp(vcustom[i], "-pfa")){
222              if (++i >= ncustom)throw -3;              if (++i >= ncustom)throw -3;
223              get1 = 1;              TrkParams::SetPFA(atoi(vcustom[i]));
             frame1 = vcustom[i];                                                  
224              continue;              continue;
225          }            }  
226          // -----------------------------------------------------//              // -----------------------------------------------------//    
227          if (!strcmp(vcustom[i], "-frame2")){          if (!strcmp(vcustom[i], "-skip")){
228              if (++i >= ncustom)throw -3;              if (++i >= ncustom)throw -3;
229              get2 = 1;              nskip = atoi(vcustom[i]);
             frame2 = vcustom[i];  
230              continue;              continue;
231          }            }  
232          // -----------------------------------------------------//              // -----------------------------------------------------//    
# Line 170  void TrkProcess::HandleCustomPar(int ncu Line 243  void TrkProcess::HandleCustomPar(int ncu
243              continue;              continue;
244          }          }
245          // -----------------------------------------------------//              // -----------------------------------------------------//    
246            if (!strcmp(vcustom[i], "--warning") || !strcmp(vcustom[i], "-w")){
247                TrkParams::SetWarningMode();
248                continue;
249            }
250            // -----------------------------------------------------//    
251            if (!strcmp(vcustom[i], "--help") || !strcmp(vcustom[i], "-h")){
252                PrintHelp();
253                return 1;
254            }
255            // -----------------------------------------------------//    
256            if (!strcmp(vcustom[i], "--watch") ){
257                watch = true;
258                continue;
259            }
260            // -----------------------------------------------------//    
261          else if (!strcmp(vcustom[i], "--debug") || !strcmp(vcustom[i], "-d")){          else if (!strcmp(vcustom[i], "--debug") || !strcmp(vcustom[i], "-d")){
262              TrkParams::SetDebugMode();              TrkParams::SetDebugMode();
263              continue;              continue;
# Line 188  void TrkProcess::HandleCustomPar(int ncu Line 276  void TrkProcess::HandleCustomPar(int ncu
276      else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false;      else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false;
277      else    throw -201;      else    throw -201;
278    
279        if      (!framee.CompareTo("root", TString::kIgnoreCase))  ifroote = true;          
280        else if (!framee.CompareTo("hbook", TString::kIgnoreCase)) ifroote =false;
281        else    throw -201;
282    
283      if(get1 && !get2)full1=true;      if(get1 && !get2)full1=true;
284    
285      ostatus = 0;      ostatus = 0;
286    
287        return 0;
288    
289  };  };
290  /**  /**
291   * \brief Process Level0 event   * \brief Process Level0 event
# Line 211  void TrkProcess::ProcessEvent(TrkLevel0 Line 305  void TrkProcess::ProcessEvent(TrkLevel0
305      //      //
306      if(get2) analysisflight_();      if(get2) analysisflight_();
307      //      //
308    
309      ostatus = F77err;      ostatus = F77err;
310            
311  };  };
# Line 220  void TrkProcess::Dump(){ Line 315  void TrkProcess::Dump(){
315      cout << " |-------------------------------------| "<<endl;      cout << " |-------------------------------------| "<<endl;
316      cout << "   tracker-processing input-parameters   "<< endl;      cout << "   tracker-processing input-parameters   "<< endl;
317      cout << " |-------------------------------------| "<<endl;      cout << " |-------------------------------------| "<<endl;
318      cout << "   idRun           " << idrun << endl;      cout << "   idRun            " << idrun << endl;
319      cout << "   get level1      " << get1 << endl;      cout << "                    (skip " << nskip <<" events)"<< endl;    
320      cout << "   full level1     " << full1 << endl;      cout << "   get level1       " << get1 << endl;
321      cout << "   get level2      " << get2 << endl;      cout << "   full level1      " << full1 << endl;
322      cout << "   get hough       " << geth << endl;      cout << "   get level2       " << get2 << endl;
323  //    cout << " frame1          " << frame1 << endl;      cout << "   get hough        " << geth << endl;
324  //    cout << " frame2          " << frame2 << endl;      cout << "   get ext.tracking " << gete << endl;
325  //    cout << " frameh          " << frame2 << endl;      if(gete)
326  //    cout << " file1           " << file1 << endl;      cout << "   ext.tracking alg " << extAlgID << endl;
327      cout << "   output file     " << file2 << endl;      cout << "   get nuclei       " << getn << endl;
328  //    cout << " outdir          " << outdir << endl;  //    cout << " frame1           " << frame1 << endl;
329  //    cout << " process folder  " << pfolder << endl;  //    cout << " frame2           " << frame2 << endl;
330  //    cout << " standalone mode " << standalone << endl;  //    cout << " frameh           " << frame2 << endl;
331    //    cout << " file1            " << file1 << endl;
332        cout << "   output file      " << file2 << endl;
333    //    cout << " outdir           " << outdir << endl;
334    //    cout << " process folder   " << pfolder << endl;
335    //    cout << " standalone mode  " << standalone << endl;
336      for(int i=0; i<npar; i++)      for(int i=0; i<npar; i++)
337          cout << "   force loading parameters of type "<<partype[i]<<" from <--- "<<parpath[i]<<endl;          cout << "   force loading parameters of type "<<partype[i]<<" from <--- "<<parpath[i]<<endl;
338      cout<<endl;      cout<<endl;
# Line 242  void TrkProcess::Dump(){ Line 342  void TrkProcess::Dump(){
342  //     cout << " debug mode      debug   " << dbg_mode.debug << endl << endl;  //     cout << " debug mode      debug   " << dbg_mode.debug << endl << endl;
343            
344  }  }
345    
346    void TrkProcess::PrintHelp(){
347    
348        printf( "\n\n +TRK [ options ] \n \n");
349    //    printf( "\n --version          : Print tracker software version and exit ");      
350        printf( "Options:");
351        printf( "\n --help, -h                     : Print this help and exit ");  
352    //    printf( "\n -idRun RUN         : ID number of the run to be processed (for reprocessing RUN=0) \n");
353    //    printf( "\n -outDir OUTDIR     : Path where to put the LEVEL2 output                    [default ./ ] ");
354    //    printf( "\n -processFolder DIR   : Directory (relative to OUTDIR) for other output files  [default TrackerFolder/ ] ");
355    //    printf( "\n -processFile FILE  : Name of the LEVEL2 output file                         [default RUN.Level2.root]");
356    //    printf( "\n -processFile1 FILE   : Name of the LEVEL1 output file                         [default RUN.Level1.rz]");
357    //    printf( "\n -frame1 FRAME        : type of output for LEVEL1, root/hbook                  [default hbook ] ");
358    //    printf( "\n -frame2 FRAME        : type of output for LEVEL2, root/hbook                  [default root  ] ");            
359        printf( "\n --get1, --get-level1           : get LEVEL1 output (store only cluster associated to tracks) [default (no LEVEL1 output) ]  ");
360        printf( "\n --get1-full, --get-level1-full : get LEVEL1 output (store all clusters)                      [default (no LEVEL1 output) ]  ");
361        printf( "\n --dontget2, --dontget-level2   : do not get LEVEL2 output                                    [default (get LEVEL2 output)]");
362        printf( "\n --dontgete, --dontget-exttrack : do not get ext.tracking output                              [default (ext.algorythm 202)]");
363        printf( "\n --dontgetn, --dontget-nuclei   : do not get nuclei cleaned tracks                            [default (get nuclei output)]");
364        printf( "\n --extalg ID                    : apply ext.tracking algorythm n.ID                           [default (ID=202) ]  ");
365        printf( "\n --geth,, --get-hough           : get Hough-transform output                                  [default (no Hough-t. output) ]  ");
366        printf( "\n -pfa PFAID                     : type of output for LEVEL2, root/hbook                       [default 14 (COG4)  ] ");          
367        printf( "\n -N PATH                        : load parameter of type N=1,2... from PATH                   [default (from DB)  ] ");  
368        printf( "\n --verbose, -v                  : verbose mode ");      
369        printf( "\n --debug, -d                    : debug mode ");
370        printf( "\n --warning, -w                  : warning mode ");      
371        printf( "\n -skip NEV                      : skip first NEV events from each run ");        
372    //    printf( "\n --standalone, -s   : standalone mode (without RunInfo) ... but it might not work \n");        
373    //    printf( "\n -host HOST         : Name for the host                                      [default mysql://localhost/pamelaprod ]");
374    //    printf( "\n -user USER         : Username for the DB                                    [default anonymous] ");
375    //    printf( "\n -psw  PSW          : Password for the DB                                    [default (none)]\n \n \n");
376        
377    
378    }

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

  ViewVC Help
Powered by ViewVC 1.1.23