/[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.1 by mocchiut, Fri May 19 13:15:54 2006 UTC revision 1.2 by pam-fi, Tue May 30 16:30:37 2006 UTC
# Line 5  Line 5 
5  #include <TrkProcess.h>  #include <TrkProcess.h>
6  #include <iostream>  #include <iostream>
7  using namespace std;  using namespace std;
8    /**
9     * Create TrkProcess object, initializing the tracker processing variables at default values
10     */
11  TrkProcess::TrkProcess(){  TrkProcess::TrkProcess(){
12            
13      idrun = 0;      idrun = 0;
14      DEBUG = false;  //    DEBUG = false;
15    //    VERBOSE = false;
16        dbg_mode.SetNone();
17      get1 = 0;      get1 = 0;
18      get2 = 1;      get2 = 1;
19      standalone = false;      standalone = false;
# Line 18  TrkProcess::TrkProcess(){ Line 22  TrkProcess::TrkProcess(){
22      outdir =  gSystem->WorkingDirectory();      outdir =  gSystem->WorkingDirectory();
23      pfolder = "/TrackerFolder";      pfolder = "/TrackerFolder";
24      if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;                if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;          
25      else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false;      else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 = false;
26            
27      if      (!frame1.CompareTo("root", TString::kIgnoreCase))  ifroot1 = true;                if      (!frame1.CompareTo("root", TString::kIgnoreCase))  ifroot1 = true;          
28      else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false;      else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 = false;
29    
30      file1 = "";      file1 = "";
31      file2 = "";      file2 = "";
32            
33        ostatus = 0;
34  };  };
35                    
36    /**
37     * Create TrkProcess object, initializing the tracker processing variables according to input parameters.
38     * @param run Run ID
39     * @param f2 Pointer to output level2 file
40     */
41  TrkProcess::TrkProcess(ULong64_t run, TFile *f2){  TrkProcess::TrkProcess(ULong64_t run, TFile *f2){
42                    
43      idrun = run;      idrun = run;
44      DEBUG = false;  //    DEBUG = false;
45    //    VERBOSE = false;
46        dbg_mode.SetWarning();
47      get1 = 0;      get1 = 0;
48      get2 = 1;      get2 = 1;
49      standalone = false;      standalone = false;
# Line 60  TrkProcess::TrkProcess(ULong64_t run, TF Line 72  TrkProcess::TrkProcess(ULong64_t run, TF
72      if      (!frame1.CompareTo("root", TString::kIgnoreCase))  ifroot1 = true;                if      (!frame1.CompareTo("root", TString::kIgnoreCase))  ifroot1 = true;          
73      else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false;      else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false;
74    
75        ostatus = 0;
76                    
77  };  };
78            /**
79  int TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){   * Set processing variables according to input custom parameters
80     */    
81    void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){
82    
83      for (int i=0; i< ncustom; i++){      for (int i=0; i< ncustom; i++){
84                                    
# Line 110  int TrkProcess::HandleCustomPar(int ncus Line 125  int TrkProcess::HandleCustomPar(int ncus
125              continue;              continue;
126          }            }  
127          // -----------------------------------------------------//              // -----------------------------------------------------//    
128          else if (!strcmp(vcustom[i], "--verbose") || !strcmp(vcustom[i], "-v")){          if (!strcmp(vcustom[i], "--verbose") || !strcmp(vcustom[i], "-v")){
129              DEBUG = true;  //          VERBOSE = true;
130                this->SetVerboseMode();
131              continue;              continue;
132          }            }
133            // -----------------------------------------------------//    
134            else if (!strcmp(vcustom[i], "--debug") || !strcmp(vcustom[i], "-d")){
135    //          DEBUG = true;
136                this->SetDebugMode();
137                continue;
138            };
139      }        }  
140            
141    //    dbg_.debug   = DEBUG;
142    //    dbg_.verbose = VERBOSE;
143        
144      if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;                if      (!frame2.CompareTo("root", TString::kIgnoreCase))  ifroot2 = true;          
145      else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false;      else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false;
146      else    throw -201;      else    throw -201;
# Line 141  int TrkProcess::HandleCustomPar(int ncus Line 166  int TrkProcess::HandleCustomPar(int ncus
166    
167      };      };
168    
169        ostatus = 0;
170    
171      return 0;  };
172    /**
173     * \brief Process Level0 event
174     * @param l0_event Pointer to an object of the tracker level0 class
175     * Starting from a Level0 object, this routine fills the level0 common, then calls
176     * the fortran routines, which process the event and fill level1 and level2 commons.
177     */
178    void TrkProcess::ProcessEvent(TrkLevel0 *l0_event){
179    
180        // fill Level0 common from Level0 object
181        l0_event->GetCommonVar(&level0event_);
182    
183        // process the event Level0->Level1->Level2
184        int F77err = 0;
185        //
186        reductionflight_(&F77err);
187        if(F77err < 0)throw F77err;
188        else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - Level1 reduction (CN computation failure, ...)"<<endl;
189        //
190        if(get2) analysisflight_();
191    //    if(F77err < 0)throw F77err;
192    //    else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - @ Level2 reduction "<<endl;
193        //
194        ostatus = F77err;
195        
196  };  };
197                                    
198  void TrkProcess::Dump(){  void TrkProcess::Dump(){
# Line 156  void TrkProcess::Dump(){ Line 206  void TrkProcess::Dump(){
206      cout << " file1           " << file1 << endl;      cout << " file1           " << file1 << endl;
207      cout << " file2           " << file2 << endl;      cout << " file2           " << file2 << endl;
208      cout << " outdir          " << outdir << endl;      cout << " outdir          " << outdir << endl;
209      cout << " process folder  " << pfolder << endl;          cout << " process folder  " << pfolder << endl;
210      cout << " standalone mode " << standalone << endl;      cout << " standalone mode " << standalone << endl;
211      cout << " debug mode      " << DEBUG << endl<< endl;      cout << " debug mode      warning " << dbg_mode.warning << endl;
212        cout << " debug mode      verbose " << dbg_mode.verbose << endl;
213        cout << " debug mode      debug   " << dbg_mode.debug << endl << endl;
214            
215  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23