52 if (!
GetJobUrl(name, mc, job))
return false;
54 if (!
GetRuns(job, mc, minSize))
return false;
57 Printf(
"alien://%s?pattern=%s*/AliESDs.root&runs=%s",
76 if (!
Download((mc ?
"job_details.jsp" :
"production/raw.jsp"), index))
79 std::ifstream in(index.Data());
81 TString tgt(Form(
"<td class=\"table_row\">%s</td>", name.Data()));
84 if (!line.Contains(tgt))
continue;
86 Int_t first = line.Index(
"href=\"");
87 Int_t last = line.Index(
"\"", first+7);
88 url = line(first+6,last-first-6);
95 Error(
"GetJobUrl",
"Production %s not found", name.Data());
113 if (!
Download(Form(
"%s%s", (mc ?
"" :
"raw/"), url.Data()), index))
116 std::ifstream in(index.Data());
117 TString tgt1(mc ?
"window.open" :
"runDetails");
121 if (!line.Contains(tgt1))
continue;
125 first = line.Index(tgt1);
126 last = line.Index(
")", first+tgt1.Length()+1);
129 Int_t tmp = line.Index(
">");
130 first = line.Index(
">", tmp+1);
131 last = line.Index(
"<", first);
133 if (first == kNPOS || last == kNPOS) {
134 Error(
"GetDir",
"Failed to get directory from %s", line.Data());
137 first += (mc ? 1 : tgt1.Length()+1);
139 TString srun = line(first, last);
141 if (
fDebug) Info(
"",
"Got run %lu (%s)", runNo, srun.Data());
143 if (!
GetSize(in, runNo, mc, minSize))
continue;
144 if (!
GetDir(in, runNo, mc))
continue;
147 fRuns.Append(Form(
"%lu", runNo));
150 if (
fRuns.IsNull())
return false;
168 TString tgt2(mc ?
"table_row_right" :
"ESDs size");
172 if (!line.Contains(tgt2))
continue;
174 if (mc && cnt < 3)
continue;
175 if (!mc) line.ReadLine(in);
176 if (
fDebug) Info(
"", line);
180 Int_t first = line.Index(
">");
181 Int_t last = line.Index(
"<",first+1);
182 if (first == kNPOS || last == kNPOS) {
183 Error(
"GetDir",
"Failed to get directory from %s", line.Data());
186 ssiz = line(first+1, last-first-1);
189 for (
Int_t i = 0; i < line.Length(); i++) {
190 if (line[i] ==
'<')
break;
191 if (line[i] ==
' ' || line[i] ==
'\t' || line[i] ==
',')
continue;
192 ssiz.Append(line[i]);
195 Long_t size = ssiz.Atoll();
196 if (
fDebug) Info(
"",
"Got run %lu %lu" , runNo, size);
198 Error(
"GetSize",
"Failed to extract size for run %lu", runNo);
202 Warning(
"GetSize",
"Run %lu does not have enough events %lu",runNo,size);
221 TString tgt3(
"/catalogue/index.jsp");
225 if (!line.Contains(tgt3))
continue;
226 if (
fDebug) Info(
"", line);
227 Int_t tmp = mc ? line.Index(
">")+1 : 0;
228 Int_t first = line.Index(
">", tmp);
229 Int_t last = line.Index(
"<",first+1);
230 if (first == kNPOS || last == kNPOS) {
231 Error(
"GetDir",
"Failed to get directory from %s", line.Data());
235 TString dir = line(first+1,last-first-1);
237 if (
fDebug) Info(
"",
"Got run %lu %s", runNo, dir.Data());
239 if (!
GetPathPass(dir, runNo, path, pass))
return false;
241 if (
fDebug) Info(
"",
"Got run %lu %s %s", runNo,path.Data(),pass.Data());
244 else if (!
fPath.EqualTo(path)) {
245 Warning(
"GetDir",
"Run %lu location %s not %s",
246 runNo, path.Data(),
fPath.Data());
251 else if (!
fPass.EqualTo(pass)) {
252 Warning(
"GetDir",
"Run %lu pass %s not %s",
253 runNo, pass.Data(),
fPass.Data());
273 Int_t first = dir.Index(Form(
"%lu", run));
274 Int_t last = dir.Index(
"/", first);
275 if (last == kNPOS) last = dir.Length();
276 if (first == kNPOS) {
277 Error(
"GetPathPass",
"Run number %lu not in path %s", run, dir.Data());
280 while (dir[first-1] ==
'0') first--;
281 path = dir(0, first);
282 pass = dir(last+1,dir.Length()-last-1);
295 const TString base(
"http://alimonitor.cern.ch");
296 out = Form(
"%s/%s",
fTmp.Data(), out.Data());
297 TString cmd(Form(
"wget -q \"%s/%s\" -O \"%s\"",
298 base.Data(), url.Data(), out.Data()));
299 if (
fDebug) Info(
"Download",
"%s", cmd.Data());
302 Error(
"Download",
"Failed to get %s/%s -> %s",
303 base.Data(), url.Data(), out.Data());