--- DarthVader/TrackerLevel2/src/TrkProcess.cpp 2006/05/19 13:15:54 1.1 +++ DarthVader/TrackerLevel2/src/TrkProcess.cpp 2006/05/30 16:30:37 1.2 @@ -5,11 +5,15 @@ #include #include using namespace std; - +/** + * Create TrkProcess object, initializing the tracker processing variables at default values + */ TrkProcess::TrkProcess(){ idrun = 0; - DEBUG = false; +// DEBUG = false; +// VERBOSE = false; + dbg_mode.SetNone(); get1 = 0; get2 = 1; standalone = false; @@ -18,20 +22,28 @@ outdir = gSystem->WorkingDirectory(); pfolder = "/TrackerFolder"; if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; - else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; + else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 = false; if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; - else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; + else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 = false; file1 = ""; file2 = ""; + ostatus = 0; }; +/** + * Create TrkProcess object, initializing the tracker processing variables according to input parameters. + * @param run Run ID + * @param f2 Pointer to output level2 file + */ TrkProcess::TrkProcess(ULong64_t run, TFile *f2){ idrun = run; - DEBUG = false; +// DEBUG = false; +// VERBOSE = false; + dbg_mode.SetWarning(); get1 = 0; get2 = 1; standalone = false; @@ -60,10 +72,13 @@ if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; + ostatus = 0; }; - -int TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ +/** + * Set processing variables according to input custom parameters + */ +void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ for (int i=0; i< ncustom; i++){ @@ -110,12 +125,22 @@ continue; } // -----------------------------------------------------// - else if (!strcmp(vcustom[i], "--verbose") || !strcmp(vcustom[i], "-v")){ - DEBUG = true; + if (!strcmp(vcustom[i], "--verbose") || !strcmp(vcustom[i], "-v")){ +// VERBOSE = true; + this->SetVerboseMode(); continue; - } + } + // -----------------------------------------------------// + else if (!strcmp(vcustom[i], "--debug") || !strcmp(vcustom[i], "-d")){ +// DEBUG = true; + this->SetDebugMode(); + continue; + }; } +// dbg_.debug = DEBUG; +// dbg_.verbose = VERBOSE; + if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; else throw -201; @@ -141,8 +166,33 @@ }; + ostatus = 0; - return 0; +}; +/** + * \brief Process Level0 event + * @param l0_event Pointer to an object of the tracker level0 class + * Starting from a Level0 object, this routine fills the level0 common, then calls + * the fortran routines, which process the event and fill level1 and level2 commons. + */ +void TrkProcess::ProcessEvent(TrkLevel0 *l0_event){ + + // fill Level0 common from Level0 object + l0_event->GetCommonVar(&level0event_); + + // process the event Level0->Level1->Level2 + int F77err = 0; + // + reductionflight_(&F77err); + if(F77err < 0)throw F77err; + else if(F77err > 0 && WarningMode())cout<<" WARNING ("< 0 && WarningMode())cout<<" WARNING ("<