AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeSlides.C
Go to the documentation of this file.
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 
3 #include <Riostream.h>
4 
5 // ROOT includes
6 #include "TString.h"
7 #include "TSystem.h"
8 #include "TROOT.h"
9 #include "TFile.h"
10 #include "TEnv.h"
11 #include "TObjArray.h"
12 #include "TObjString.h"
13 #include "TArrayI.h"
14 #include "TPRegexp.h"
15 #endif
16 
17 //_________________________________
18 TString PdfToTxt ( TString filename, Bool_t clear = kFALSE )
19 {
20  TString convertedFilename = filename;
21  convertedFilename.ReplaceAll(".pdf",".txt");
22 
23  if ( clear ) {
24  if ( gSystem->AccessPathName(convertedFilename.Data()) == 0 ) {
25  gSystem->Exec(Form("rm %s",convertedFilename.Data()));
26  }
27  return "";
28  }
29 
30  if ( gSystem->AccessPathName(convertedFilename.Data()) != 0 ) {
31  gSystem->Exec(Form("gs -dBATCH -dNOPAUSE -sDEVICE=txtwrite -sOutputFile=- %s | xargs -I %% > %s",filename.Data(),convertedFilename.Data()));
32  }
33 
34  return convertedFilename;
35 }
36 
37 //_________________________________
38 TString GetTriggerShort ( TString trigName )
39 {
40  TObjArray* arr = trigName.Tokenize("-");
41  TString shortName = arr->At(0)->GetName();
42  if ( arr->GetEntries() > 2 ) {
43  shortName.Append(Form("-%s",arr->At(1)->GetName()));
44  }
45  delete arr;
46  return shortName;
47 }
48 
49 //_________________________________
51 {
52  TString specials = "+ ( )";
53  TObjArray* specialList = specials.Tokenize(" ");
54  for ( Int_t ichar=0; ichar<specialList->GetEntries(); ichar++ ) {
55  TString currChar = static_cast<TObjString*>(specialList->At(ichar))->GetString();
56  if ( str.Contains(currChar.Data()) ) str.ReplaceAll(currChar.Data(),Form("\\%s",currChar.Data()));
57  }
58  delete specialList;
59 }
60 
61 
62 //_________________________________
63 Int_t GetPage ( TString pattern, TString filename, TString trigger = "", Bool_t warnIfMissing = kTRUE )
64 {
65  TString convertedFilename = PdfToTxt(filename);
66 
67  ifstream inFile(convertedFilename.Data());
68  if ( ! inFile.is_open() ) return -1;
69 
71 
72  TObjArray* patternArr = pattern.Tokenize("&");
73  if ( ! trigger.IsNull() ) {
74  trigger.Prepend("(^|[ ]|/)");
75  trigger.Append("([ ]|$)");
76  patternArr->Add(new TObjString(trigger));
77  }
78 
79  TString currLine = "", currToken = "";
80  Int_t currPage = -1, foundPage = -1;
81  while ( ! inFile.eof() ) {
82  currToken.ReadToken(inFile);
83  if ( currToken == "Page" || inFile.eof() ) {
84  Bool_t isOk = kTRUE;
85  for ( Int_t ipat=0; ipat<patternArr->GetEntries(); ipat++ ) {
86  TString currPattern(static_cast<TObjString*>(patternArr->At(ipat))->GetString());
87  TPRegexp re(currPattern.Data());
88  if ( ! currLine.Contains(re) ) {
89  isOk = kFALSE;
90  break;
91  }
92  }
93  if ( isOk ) {
94  foundPage = currPage;
95  break;
96  }
97  if ( ! inFile.eof() ) {
98  currToken.ReadToken(inFile);
99  currPage = currToken.Atoi();
100  currLine = "";
101  }
102  }
103  else currLine += currToken + " ";
104  }
105  inFile.close();
106  delete patternArr;
107  if ( foundPage < 0 && warnIfMissing ) printf("Warning: cannot find %s\n",pattern.Data());
108 
109  return foundPage;
110 }
111 
112 //_________________________________
113 TString GetRunList ( TString filename )
114 {
115  TString convertedFilename = PdfToTxt(filename);
116 
117  ifstream inFile(convertedFilename.Data());
118  if ( ! inFile.is_open() ) return -1;
119 
120  TString runList = "", currToken = "";
121  TString keyword = "RUN:";
122  while ( ! inFile.eof() ) {
123  currToken.ReadToken(inFile);
124  if ( currToken.Contains(keyword.Data()) ) {
125  currToken.ReplaceAll(keyword.Data(),"");
126  if ( currToken.Contains(",") || currToken.IsDigit() ) {
127  runList = currToken;
128  break;
129  }
130  }
131  }
132  inFile.close();
133  return runList;
134 }
135 
136 //_________________________________
137 void EscapeSpecialChars ( TString& str )
138 {
139  str.ReplaceAll("\\","");
140  TString specials = "_";
141  TObjArray* specialList = specials.Tokenize(" ");
142  for ( Int_t ichar=0; ichar<specialList->GetEntries(); ichar++ ) {
143  TString currChar = static_cast<TObjString*>(specialList->At(ichar))->GetString();
144  if ( str.Contains(currChar.Data()) ) str.ReplaceAll(currChar.Data(),Form("\\\%s",currChar.Data()));
145  }
146  delete specialList;
147 }
148 
149 //_________________________________
150 void BeginFrame ( TString title, ofstream& outFile, TString label = "" )
151 {
152  outFile << endl;
153  outFile << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
154  outFile << "\\begin{frame}";
155  if ( ! label.IsNull() ) outFile << "\\label{" << label.Data() << "}";
156  outFile << endl;
157  outFile << " \\frametitle{" << title.Data() << "}" << endl;
158 }
159 
160 //_________________________________
161 void EndFrame ( ofstream& outFile )
162 {
163  outFile << "\\end{frame}" << endl;
164 }
165 
166 //_________________________________
167 void MakeDefaultItem ( ofstream& outFile, TString defaultItem = "" )
168 {
169  outFile << "\\begin{itemize}" << endl;
170  outFile << " \\item " << defaultItem.Data() << endl;
171  outFile << "\\end{itemize}" << endl;
172 }
173 
174 //_________________________________
175 Bool_t MakeSingleFigureSlide ( TString pattern, TString filename, TString title, ofstream &outFile, TString trigger = "", TString label = "", Bool_t warnIfMissing = kTRUE )
176 {
177  Int_t pageNum = GetPage(pattern,filename,trigger,warnIfMissing);
178  if ( pageNum<0 ) {
179  return kFALSE;
180  }
181 
182  BeginFrame(title,outFile,label);
183  outFile << " \\begin{columns}[onlytextwidth]" << endl;
184  outFile << " \\column{\\textwidth}" << endl;
185  outFile << " \\centering" << endl;
186  outFile << " \\includegraphics[width=0.98\\textwidth,height=0.92\\textheight,page=" << pageNum << "]{" << gSystem->BaseName(filename.Data()) << "}" <<endl;
187  outFile << " \\end{columns}" << endl;
188  EndFrame(outFile);
189  return kTRUE;
190 }
191 
192 //_________________________________
193 Bool_t MakeTriggerSlide ( TString filename, ofstream &outFile )
194 {
195  BeginFrame("Trigger chamber efficiencies", outFile);
196  outFile << " \\begin{columns}[onlytextwidth]" << endl;
197  outFile << " \\column{0.66\\textwidth}" << endl;
198  outFile << " \\centering" << endl;
199  for ( Int_t ich=0; ich<4; ich++ ) {
200  if ( ich%2 == 0 ) outFile << endl;
201  Int_t ipage = GetPage(Form("Trigger chamber efficiency vs run for chamber %i",11+ich),filename);
202  outFile << " \\includegraphics[width=0.48\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
203  }
204  outFile << " \\column{0.34\\textwidth}" << endl;
205  outFile << " \\centering" << endl;
206  Int_t ipage = GetPage("Multinomial probability",filename);
207  outFile << " \\includegraphics[width=0.98\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
208  outFile << " \\end{columns}" << endl;
209  EndFrame(outFile);
210  return kTRUE;
211 }
212 
213 //_________________________________
214 Bool_t MakeTriggerRPCslide ( TString filename, ofstream &outFile, Bool_t outliers = kFALSE )
215 {
216  TString baseName = outliers ? "eff.-<eff.> for outliers" : "efficiency";
217  BeginFrame(Form("Trigger chamber %s per RPC",baseName.Data()),outFile,outliers?"":"rpcEff");
218  outFile << " \\begin{columns}[onlytextwidth]" << endl;
219  outFile << " \\column{\\textwidth}" << endl;
220  outFile << " \\centering" << endl;
221  for ( Int_t ich=0; ich<4; ich++ ) {
222  if ( ich%2 == 0 ) outFile << endl;
223  Int_t ipage = GetPage(Form("Trigger chamber %s vs run for chamber %i&RPC",baseName.Data(),11+ich),filename);
224  outFile << " \\includegraphics[width=0.37\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
225  }
226  outFile << " \\end{columns}" << endl;
227  EndFrame(outFile);
228  return kTRUE;
229 }
230 
231 //_________________________________
232 void MakeSummary ( TString period, ofstream &outFile, TString trackerQA )
233 {
234  BeginFrame("Summary I",outFile);
235  outFile << "General informations" << endl;
236  outFile << "\\begin{itemize}" << endl;
237  outFile << " \\item Runs selected for MUON on ALICE logbook:" << endl;
238  outFile << " \\begin{itemize}" << endl;
239  outFile << " \\item Run Type: PHYSICS" << endl;
240  outFile << " \\item Duration: at least 10 min" << endl;
241  outFile << " \\item GDC mStream Recording: Yes" << endl;
242  outFile << " \\item Period: " << period.Data() << endl;
243  outFile << " \\item Detectors: At least [ MUON\\_TRG \\& MUON\\_TRK ] as Readout" << endl;
244  outFile << " \\item Quality: globally GOOD and NOT BAD for readout Detectors" << endl;
245  outFile << " \\item Beam Mode: STABLE" << endl;
246  outFile << " \\end{itemize}" << endl;
247  outFile << "\\end{itemize}" << endl;
248  outFile << endl;
249  outFile << " \\vspace{5mm}" << endl;
250  outFile << endl;
251  outFile << "\\begin{columns}[onlytextwidth]" << endl;
252  outFile << " \\column{\\textwidth}" << endl;
253  outFile << " \\centering" << endl;
254  outFile << " \\begin{tabular}{|l|lll|}" << endl;
255  outFile << " \\hline" << endl;
256  outFile << " & Total runs & CMUL & CMSL \\\\" << endl;
257  outFile << " \\hline" << endl;
258  outFile << " ALICE logbook & xx & xx & xx\\\\" << endl;
259  outFile << " Good from QA & xx & xx & xx\\\\" << endl;
260  outFile << " \\hline" << endl;
261  outFile << " \\end{tabular}" << endl;
262  outFile << "\\end{columns}" << endl;
263  EndFrame(outFile);
264 
265  BeginFrame("Summary II",outFile);
266  outFile << endl;
267  outFile << "General:" << endl;
268  MakeDefaultItem(outFile);
269  outFile << endl;
270  outFile << "MTR efficiency:" << endl;
271  MakeDefaultItem(outFile,"More than xx\\% efficiency in trigger chambers, stable");
272  outFile << endl;
273  outFile << "MCH and MUON data quality:" << endl;
274  MakeDefaultItem(outFile);
275  EndFrame(outFile);
276 
277  TString runList = GetRunList(trackerQA);
278  TObjArray* runListArr = runList.Tokenize(",");
279  runListArr->Sort();
280 
281  TString romanNum[10] = {"I","II","III","IV","V","VI","VII","VIII","IX","X"};
282 
283  Int_t nRuns = runListArr->GetEntries();
284  Int_t nRunsPerPage = 40;
285  Int_t nRunsPerColumn = nRunsPerPage/2;
286 
287  Int_t nPages = nRuns/nRunsPerPage;
288  if ( nRuns%nRunsPerPage > 0 ) nPages++;
289 
290  Int_t irun = 0;
291 
292  for ( Int_t ipage=0; ipage<nPages; ipage++ ) {
293  TString title = "Run summary";
294  if ( nPages > 1 ) title += Form(" (%s)",romanNum[ipage].Data());
295  BeginFrame(title,outFile);
296  outFile << " \\begin{columns}[onlytextwidth,T]" << endl;
297  outFile << " \\footnotesize" << endl;
298  outFile << " \\column{0.5\\textwidth}" << endl;
299  outFile << " \\centering" << endl;
300  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
301  outFile << " \\hline" << endl;
302  if ( nRuns == 0 ) {
303  outFile << " \\runTab[\\errorColor]{xxx}{xxx}" << endl;
304  }
305  else {
306  while ( irun<nRuns ) {
307  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
308  if ( irun%nRunsPerColumn == 0 ) break;
309  }
310  }
311 
312  outFile << " \\hline" << endl;
313  outFile << " \\end{tabular}" << endl;
314  outFile << endl;
315  outFile << " \\column{0.5\\textwidth}" << endl;
316  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
317  Bool_t hasRuns = ( irun < nRuns );
318  if ( hasRuns ) outFile << " \\hline" << endl;
319  while ( irun<nRuns ) {
320  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
321  if ( irun%nRunsPerColumn == 0 ) break;
322  }
323  if ( hasRuns ) outFile << " \\hline" << endl;
324  if ( ipage == nPages -1 ) {
325  outFile << " \\hline" << endl;
326  outFile << " \\colorLegend" << endl;
327  outFile << " \\hline" << endl;
328  }
329  outFile << " \\end{tabular}" << endl;
330  outFile << " \\end{columns}" << endl;
331  EndFrame(outFile);
332  }
333 
334  delete runListArr;
335 }
336 
337 //_________________________________
338 void MakePreamble ( ofstream &outFile )
339 {
340  outFile << "\\documentclass[9pt,table]{beamer}" << endl;
341  outFile << "\\mode<presentation>" << endl;
342  outFile << "\\usepackage[T1]{fontenc}" << endl;
343  outFile << "\\usepackage{lmodern}" << endl;
344  outFile << "\\usepackage{textcomp}" << endl;
345  outFile << "\\usepackage{amsmath}" << endl;
346  outFile << "\\usepackage{color,graphicx}" << endl;
347  outFile << "\\usepackage{colortbl}" << endl;
348  outFile << "\\usepackage{multirow}" << endl;
349  outFile << "\\usepackage{pifont}" << endl;
350  outFile << "\\usepackage{wasysym}" << endl;
351  outFile << "\\usepackage{appendixnumberbeamer}" << endl;
352  outFile << "\\usepackage[absolute,overlay]{textpos}" << endl;
353  outFile << "\\usetheme{Madrid}" << endl;
354  outFile << "\\useoutertheme{shadow}" << endl;
355  outFile << endl;
356  outFile << "\\setbeamersize{text margin left=0.5cm, text margin right=0.5cm}" << endl;
357  outFile << endl;
358  outFile << "\\hypersetup{colorlinks,linkcolor=red,urlcolor=blue}" << endl;
359  outFile << endl;
360  outFile << "% Slightly change the template" << endl;
361  outFile << "\\setbeamertemplate{navigation symbols}{} %suppress navigation symbols (bottom-right of frame)" << endl;
362 
363  outFile << "\\setbeamercolor*{author in head/foot}{parent=palette tertiary}" << endl;
364  outFile << "\\setbeamercolor*{title in head/foot}{parent=palette secondary}" << endl;
365  outFile << "\\setbeamercolor*{date in head/foot}{parent=palette primary}" << endl;
366  outFile << "\\setbeamercolor*{section in head/foot}{parent=palette tertiary}" << endl;
367  outFile << "\\setbeamercolor*{subsection in head/foot}{parent=palette primary}" << endl;
368  outFile << "\\newcommand{\\changeFootline}[1]{" << endl;
369  outFile << " \\setbeamertemplate{footline}{" << endl;
370  outFile << " \\hbox{%" << endl;
371  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%" << endl;
372  outFile << " \\insertshortauthor%~~(\\insertshortinstitute)" << endl;
373  outFile << " \\end{beamercolorbox}%" << endl;
374  outFile << " \\begin{beamercolorbox}[wd=.6\\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%" << endl;
375  outFile << " \\hypersetup{hidelinks}%" << endl;
376  outFile << " \\insertshorttitle" << endl;
377  outFile << " \\hspace*{2em}\\insertshortdate{}" << endl;
378  outFile << " \\end{beamercolorbox}%" << endl;
379  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%" << endl;
380  outFile << " #1\\hspace*{2ex}" << endl;
381  outFile << " \\end{beamercolorbox}}%" << endl;
382  outFile << " }}" << endl;
383  outFile << "\\changeFootline{\\insertframenumber{} / \\inserttotalframenumber}" << endl;
384  outFile << "\\setbeamertemplate{headline}{}" << endl;
385  outFile << endl;
386  outFile << endl;
387  outFile << "\\newcommand{\\badForPassColor}{magenta!50!white}" << endl;
388  outFile << "\\newcommand{\\errorColor}{red!50!white}" << endl;
389  outFile << "\\newcommand{\\newColor}{blue!20!white}" << endl;
390  outFile << "\\newcommand{\\notInLogColor}{black!20!white}" << endl;
391  outFile << "\\newcommand{\\pendingColor}{yellow!50!white}" << endl;
392  outFile << "\\newcommand{\\warningColor}{orange!50!white}" << endl;
393  outFile << "\\newcommand{\\colorLegend}{" << endl;
394  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\newColor}{~~} = newly analyzed}\\\\" << endl;
395  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\notInLogColor}{~~} = non-selected from e-logbook}\\\\" << endl;
396  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\pendingColor}{~~} = pending statement}\\\\" << endl;
397  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\warningColor}{~~} = possible problem}\\\\" << endl;
398  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\errorColor}{~~} = problem spotted}\\\\" << endl;
399  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\badForPassColor}{~~} = bad for this pass}\\\\}" << endl;
400  outFile << "\\newcommand{\\runTab}[3][white]{\\cellcolor{#1} #2 & \\cellcolor{#1} #3\\\\}" << endl;
401  outFile << endl;
402  outFile << "\\newcommand{\\pik}{\\ensuremath{\\pi\\mathrm{/K}}}" << endl;
403  outFile << "\\newcommand{\\mum}{\\mbox{$\\mu {\\rm m}$}}" << endl;
404  outFile << "\\newcommand{\\mom}{\\mbox{GeV$\\kern-0.15em /\\kern-0.12em c$}}" << endl;
405  outFile << "\\newcommand{\\pt}{\\ensuremath{p_{\\mathrm{T}}}}" << endl;
406  outFile << "\\newcommand{\\dd}{\\text{d}}" << endl;
407  outFile << "\\newcommand{\\raa}{\\ensuremath{R_{AA}}}" << endl;
408  outFile << "\\newcommand{\\un}[1]{\\protect\\detokenize{#1}}" << endl;
409  outFile << endl;
410 }
411 
412 //_________________________________
413 void BeginSlides ( TString period, TString pass, TString authors, ofstream &outFile )
414 {
415  TString authorsShort = "";
416  Bool_t previousIsLetter = kFALSE;
417  for ( Int_t ichar=0; ichar<authors.Length(); ichar++ ) {
418  TString currChar = authors[ichar];
419  currChar.ToUpper();
420  Int_t currentIsLetter = currChar.IsAlpha();
421  if ( currentIsLetter && ! previousIsLetter ) authorsShort += currChar + ".";
422  if ( currChar == "," ) authorsShort += ",";
423  previousIsLetter = currentIsLetter;
424  }
425 
426  outFile << "\\title{Muon QA: " << period.Data() << " " << pass.Data() << "}" << endl;
427  outFile << "\\author[" << authorsShort.Data() << "]{" << authors.Data() << "}" << endl;
428  outFile << "\\date{\\today}" << endl;
429 
430  outFile << "\\begin{document}" << endl;
431  outFile << "\\setlength{\\TPHorizModule}{1bp}" << endl;
432  outFile << "\\setlength{\\TPVertModule}{1bp}" << endl;
433  outFile << "\\textblockorigin{0bp}{0bp}" << endl;
434  outFile << endl;
435  outFile << "\\graphicspath{{images/}}" << endl;
436 
437  outFile << endl;
438  outFile << "\\begin{frame}" << endl;
439  outFile << " \\titlepage" << endl;
440  outFile << "\\end{frame}" << endl;
441 }
442 
443 //_________________________________
444 void EndSlides ( ofstream &outFile )
445 {
446  outFile << "\\end{document}" << endl;
447  outFile.close();
448 }
449 
450 //_________________________________
451 void StartAppendix ( ofstream &outFile )
452 {
453  outFile << endl;
454  outFile << endl;
455  outFile << "\\AtBeginSection[] % Do nothing for \\section*" << endl;
456  outFile << "{" << endl;
457  outFile << " \\begin{frame}<beamer>" << endl;
458  outFile << " \\begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}" << endl;
459  outFile << " \\usebeamerfont{title}\\insertsectionhead" << endl;
460  outFile << " \\end{beamercolorbox}" << endl;
461  outFile << " \\end{frame}" << endl;
462  outFile << "}" << endl;
463  outFile << endl;
464  outFile << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
465  outFile << "\\appendix" << endl;
466  outFile << "\\changeFootline{A.\\insertframenumber{}}" << endl;
467  outFile << "\\hypersetup{hidelinks}" << endl;
468  outFile << "\\section{\\huge Backup slides}" << endl;
469 }
470 
471 //_________________________________
472 void WriteRunList ( TString trackerQA, TString outFilename = "runListQA.txt" )
473 {
474  TString runList = GetRunList(trackerQA);
475  TObjArray* runListArr = runList.Tokenize(",");
476 
477  ofstream outFile(outFilename);
478  for ( Int_t irun=0; irun<runListArr->GetEntries(); irun++ ) {
479  outFile << static_cast<TObjString*>(runListArr->At(irun))->GetString().Atoi() << endl;
480  }
481  outFile.close();
482  delete runListArr;
483 
484  PdfToTxt(trackerQA,kTRUE);
485 }
486 
487 //_________________________________
488 void MakeSlides ( TString period, TString pass, TString triggerList, TString authors, TString trackerQA = "QA_muon_tracker.pdf", TString triggerQA = "QA_muon_trigger.pdf", TString texFilename = "muonQA.tex", TString outRunList = "" )
489 {
490  if ( gSystem->AccessPathName(texFilename.Data()) == 0 ) {
491  printf("Output file %s already exists\nPlease remove it!\n", texFilename.Data());
492  return;
493  }
494 
495  TString hasGs = gSystem->GetFromPipe("which gs");
496  if ( hasGs.IsNull() ) {
497  printf("The macro selects the pdf page with gs, but the program was not found on this machine. Sorry, but slides cannot be automatically generated on this machine.\n");
498  return;
499  }
500 
501  EscapeSpecialChars(period);
502  EscapeSpecialChars(pass);
503 
504  TObjArray* trigList = triggerList.Tokenize(",");
505 
506  ofstream outFile(texFilename);
507  outFile << "%TriggerList=" << triggerList.Data() << endl;
508  MakePreamble(outFile);
509  BeginSlides(period,pass,authors,outFile);
510 
511  MakeSummary(period,outFile,trackerQA);
512 
513  MakeSingleFigureSlide("Selections: RUN",trackerQA,"Number of events per trigger",outFile);
514  MakeSingleFigureSlide("L2A from QA",triggerQA,"Reconstruction: reconstructed triggers in QA wrt L2A from OCDB scalers",outFile);
515  MakeTriggerSlide(triggerQA,outFile);
516 
517  for ( Int_t itrig=0; itrig<trigList->GetEntries(); itrig++ ) {
518  TString currTrig = trigList->At(itrig)->GetName();
519  TString shortTrig = GetTriggerShort(currTrig);
520  MakeSingleFigureSlide("Number of Tracks",trackerQA,Form("Muon tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
521  MakeSingleFigureSlide("Number of Tracks&for high mult.",trackerQA,Form("Muon tracks / event in %s events (central collisions)",shortTrig.Data()),outFile,currTrig,"",kFALSE);
522  MakeSingleFigureSlide("Sum of trigger tracks (matched + trigger-only) / # events in",trackerQA,Form("Muon tracker-trigger tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
523  MakeSingleFigureSlide("Matched tracks charge asymmetry for&with acc. cuts",trackerQA,Form("Charge asymmetry in %s events",shortTrig.Data()),outFile,currTrig);
524  MakeSingleFigureSlide("Identified beam-gas tracks (pxDCA cuts) in matched tracks for",trackerQA,Form("Rel. num. of beam-gas tracks (id. by p$\\times$DCA cuts) in %s events",shortTrig.Data()),outFile,currTrig);
525  }
526  MakeSingleFigureSlide("averaged number of associated clusters or of the number of chamber hit per track",trackerQA,"Average number of clusters per track and dispersion",outFile);
527  MakeSingleFigureSlide("averaged number of clusters in chamber i per track",trackerQA,"Average number of clusters per chamber",outFile,"","clustersPerChamber");
528 
529  StartAppendix(outFile);
530  MakeSingleFigureSlide("Physics Selection Cut on selected triggers:",trackerQA,"Physics selection effects",outFile);
531  MakeSingleFigureSlide("<X> of clusters - associated to a track - in chamber i",trackerQA,"Average cluster position per chamber",outFile);
532  MakeSingleFigureSlide("averaged normalized",trackerQA,"Tracking quality",outFile);
533 
534  MakeTriggerRPCslide(triggerQA,outFile);
535  MakeTriggerRPCslide(triggerQA,outFile,kTRUE);
536  MakeSingleFigureSlide("Trigger Lpt cut per run",trackerQA,"Trigger \\pt\\ cut",outFile);
537 
538  BeginFrame("Hardware issues",outFile);
539  outFile << "MUON Trigger" << endl;
540  MakeDefaultItem(outFile);
541  outFile << endl;
542  outFile << "MUON tracker" << endl;
543  MakeDefaultItem(outFile);
544  EndFrame(outFile);
545 
546  EndSlides(outFile);
547 
548  delete trigList;
549 
550  if ( ! outRunList.IsNull() ) WriteRunList(trackerQA, outRunList);
551 
552  // Clean converted txt files
553  TString filenames[2] = {trackerQA, triggerQA};
554  for ( Int_t ifile=0; ifile<2; ifile++ ) {
555  PdfToTxt(filenames[ifile],kTRUE);
556  }
557 }
void BeginSlides(TString period, TString pass, TString authors, ofstream &outFile)
Definition: MakeSlides.C:413
return jsonbuilder str().c_str()
Bool_t MakeTriggerSlide(TString filename, ofstream &outFile)
Definition: MakeSlides.C:193
const char * title
Definition: MakeQAPdf.C:26
void MakeDefaultItem(ofstream &outFile, TString defaultItem="")
Definition: MakeSlides.C:167
void MakeSlides(TString period, TString pass, TString triggerList, TString authors, TString trackerQA="QA_muon_tracker.pdf", TString triggerQA="QA_muon_trigger.pdf", TString texFilename="muonQA.tex", TString outRunList="")
Definition: MakeSlides.C:488
void MakeSummary(TString period, ofstream &outFile, TString trackerQA)
Definition: MakeSlides.C:232
TSystem * gSystem
void WriteRunList(TString trackerQA, TString outFilename="runListQA.txt")
Definition: MakeSlides.C:472
TString GetRunList(TString filename)
Definition: MakeSlides.C:113
Bool_t MakeTriggerRPCslide(TString filename, ofstream &outFile, Bool_t outliers=kFALSE)
Definition: MakeSlides.C:214
void MakePreamble(ofstream &outFile)
Definition: MakeSlides.C:338
Bool_t MakeSingleFigureSlide(TString pattern, TString filename, TString title, ofstream &outFile, TString trigger="", TString label="", Bool_t warnIfMissing=kTRUE)
Definition: MakeSlides.C:175
void EscapeSpecialChars(TString &str)
Definition: MakeSlides.C:137
void EndSlides(ofstream &outFile)
Definition: MakeSlides.C:444
void BeginFrame(TString title, ofstream &outFile, TString label="")
Definition: MakeSlides.C:150
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void EndFrame(ofstream &outFile)
Definition: MakeSlides.C:161
Int_t GetPage(TString pattern, TString filename, TString trigger="", Bool_t warnIfMissing=kTRUE)
Definition: MakeSlides.C:63
void StartAppendix(ofstream &outFile)
Definition: MakeSlides.C:451
TString PdfToTxt(TString filename, Bool_t clear=kFALSE)
Definition: MakeSlides.C:18
void EscapeSpecialCharsForRegex(TString &str)
Definition: MakeSlides.C:50
TString GetTriggerShort(TString trigName)
Definition: MakeSlides.C:38