| 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 = "root"; |
frame1 = "root"; |
| 56 |
// ifroot1 = false; |
frameh = "root"; |
| 57 |
// ifroot2 = true; |
pfolder = "/TrackerFolder"; |
| 58 |
pfolder = "/TrackerFolder"; |
file1 = ""; |
|
file1 = ""; |
|
| 59 |
if(f2->IsOpen()){ |
if(f2->IsOpen()){ |
| 60 |
file2 = f2->GetPath(); |
file2 = f2->GetPath(); |
| 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 |
}; |
}; |
| 69 |
|
|
| 70 |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
| 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 |
}; |
}; |
| 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 |
} |
} |
| 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 |
// |
else if (!frameh.CompareTo("hbook", TString::kIgnoreCase)) ifrooth =false; |
| 160 |
// TString filety; |
else throw -201; |
|
// if ( ifroot1) filety=".root"; |
|
|
// else if (!ifroot1) filety=".rz"; |
|
|
// else throw -200; |
|
|
// |
|
|
// TString base = file2; |
|
|
// if(base.Contains(".Level2.root"))base = base(0,base.Index(".Level2.root")); |
|
|
// else base = base(0,base.Index(".root")); |
|
|
// base = gSystem->BaseName(base); |
|
|
// file1 = outdir + "/"+ gSystem->BaseName(pfolder) + "/" + base +".Level1"+filety; |
|
|
// // cout << "Requested Level1 output. "<< endl << "Level1 File: "<< file1 << endl; |
|
|
// TString path = gSystem->DirName(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 |
|
|
| 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; |