AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 //_________________________________
50 void EscapeSpecialCharsForRegex ( TString& str )
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 
280  TString romanNum[10] = {"I","II","III","IV","V","VI","VII","VIII","IX","X"};
281 
282  Int_t nRuns = runListArr->GetEntries();
283  Int_t nRunsPerPage = 40;
284  Int_t nRunsPerColumn = nRunsPerPage/2;
285 
286  Int_t nPages = nRuns/nRunsPerPage;
287  if ( nRuns%nRunsPerPage > 0 ) nPages++;
288 
289  Int_t irun = 0;
290 
291  for ( Int_t ipage=0; ipage<nPages; ipage++ ) {
292  TString title = "Run summary";
293  if ( nPages > 1 ) title += Form(" (%s)",romanNum[ipage].Data());
294  BeginFrame(title,outFile);
295  outFile << " \\begin{columns}[onlytextwidth,T]" << endl;
296  outFile << " \\footnotesize" << endl;
297  outFile << " \\column{0.5\\textwidth}" << endl;
298  outFile << " \\centering" << endl;
299  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
300  outFile << " \\hline" << endl;
301  if ( nRuns == 0 ) {
302  outFile << " \\runTab[\\errorColor]{xxx}{xxx}" << endl;
303  }
304  else {
305  while ( irun<nRuns ) {
306  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
307  if ( irun%nRunsPerColumn == 0 ) break;
308  }
309  }
310 
311  outFile << " \\hline" << endl;
312  outFile << " \\end{tabular}" << endl;
313  outFile << endl;
314  outFile << " \\column{0.5\\textwidth}" << endl;
315  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
316  Bool_t hasRuns = ( irun < nRuns );
317  if ( hasRuns ) outFile << " \\hline" << endl;
318  while ( irun<nRuns ) {
319  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
320  if ( irun%nRunsPerColumn == 0 ) break;
321  }
322  if ( hasRuns ) outFile << " \\hline" << endl;
323  if ( ipage == nPages -1 ) {
324  outFile << " \\hline" << endl;
325  outFile << " \\colorLegend" << endl;
326  outFile << " \\hline" << endl;
327  }
328  outFile << " \\end{tabular}" << endl;
329  outFile << " \\end{columns}" << endl;
330  EndFrame(outFile);
331  }
332 
333  delete runListArr;
334 }
335 
336 //_________________________________
337 void MakePreamble ( ofstream &outFile )
338 {
339  outFile << "\\documentclass[9pt,table]{beamer}" << endl;
340  outFile << "\\mode<presentation>" << endl;
341  outFile << "\\usepackage[T1]{fontenc}" << endl;
342  outFile << "\\usepackage{lmodern}" << endl;
343  outFile << "\\usepackage{textcomp}" << endl;
344  outFile << "\\usepackage{amsmath}" << endl;
345  outFile << "\\usepackage{color,graphicx}" << endl;
346  outFile << "\\usepackage{colortbl}" << endl;
347  outFile << "\\usepackage{multirow}" << endl;
348  outFile << "\\usepackage{pifont}" << endl;
349  outFile << "\\usepackage{wasysym}" << endl;
350  outFile << "\\usepackage{appendixnumberbeamer}" << endl;
351  outFile << "\\usepackage[absolute,overlay]{textpos}" << endl;
352  outFile << "\\usetheme{Madrid}" << endl;
353  outFile << "\\useoutertheme{shadow}" << endl;
354  outFile << endl;
355  outFile << "\\setbeamersize{text margin left=0.5cm, text margin right=0.5cm}" << endl;
356  outFile << endl;
357  outFile << "\\hypersetup{colorlinks,linkcolor=red,urlcolor=blue}" << endl;
358  outFile << endl;
359  outFile << "% Slightly change the template" << endl;
360  outFile << "\\setbeamertemplate{navigation symbols}{} %suppress navigation symbols (bottom-right of frame)" << endl;
361 
362  outFile << "\\setbeamercolor*{author in head/foot}{parent=palette tertiary}" << endl;
363  outFile << "\\setbeamercolor*{title in head/foot}{parent=palette secondary}" << endl;
364  outFile << "\\setbeamercolor*{date in head/foot}{parent=palette primary}" << endl;
365  outFile << "\\setbeamercolor*{section in head/foot}{parent=palette tertiary}" << endl;
366  outFile << "\\setbeamercolor*{subsection in head/foot}{parent=palette primary}" << endl;
367  outFile << "\\newcommand{\\changeFootline}[1]{" << endl;
368  outFile << " \\setbeamertemplate{footline}{" << endl;
369  outFile << " \\hbox{%" << endl;
370  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%" << endl;
371  outFile << " \\insertshortauthor%~~(\\insertshortinstitute)" << endl;
372  outFile << " \\end{beamercolorbox}%" << endl;
373  outFile << " \\begin{beamercolorbox}[wd=.6\\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%" << endl;
374  outFile << " \\hypersetup{hidelinks}%" << endl;
375  outFile << " \\insertshorttitle" << endl;
376  outFile << " \\hspace*{2em}\\insertshortdate{}" << endl;
377  outFile << " \\end{beamercolorbox}%" << endl;
378  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%" << endl;
379  outFile << " #1\\hspace*{2ex}" << endl;
380  outFile << " \\end{beamercolorbox}}%" << endl;
381  outFile << " }}" << endl;
382  outFile << "\\changeFootline{\\insertframenumber{} / \\inserttotalframenumber}" << endl;
383  outFile << "\\setbeamertemplate{headline}{}" << endl;
384  outFile << endl;
385  outFile << endl;
386  outFile << "\\newcommand{\\errorColor}{red!50!white}" << endl;
387  outFile << "\\newcommand{\\warningColor}{orange!50!white}" << endl;
388  outFile << "\\newcommand{\\pendingColor}{yellow!50!white}" << endl;
389  outFile << "\\newcommand{\\newColor}{blue!20!white}" << endl;
390  outFile << "\\newcommand{\\notInLogColor}{black!20!white}" << endl;
391  outFile << "\\newcommand{\\colorLegend}{" << endl;
392  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\newColor}{~~} = newly analyzed}\\\\" << endl;
393  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\notInLogColor}{~~} = non-selected from e-logbook}\\\\" << endl;
394  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\pendingColor}{~~} = pending statement}\\\\" << endl;
395  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\warningColor}{~~} = possible problem}\\\\" << endl;
396  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\errorColor}{~~} = problem spotted}\\\\}" << endl;
397  outFile << "\\newcommand{\\runTab}[3][white]{\\cellcolor{#1} #2 & \\cellcolor{#1} #3\\\\}" << endl;
398  outFile << endl;
399  outFile << "\\newcommand{\\pik}{\\ensuremath{\\pi\\mathrm{/K}}}" << endl;
400  outFile << "\\newcommand{\\mum}{\\mbox{$\\mu {\\rm m}$}}" << endl;
401  outFile << "\\newcommand{\\mom}{\\mbox{GeV$\\kern-0.15em /\\kern-0.12em c$}}" << endl;
402  outFile << "\\newcommand{\\pt}{\\ensuremath{p_{\\mathrm{T}}}}" << endl;
403  outFile << "\\newcommand{\\dd}{\\text{d}}" << endl;
404  outFile << "\\newcommand{\\raa}{\\ensuremath{R_{AA}}}" << endl;
405  outFile << "\\newcommand{\\un}[1]{\\protect\\detokenize{#1}}" << endl;
406  outFile << endl;
407 }
408 
409 //_________________________________
410 void BeginSlides ( TString period, TString pass, TString authors, ofstream &outFile )
411 {
412  TString authorsShort = "";
413  Bool_t previousIsLetter = kFALSE;
414  for ( Int_t ichar=0; ichar<authors.Length(); ichar++ ) {
415  TString currChar = authors[ichar];
416  currChar.ToUpper();
417  Int_t currentIsLetter = currChar.IsAlpha();
418  if ( currentIsLetter && ! previousIsLetter ) authorsShort += currChar + ".";
419  if ( currChar == "," ) authorsShort += ",";
420  previousIsLetter = currentIsLetter;
421  }
422 
423  outFile << "\\title{Muon QA: " << period.Data() << " " << pass.Data() << "}" << endl;
424  outFile << "\\author[" << authorsShort.Data() << "]{" << authors.Data() << "}" << endl;
425  outFile << "\\date{\\today}" << endl;
426 
427  outFile << "\\begin{document}" << endl;
428  outFile << "\\setlength{\\TPHorizModule}{1bp}" << endl;
429  outFile << "\\setlength{\\TPVertModule}{1bp}" << endl;
430  outFile << "\\textblockorigin{0bp}{0bp}" << endl;
431  outFile << endl;
432  outFile << "\\graphicspath{{images/}}" << endl;
433 
434  outFile << endl;
435  outFile << "\\begin{frame}" << endl;
436  outFile << " \\titlepage" << endl;
437  outFile << "\\end{frame}" << endl;
438 }
439 
440 //_________________________________
441 void EndSlides ( ofstream &outFile )
442 {
443  outFile << "\\end{document}" << endl;
444  outFile.close();
445 }
446 
447 //_________________________________
448 void StartAppendix ( ofstream &outFile )
449 {
450  outFile << endl;
451  outFile << endl;
452  outFile << "\\AtBeginSection[] % Do nothing for \\section*" << endl;
453  outFile << "{" << endl;
454  outFile << " \\begin{frame}<beamer>" << endl;
455  outFile << " \\begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}" << endl;
456  outFile << " \\usebeamerfont{title}\\insertsectionhead" << endl;
457  outFile << " \\end{beamercolorbox}" << endl;
458  outFile << " \\end{frame}" << endl;
459  outFile << "}" << endl;
460  outFile << endl;
461  outFile << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
462  outFile << "\\appendix" << endl;
463  outFile << "\\changeFootline{A.\\insertframenumber{}}" << endl;
464  outFile << "\\hypersetup{hidelinks}" << endl;
465  outFile << "\\section{\\huge Backup slides}" << endl;
466 }
467 
468 //_________________________________
469 void WriteRunList ( TString trackerQA, TString outFilename = "runListQA.txt" )
470 {
471  TString runList = GetRunList(trackerQA);
472  TObjArray* runListArr = runList.Tokenize(",");
473 
474  ofstream outFile(outFilename);
475  for ( Int_t irun=0; irun<runListArr->GetEntries(); irun++ ) {
476  outFile << static_cast<TObjString*>(runListArr->At(irun))->GetString().Atoi() << endl;
477  }
478  outFile.close();
479  delete runListArr;
480 
481  PdfToTxt(trackerQA,kTRUE);
482 }
483 
484 //_________________________________
485 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 = "" )
486 {
487  if ( gSystem->AccessPathName(texFilename.Data()) == 0 ) {
488  printf("Output file %s already exists\nPlease remove it!\n", texFilename.Data());
489  return;
490  }
491 
492  TString hasGs = gSystem->GetFromPipe("which gs");
493  if ( hasGs.IsNull() ) {
494  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");
495  return;
496  }
497 
498  EscapeSpecialChars(period);
499  EscapeSpecialChars(pass);
500 
501  TObjArray* trigList = triggerList.Tokenize(",");
502 
503  ofstream outFile(texFilename);
504  outFile << "%TriggerList=" << triggerList.Data() << endl;
505  MakePreamble(outFile);
506  BeginSlides(period,pass,authors,outFile);
507 
508  MakeSummary(period,outFile,trackerQA);
509 
510  MakeSingleFigureSlide("Selections: RUN",trackerQA,"Number of events per trigger",outFile);
511  MakeSingleFigureSlide("L2A from QA",triggerQA,"Reconstruction: reconstructed triggers in QA wrt L2A from OCDB scalers",outFile);
512  MakeTriggerSlide(triggerQA,outFile);
513 
514  for ( Int_t itrig=0; itrig<trigList->GetEntries(); itrig++ ) {
515  TString currTrig = trigList->At(itrig)->GetName();
516  TString shortTrig = GetTriggerShort(currTrig);
517  MakeSingleFigureSlide("Number of Tracks",trackerQA,Form("Muon tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
518  MakeSingleFigureSlide("Number of Tracks&for high mult.",trackerQA,Form("Muon tracks / event in %s events (central collisions)",shortTrig.Data()),outFile,currTrig,"",kFALSE);
519  MakeSingleFigureSlide("Sum of trigger tracks (matched + trigger-only) / # events in",trackerQA,Form("Muon tracker-trigger tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
520  MakeSingleFigureSlide("Matched tracks charge asymmetry for&with acc. cuts",trackerQA,Form("Charge asymmetry in %s events",shortTrig.Data()),outFile,currTrig);
521  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);
522  }
523  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);
524  MakeSingleFigureSlide("averaged number of clusters in chamber i per track",trackerQA,"Average number of clusters per chamber",outFile,"","clustersPerChamber");
525 
526  StartAppendix(outFile);
527  MakeSingleFigureSlide("Physics Selection Cut on selected triggers:",trackerQA,"Physics selection effects",outFile);
528  MakeSingleFigureSlide("<X> of clusters - associated to a track - in chamber i",trackerQA,"Average cluster position per chamber",outFile);
529  MakeSingleFigureSlide("averaged normalized",trackerQA,"Tracking quality",outFile);
530 
531  MakeTriggerRPCslide(triggerQA,outFile);
532  MakeTriggerRPCslide(triggerQA,outFile,kTRUE);
533  MakeSingleFigureSlide("Trigger Lpt cut per run",trackerQA,"Trigger \\pt\\ cut",outFile);
534 
535  BeginFrame("Hardware issues",outFile);
536  outFile << "MUON Trigger" << endl;
537  MakeDefaultItem(outFile);
538  outFile << endl;
539  outFile << "MUON tracker" << endl;
540  MakeDefaultItem(outFile);
541  EndFrame(outFile);
542 
543  EndSlides(outFile);
544 
545  delete trigList;
546 
547  if ( ! outRunList.IsNull() ) WriteRunList(trackerQA, outRunList);
548 
549  // Clean converted txt files
550  TString filenames[2] = {trackerQA, triggerQA};
551  for ( Int_t ifile=0; ifile<2; ifile++ ) {
552  PdfToTxt(filenames[ifile],kTRUE);
553  }
554 }
void BeginSlides(TString period, TString pass, TString authors, ofstream &outFile)
Definition: MakeSlides.C:410
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:485
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:469
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:337
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:441
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:448
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