11 |
TrkProcess::TrkProcess(){ |
TrkProcess::TrkProcess(){ |
12 |
|
|
13 |
idrun = 0; |
idrun = 0; |
|
// DEBUG = false; |
|
|
// VERBOSE = false; |
|
14 |
dbg_mode.SetNone(); |
dbg_mode.SetNone(); |
15 |
get1 = 0; |
get1 = 0; |
16 |
|
geth = 0; |
17 |
get2 = 1; |
get2 = 1; |
18 |
standalone = false; |
standalone = false; |
19 |
frame2 = "root"; |
frame2 = "root"; |
20 |
frame1 = "hbook"; |
frame1 = "root"; |
21 |
|
frameh = "root"; |
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; |
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 |
|
if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true; |
31 |
|
else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth = false; |
32 |
|
|
33 |
file1 = ""; |
file1 = ""; |
34 |
file2 = ""; |
file2 = ""; |
35 |
|
|
49 |
dbg_mode.SetWarning(); |
dbg_mode.SetWarning(); |
50 |
get1 = 0; |
get1 = 0; |
51 |
get2 = 1; |
get2 = 1; |
52 |
|
geth = 0; |
53 |
standalone = false; |
standalone = false; |
54 |
frame2 = "root"; |
frame2 = "root"; |
55 |
frame1 = "hbook"; |
frame1 = "root"; |
56 |
ifroot1 = false; |
frameh = "root"; |
57 |
ifroot2 = true; |
pfolder = "/TrackerFolder"; |
58 |
file1 = ""; |
file1 = ""; |
59 |
if(f2->IsOpen()){ |
if(f2->IsOpen()){ |
60 |
file2 = f2->GetPath(); |
file2 = f2->GetPath(); |
|
// TString temp = file2(0,file2.Last(':')); |
|
|
// outdir = temp(0,temp.Last('/')); |
|
61 |
outdir = gSystem->DirName(gSystem->DirName(file2)); |
outdir = gSystem->DirName(gSystem->DirName(file2)); |
62 |
// check if the indicated output directory exists |
// check if the indicated output directory exists |
63 |
FileStat_t t; |
FileStat_t t; |
64 |
if( gSystem->GetPathInfo(outdir.Data(),t) )throw -12; |
if( gSystem->GetPathInfo(outdir.Data(),t) )throw -12; |
65 |
}else{ |
}else{ |
66 |
file2 = ""; |
file2 = ""; |
67 |
outdir = gSystem->WorkingDirectory(); |
outdir = gSystem->WorkingDirectory(); |
68 |
}; |
}; |
|
pfolder = "/TrackerFolder"; |
|
69 |
|
|
70 |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
71 |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
73 |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
74 |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
75 |
|
|
76 |
|
if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true; |
77 |
|
else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false; |
78 |
|
|
79 |
ostatus = 0; |
ostatus = 0; |
80 |
|
|
81 |
}; |
}; |
85 |
void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ |
void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ |
86 |
|
|
87 |
for (int i=0; i< ncustom; i++){ |
for (int i=0; i< ncustom; i++){ |
88 |
|
|
89 |
// -----------------------------------------------------// |
// -----------------------------------------------------// |
90 |
if (!strcmp(vcustom[i], "-processFolder")){ |
if (!strcmp(vcustom[i], "-processFolder")){ |
91 |
if (++i >= ncustom) throw -3; |
if (++i >= ncustom) throw -3; |
93 |
continue; |
continue; |
94 |
} |
} |
95 |
// -----------------------------------------------------// |
// -----------------------------------------------------// |
96 |
if (!strcmp(vcustom[i], "--get1")){ |
if (!strcmp(vcustom[i], "--get1") || !strcmp(vcustom[i], "--get-level1") ){ |
97 |
get1 = 1; |
get1 = 1; |
98 |
continue; |
continue; |
99 |
} |
} |
100 |
// -----------------------------------------------------// |
// -----------------------------------------------------// |
101 |
if (!strcmp(vcustom[i], "--dontget2")){ |
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 |
get2 = 0; |
get2 = 0; |
108 |
continue; |
continue; |
109 |
} |
} |
146 |
continue; |
continue; |
147 |
}; |
}; |
148 |
} |
} |
149 |
|
|
|
// dbg_.debug = DEBUG; |
|
|
// dbg_.verbose = VERBOSE; |
|
|
|
|
150 |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
151 |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
152 |
else throw -201; |
else throw -201; |
154 |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
155 |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
156 |
else throw -201; |
else throw -201; |
157 |
|
|
158 |
if(get1){ |
if (!frameh.CompareTo("root", TString::kIgnoreCase)) ifrooth = true; |
159 |
TString filety; |
else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false; |
160 |
if ( ifroot1) filety=".root"; |
else throw -201; |
|
else if (!ifroot1) filety=".rz"; |
|
|
else throw -200; |
|
|
// file1 = outdir + "/"+ pfolder + "/" + file2(file2.Last('/')+1,file2.Last('.')) + ".Level1" + filety; |
|
|
// cout << p->file1 << endl; |
|
|
// TString path = gSystem->DirName(p->file1); |
|
|
// FileStat_t t; |
|
|
// // check if processFolder directory exists, and possibly create it |
|
|
// if( gSystem->GetPathInfo(path.Data(),t) ) { |
|
|
// if( gSystem->MakeDirectory(path.Data()) == -1)throw -13; |
|
|
// }; |
|
|
// // if it does, open/create teh putput file |
|
|
|
|
|
}; |
|
161 |
|
|
162 |
ostatus = 0; |
ostatus = 0; |
163 |
|
|
178 |
// |
// |
179 |
reductionflight_(&F77err); |
reductionflight_(&F77err); |
180 |
if(F77err < 0)throw F77err; |
if(F77err < 0)throw F77err; |
181 |
else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - Level1 reduction (CN computation failure, ...)"<<endl; |
// else if(F77err > 0 && WarningMode())cout<<" WARNING ("<<F77err<<") - TrkCore - Level1 reduction (CN computation failure, ...)"<<endl; |
182 |
// |
// |
183 |
if(get2) analysisflight_(); |
if(get2) analysisflight_(); |
184 |
// if(F77err < 0)throw F77err; |
// if(F77err < 0)throw F77err; |
192 |
|
|
193 |
cout <<endl<< "Tracker process parameters: "<< endl; |
cout <<endl<< "Tracker process parameters: "<< endl; |
194 |
cout << " idRun " << idrun << endl; |
cout << " idRun " << idrun << endl; |
195 |
cout << " get1 " << get1 << endl; |
cout << " get level1 " << get1 << endl; |
196 |
cout << " get2 " << get2 << endl; |
cout << " get level2 " << get2 << endl; |
197 |
|
cout << " get hough " << geth << endl; |
198 |
cout << " frame1 " << frame1 << endl; |
cout << " frame1 " << frame1 << endl; |
199 |
cout << " frame2 " << frame2 << endl; |
cout << " frame2 " << frame2 << endl; |
200 |
|
cout << " frameh " << frame2 << endl; |
201 |
cout << " file1 " << file1 << endl; |
cout << " file1 " << file1 << endl; |
202 |
cout << " file2 " << file2 << endl; |
cout << " file2 " << file2 << endl; |
203 |
cout << " outdir " << outdir << endl; |
cout << " outdir " << outdir << endl; |