48 |
get2 = 1; |
get2 = 1; |
49 |
standalone = false; |
standalone = false; |
50 |
frame2 = "root"; |
frame2 = "root"; |
51 |
frame1 = "hbook"; |
frame1 = "root"; |
52 |
ifroot1 = false; |
// ifroot1 = false; |
53 |
ifroot2 = true; |
// ifroot2 = true; |
54 |
file1 = ""; |
pfolder = "/TrackerFolder"; |
55 |
|
file1 = ""; |
56 |
if(f2->IsOpen()){ |
if(f2->IsOpen()){ |
57 |
file2 = f2->GetPath(); |
file2 = f2->GetPath(); |
58 |
// TString temp = file2(0,file2.Last(':')); |
outdir = gSystem->DirName(gSystem->DirName(file2)); |
59 |
// outdir = temp(0,temp.Last('/')); |
// check if the indicated output directory exists |
60 |
outdir = gSystem->DirName(gSystem->DirName(file2)); |
FileStat_t t; |
61 |
// check if the indicated output directory exists |
if( gSystem->GetPathInfo(outdir.Data(),t) )throw -12; |
|
FileStat_t t; |
|
|
if( gSystem->GetPathInfo(outdir.Data(),t) )throw -12; |
|
62 |
}else{ |
}else{ |
63 |
file2 = ""; |
file2 = ""; |
64 |
outdir = gSystem->WorkingDirectory(); |
outdir = gSystem->WorkingDirectory(); |
65 |
}; |
}; |
|
pfolder = "/TrackerFolder"; |
|
66 |
|
|
67 |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
68 |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
79 |
void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ |
void TrkProcess::HandleCustomPar(int ncustom, char *vcustom[]){ |
80 |
|
|
81 |
for (int i=0; i< ncustom; i++){ |
for (int i=0; i< ncustom; i++){ |
82 |
|
|
83 |
// -----------------------------------------------------// |
// -----------------------------------------------------// |
84 |
if (!strcmp(vcustom[i], "-processFolder")){ |
if (!strcmp(vcustom[i], "-processFolder")){ |
85 |
if (++i >= ncustom) throw -3; |
if (++i >= ncustom) throw -3; |
135 |
continue; |
continue; |
136 |
}; |
}; |
137 |
} |
} |
138 |
|
|
|
// dbg_.debug = DEBUG; |
|
|
// dbg_.verbose = VERBOSE; |
|
|
|
|
139 |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
if (!frame2.CompareTo("root", TString::kIgnoreCase)) ifroot2 = true; |
140 |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
else if (!frame2.CompareTo("hbook", TString::kIgnoreCase)) ifroot2 =false; |
141 |
else throw -201; |
else throw -201; |
143 |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
if (!frame1.CompareTo("root", TString::kIgnoreCase)) ifroot1 = true; |
144 |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
else if (!frame1.CompareTo("hbook", TString::kIgnoreCase)) ifroot1 =false; |
145 |
else throw -201; |
else throw -201; |
146 |
|
|
147 |
if(get1){ |
if(get1){ |
148 |
TString filety; |
|
149 |
if ( ifroot1) filety=".root"; |
TString filety; |
150 |
else if (!ifroot1) filety=".rz"; |
if ( ifroot1) filety=".root"; |
151 |
else throw -200; |
else if (!ifroot1) filety=".rz"; |
152 |
// file1 = outdir + "/"+ pfolder + "/" + file2(file2.Last('/')+1,file2.Last('.')) + ".Level1" + filety; |
else throw -200; |
153 |
// cout << p->file1 << endl; |
|
154 |
// TString path = gSystem->DirName(p->file1); |
// file1 = outdir + "/"+ gSystem->BaseName(pfolder) + "/" + file2(file2.Last('/')+1,file2.Last('.')) + ".Level1" + filety; |
155 |
// FileStat_t t; |
TString base = file2; |
156 |
// // check if processFolder directory exists, and possibly create it |
if(base.Contains(".Level2.root"))base = base(0,base.Index(".Level2.root")); |
157 |
// if( gSystem->GetPathInfo(path.Data(),t) ) { |
else base = base(0,base.Index(".root")); |
158 |
// if( gSystem->MakeDirectory(path.Data()) == -1)throw -13; |
base = gSystem->BaseName(base); |
159 |
// }; |
file1 = outdir + "/"+ gSystem->BaseName(pfolder) + "/" + base +".Level1"+filety; |
160 |
// // if it does, open/create teh putput file |
// cout << "Requested Level1 output. "<< endl << "Level1 File: "<< file1 << endl; |
161 |
|
TString path = gSystem->DirName(file1); |
162 |
|
FileStat_t t; |
163 |
|
// check if processFolder directory exists, and possibly create it |
164 |
|
if( gSystem->GetPathInfo(path.Data(),t) ) { |
165 |
|
if( gSystem->MakeDirectory(path.Data()) == -1)throw -13; |
166 |
|
}; |
167 |
|
// if it does, open/create teh putput file |
168 |
|
|
169 |
}; |
}; |
170 |
|
|