135 Error(
"MakeTree",
"Failed to open output file");
141 Error(
"MakeTree",
"No tree defined!");
183 gSystem->Exec(Form(
"rm -f %s.tex %s.html %s.root %s.pdf",
184 base, base, base, base));
186 fTeX =
new std::ofstream(Form(
"%s.tex", base));
187 fHtml =
new std::ofstream(Form(
"%s.html", base));
190 texTitle.ReplaceAll(
"_",
"-");
192 const char* can =
"http://aliqafmd.web.cern.ch/aliqafmd/";
193 *
fTeX <<
"\\documentclass[landscape,a4paper,12pt]{article}\n" 195 <<
"\\usepackage[margin=2cm,a4paper]{geometry}\n" 196 <<
"\\usepackage{graphicx}\n" 197 <<
"\\title{{\\Huge\\bf " << texTitle <<
"}}\n" 198 <<
"\\author{{\\LARGE FMD Team}}\n" 199 <<
"\\date{{\\Large \\today}}\n" 200 <<
"\\begin{document}\n" 201 <<
"\\thispagestyle{empty}\n" 202 <<
"\\maketitle" << std::endl;
204 *
fHtml <<
"<!DOCTYPE html>\n" 207 <<
" <title>QA information - " << title <<
"</title>\n" 208 <<
" <link rel='stylesheet' href='" << can <<
"style.css'>\n" 209 <<
" <link rel='stylesheet' href='style.css'>\n" 210 <<
" <link rel='shortcut icon' href='" << can
211 <<
"fmd_favicon.png' type='image/x-png'>\n" 212 <<
" <link rel='shortcut icon' href='fmd_favicon.png' " 213 <<
"type='image/x-png'>\n" 215 <<
" function browseRootFile(file) {\n" 216 <<
" var o = document.location.origin;\n" 218 <<
" if (b.search(/aliqafmd.web.cern.ch/)) b += '/aliqafmd/';\n" 219 <<
" b += 'jsRoot/';\n" 220 <<
" var p = o + document.location.pathname;\n" 221 <<
" p=p.replace(/" << base <<
".html/,'');\n" 222 <<
" if (p[p.lenght-1] != '/') p += '/';\n" 223 <<
" var u=encodeURIComponent(p+file)+'&menu=no';\n" 224 <<
" window.open(b + '?url=' + u, '_blank',\n" 225 <<
" 'location=no,menubar=no,status=no,titlebar=no');\n" 230 <<
" <h1>" << title <<
"</h1>\n" 234 gStyle->SetPalette(1);
235 gStyle->SetOptFit(0);
236 gStyle->SetOptStat(0);
237 gStyle->SetOptTitle(1);
238 gStyle->SetTitleW(.4);
239 gStyle->SetTitleH(.1);
241 gStyle->SetTitleStyle(0);
242 gStyle->SetTitleBorderSize(0);
243 gStyle->SetTitleX(.6);
245 fCanvas =
new TCanvas(
"qa", title, 900, 700);
252 fCanvas->SetBottomMargin(0.10);
254 fStore = TFile::Open(Form(
"%s.root",
fTeXName.Data()),
"RECREATE");
256 Warning(
"MakeCanvas",
"Failed to make store %s.root",
fTeXName.Data());
276 fCanvas->SetBottomMargin(0.10);
278 *
fTeX <<
"\\clearpage\n" 279 <<
"%% -----------------------------------------------------" 283 tit.ReplaceAll(
"#LT",
"<");
284 tit.ReplaceAll(
"#GT",
">");
285 tit.ReplaceAll(
"#Delta",
"Δ");
286 tit.ReplaceAll(
"#xi",
"ξ");
287 tit.ReplaceAll(
"#sigma",
"σ");
288 tit.ReplaceAll(
"#chi",
"χ");
289 tit.ReplaceAll(
"#nu",
"ν");
290 tit.ReplaceAll(
"_{p}",
"<sub>p</sub>");
291 tit.ReplaceAll(
"_{z}",
"<sub>z</sub>");
292 tit.ReplaceAll(
"^{2}",
"<sup>2</sup>");
293 *
fHtml <<
"<tr><td>" << tit <<
"</td>" << std::flush;
305 TLatex* topText =
new TLatex(.5, .99, title);
306 topText->SetTextAlign(23);
307 topText->SetTextSize(.038);
308 topText->SetTextFont(42);
309 topText->SetTextColor(kBlue+3);
333 gSystem->Exec(Form(
"rm -f %s.png %s.html", pngName, pngName));
334 fCanvas->SaveAs(Form(
"%s.png", pngName));
335 *
fTeX <<
"\\begin{center}\n" 336 <<
"\\includegraphics[keepaspectratio,height=\\textheight]{" 338 <<
"\\end{center}" << std::endl;
339 *
fHtml <<
"<td><a href='" << pngName <<
".html'>Plot</a></td></tr>" 342 std::ofstream img(Form(
"%s.html", pngName));
343 img <<
"<!DOCTYPE html>\n" 346 <<
" <title>" << pngName <<
"</title>\n" 347 <<
" <link rel='stylesheet' href='style.css'></link>\n" 348 <<
" <link rel='shortcut icon' href='fmd_favicon.png' " 349 <<
"type='image/x-png'>\n" 352 <<
" <h1>" << pngName <<
"</h1>\n" 353 <<
" <div id=\"imap\">\n" 354 <<
" <img src=\"" << pngName <<
".png\">\n";
359 img <<
" " << o->GetName() <<
"\n";
361 img <<
" </div>\n" << std::endl;
364 <<
"</html>" << std::endl;
366 gSystem->Exec(Form(
"chmod g+rw %s.html", pngName));
368 fToDelete.Append(Form(
" %s.png", pngName));
369 TDirectory* d = gDirectory;
382 o <<
"<div class='back'>\n" 383 <<
"<a href='" <<
fTeXName <<
".html'>Back</a>\n" 385 <<
"<div class='change'>\n" 386 <<
" Last update: " << now.AsString() <<
"\n" 387 <<
"</div>" << std::endl;
399 *
fTeX <<
"\\end{document}\n" 400 <<
"%% EOF" << std::endl;
404 gSystem->Exec(Form(
"pdflatex %s.tex > /dev/null 2>&1", base));
405 Info(
"Close",
"PDF file %s.pdf generated", base);
409 *
fHtml <<
"</table>" << std::endl;
412 *
fHtml <<
"</body></html>" << std::endl;
422 TString cmd(Form(
"rm -f %s.log %s.aux %s.tex %s",
426 gSystem->Exec(Form(
"chmod g+rw %s.pdf %s", base,
435 const char* jsRoot =
"http://cern.ch/aliqafmd/jsRoot/";
436 *
fHtml <<
"<h3>Collection of plots</h3>\n" 438 <<
" <li><a href='" <<
fTeXName <<
".pdf'>PDF</a></li>\n" 439 <<
" <li><a href='" <<
fTeXName <<
".root'>ROOT</a>\n" 440 <<
" <button onclick='browseRootFile(\"" 441 <<
fTeXName <<
".root\")'>browse online</button></li>\n" 442 <<
"</ul>" << std::endl;
445 fPass.BeginsWith(
"passMC", TString::kIgnoreCase));
447 <<
" <li><a href='https://alimonitor.cern.ch/" 448 << (isMC ?
"job_details.jsp" :
"production/raw.jsp")
449 <<
"?jt_field1=" <<
fPeriod <<
"'>Production(s)</a></li>\n" 450 <<
"</ul>" << std::endl;
459 *
fHtml <<
"<div class='back'>\n" 460 <<
"<a href='index.html'>Back</a>\n" 462 <<
"<div class='change'>\n" 463 <<
" Last update: " << now.AsString() <<
"\n" 464 <<
"</div>" << std::endl;
virtual void WriteLinks()
QABase(const TString &dataType, Int_t prodYear, const TString &period, const TString &pass)
static Global * MakeBranch(TTree *tree)
void Close(bool deletePNGs=true)
void PrintCanvas(const char *pngName, UInt_t)
void PrintCanvas(const char *pngName, TCollection *areas=0)
void CanvasTitle(const char *title)
QABase & operator=(const QABase &)
const char * OutputName() const
Bool_t Init(TTree *tree, bool read=false)
virtual void WriteFooter()
virtual void WriteImageFooter(std::ostream &o, const char *)
void PutCanvasTitle(const char *title)
virtual Bool_t MakeTree(bool read)
Bool_t Init(bool read=false)
void SetOutputName(const char *name)
static Global * SetBranch(TTree *tree)
void MakeCanvas(const char *title)