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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Thu Oct 26 16:22:37 2006 UTC (18 years, 1 month ago) by pam-fi
Branch: MAIN
CVS Tags: v2r01
Changes since 1.5: +33 -39 lines
fitting methods

1 mocchiut 1.1 /**
2     * \file TrkProcess.cpp
3     * \author Elena Vannuccini
4     */
5     #include <TrkProcess.h>
6     #include <iostream>
7     using namespace std;
8 pam-fi 1.2 /**
9     * Create TrkProcess object, initializing the tracker processing variables at default values
10     */
11 mocchiut 1.1 TrkProcess::TrkProcess(){
12    
13     idrun = 0;
14 pam-fi 1.2 dbg_mode.SetNone();
15 mocchiut 1.1 get1 = 0;
16 pam-fi 1.6 geth = 0;
17 mocchiut 1.1 get2 = 1;
18     standalone = false;
19     frame2 = "root";
20 pam-fi 1.6 frame1 = "root";
21     frameh = "root";
22 mocchiut 1.1 outdir = gSystem->WorkingDirectory();
23     pfolder = "/TrackerFolder";
24     if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true;
25 pam-fi 1.2 else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 = false;
26 mocchiut 1.1
27     if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true;
28 pam-fi 1.2 else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 = false;
29 mocchiut 1.1
30 pam-fi 1.6 if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true;
31     else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth = false;
32    
33 mocchiut 1.1 file1 = "";
34     file2 = "";
35    
36 pam-fi 1.2 ostatus = 0;
37 mocchiut 1.1 };
38    
39 pam-fi 1.2 /**
40     * Create TrkProcess object, initializing the tracker processing variables according to input parameters.
41     * @param run Run ID
42     * @param f2 Pointer to output level2 file
43     */
44 mocchiut 1.1 TrkProcess::TrkProcess(ULong64_t run, TFile *f2){
45    
46     idrun = run;
47 pam-fi 1.2 // DEBUG = false;
48     // VERBOSE = false;
49     dbg_mode.SetWarning();
50 mocchiut 1.1 get1 = 0;
51     get2 = 1;
52 pam-fi 1.6 geth = 0;
53 mocchiut 1.1 standalone = false;
54     frame2 = "root";
55 pam-fi 1.4 frame1 = "root";
56 pam-fi 1.6 frameh = "root";
57     pfolder = "/TrackerFolder";
58     file1 = "";
59 mocchiut 1.1 if(f2->IsOpen()){
60 pam-fi 1.6 file2 = f2->GetPath();
61     outdir = gSystem->DirName(gSystem->DirName(file2));
62 pam-fi 1.4 // check if the indicated output directory exists
63 pam-fi 1.6 FileStat_t t;
64     if( gSystem->GetPathInfo(outdir.Data(),t) )throw -12;
65 mocchiut 1.1 }else{
66 pam-fi 1.6 file2 = "";
67     outdir = gSystem->WorkingDirectory();
68 mocchiut 1.1 };
69    
70     if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true;
71     else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false;
72    
73     if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true;
74     else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false;
75    
76 pam-fi 1.6 if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true;
77     else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false;
78    
79 pam-fi 1.2 ostatus = 0;
80 mocchiut 1.1
81     };
82 pam-fi 1.2 /**
83     * Set processing variables according to input custom parameters
84     */
85     void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){
86 mocchiut 1.1
87     for (int i=0; i< ncustom; i++){
88 pam-fi 1.4
89 mocchiut 1.1 // -----------------------------------------------------//
90     if (!strcmp(vcustom[i], "-processFolder")){
91     if (++i >= ncustom) throw -3;
92     pfolder = vcustom[i];
93     continue;
94     }
95     // -----------------------------------------------------//
96 pam-fi 1.6 if (!strcmp(vcustom[i], "--get1") || !strcmp(vcustom[i], "--get-level1") ){
97 mocchiut 1.1 get1 = 1;
98     continue;
99     }
100     // -----------------------------------------------------//
101 pam-fi 1.6 if (!strcmp(vcustom[i], "--geth") || !strcmp(vcustom[i], "--get-hough") ){
102     geth = 1;
103     continue;
104     }
105     // -----------------------------------------------------//
106     if (!strcmp(vcustom[i], "--dontget2") ||!strcmp(vcustom[i], "--dontget-level2") ){
107 mocchiut 1.1 get2 = 0;
108     continue;
109     }
110     // -----------------------------------------------------//
111     if (!strcmp(vcustom[i], "--standalone") || !strcmp(vcustom[i], "-s")){
112     standalone = true;
113     continue;
114     }
115     // -----------------------------------------------------//
116     if (!strcmp(vcustom[i], "-processFile1")){
117     if (++i >= ncustom) throw -3;
118     get1 = 1;
119     file1 = vcustom[i];
120     continue;
121     }
122     // -----------------------------------------------------//
123     if (!strcmp(vcustom[i], "-frame1")){
124     if (++i >= ncustom)throw -3;
125     get1 = 1;
126     frame1 = vcustom[i];
127     continue;
128     }
129     // -----------------------------------------------------//
130     if (!strcmp(vcustom[i], "-frame2")){
131     if (++i >= ncustom)throw -3;
132     get2 = 1;
133     frame2 = vcustom[i];
134     continue;
135     }
136     // -----------------------------------------------------//
137 pam-fi 1.2 if (!strcmp(vcustom[i], "--verbose") || !strcmp(vcustom[i], "-v")){
138     // VERBOSE = true;
139     this->SetVerboseMode();
140     continue;
141     }
142     // -----------------------------------------------------//
143     else if (!strcmp(vcustom[i], "--debug") || !strcmp(vcustom[i], "-d")){
144     // DEBUG = true;
145     this->SetDebugMode();
146 mocchiut 1.1 continue;
147 pam-fi 1.2 };
148 mocchiut 1.1 }
149 pam-fi 1.4
150 mocchiut 1.1 if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true;
151     else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false;
152     else throw -201;
153    
154     if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true;
155     else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false;
156     else throw -201;
157 pam-fi 1.4
158 pam-fi 1.6 if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true;
159     else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false;
160     else throw -201;
161 mocchiut 1.1
162 pam-fi 1.2 ostatus = 0;
163 mocchiut 1.1
164 pam-fi 1.2 };
165     /**
166     * \brief Process Level0 event
167     * @param l0_event Pointer to an object of the tracker level0 class
168     * Starting from a Level0 object, this routine fills the level0 common, then calls
169     * the fortran routines, which process the event and fill level1 and level2 commons.
170     */
171     void TrkProcess::ProcessEvent(TrkLevel0 *l0_event){
172    
173     // fill Level0 common from Level0 object
174     l0_event->GetCommonVar(&level0event_);
175    
176     // process the event Level0->Level1->Level2
177     int F77err = 0;
178     //
179     reductionflight_(&F77err);
180     if(F77err < 0)throw F77err;
181 mocchiut 1.3 // else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - Level1 reduction (CN computation failure, ...)"<<endl;
182 pam-fi 1.2 //
183     if(get2) analysisflight_();
184     // if(F77err < 0)throw F77err;
185     // else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - @ Level2 reduction "<<endl;
186     //
187     ostatus = F77err;
188    
189 mocchiut 1.1 };
190    
191     void TrkProcess::Dump(){
192    
193     cout <<endl<< "Tracker process parameters: "<< endl;
194     cout << " idRun " << idrun << endl;
195 pam-fi 1.6 cout << " get level1 " << get1 << endl;
196     cout << " get level2 " << get2 << endl;
197     cout << " get hough " << geth << endl;
198 mocchiut 1.1 cout << " frame1 " << frame1 << endl;
199     cout << " frame2 " << frame2 << endl;
200 pam-fi 1.6 cout << " frameh " << frame2 << endl;
201 mocchiut 1.1 cout << " file1 " << file1 << endl;
202     cout << " file2 " << file2 << endl;
203     cout << " outdir " << outdir << endl;
204 pam-fi 1.2 cout << " process folder " << pfolder << endl;
205 mocchiut 1.1 cout << " standalone mode " << standalone << endl;
206 pam-fi 1.2 cout << " debug mode warning " << dbg_mode.warning << endl;
207     cout << " debug mode verbose " << dbg_mode.verbose << endl;
208     cout << " debug mode debug " << dbg_mode.debug << endl << endl;
209 mocchiut 1.1
210     }

  ViewVC Help
Powered by ViewVC 1.1.23