AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables 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 = "" )
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 ) 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 )
151 {
152  outFile << endl;
153  outFile << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
154  outFile << "\\begin{frame}" << endl;
155  outFile << " \\frametitle{" << title.Data() << "}" << endl;
156 }
157 
158 //_________________________________
159 void EndFrame ( ofstream& outFile )
160 {
161  outFile << "\\end{frame}" << endl;
162 }
163 
164 //_________________________________
165 void MakeDefaultItem ( ofstream& outFile, TString defaultItem = "" )
166 {
167  outFile << "\\begin{itemize}" << endl;
168  outFile << " \\item " << defaultItem.Data() << endl;
169  outFile << "\\end{itemize}" << endl;
170 }
171 
172 //_________________________________
173 Bool_t MakeSingleFigureSlide ( TString pattern, TString filename, TString title, ofstream &outFile, TString trigger = "" )
174 {
175  Int_t pageNum = GetPage(pattern,filename,trigger);
176  if ( pageNum<0 ) {
177  return kFALSE;
178  }
179 
180  BeginFrame(title,outFile);
181  outFile << " \\begin{columns}[onlytextwidth]" << endl;
182  outFile << " \\column{\\textwidth}" << endl;
183  outFile << " \\centering" << endl;
184  outFile << " \\includegraphics[width=0.98\\textwidth,height=0.92\\textheight,page=" << pageNum << "]{" << gSystem->BaseName(filename.Data()) << "}" <<endl;
185  outFile << " \\end{columns}" << endl;
186  EndFrame(outFile);
187  return kTRUE;
188 }
189 
190 //_________________________________
191 Bool_t MakeTriggerSlide ( TString filename, ofstream &outFile )
192 {
193  BeginFrame("Trigger chamber efficiencies", outFile);
194  outFile << " \\begin{columns}[onlytextwidth]" << endl;
195  outFile << " \\column{0.66\\textwidth}" << endl;
196  outFile << " \\centering" << endl;
197  for ( Int_t ich=0; ich<4; ich++ ) {
198  if ( ich%2 == 0 ) outFile << endl;
199  Int_t ipage = GetPage(Form("Trigger chamber efficiency vs run for chamber %i",11+ich),filename);
200  outFile << " \\includegraphics[width=0.48\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
201  }
202  outFile << " \\column{0.34\\textwidth}" << endl;
203  outFile << " \\centering" << endl;
204  Int_t ipage = GetPage("Multinomial probability",filename);
205  outFile << " \\includegraphics[width=0.98\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
206  outFile << " \\end{columns}" << endl;
207  EndFrame(outFile);
208  return kTRUE;
209 }
210 
211 //_________________________________
212 Bool_t MakeTriggerRPCslide ( TString filename, ofstream &outFile, Bool_t outliers = kFALSE )
213 {
214  TString baseName = outliers ? "eff.-<eff.> for outliers" : "efficiency";
215  BeginFrame(Form("Trigger chamber %s per RPC",baseName.Data()),outFile);
216  outFile << " \\begin{columns}[onlytextwidth]" << endl;
217  outFile << " \\column{\\textwidth}" << endl;
218  outFile << " \\centering" << endl;
219  for ( Int_t ich=0; ich<4; ich++ ) {
220  if ( ich%2 == 0 ) outFile << endl;
221  Int_t ipage = GetPage(Form("Trigger chamber %s vs run for chamber %i&RPC",baseName.Data(),11+ich),filename);
222  outFile << " \\includegraphics[width=0.37\\textwidth,page=" << ipage << "]{" << filename.Data() << "}" << endl;
223  }
224  outFile << " \\end{columns}" << endl;
225  EndFrame(outFile);
226  return kTRUE;
227 }
228 
229 //_________________________________
230 void MakeSummary ( TString period, ofstream &outFile, TString trackerQA )
231 {
232  BeginFrame("Summary I",outFile);
233  outFile << "General informations" << endl;
234  outFile << "\\begin{itemize}" << endl;
235  outFile << " \\item Runs selected for MUON on ALICE logbook:" << endl;
236  outFile << " \\begin{itemize}" << endl;
237  outFile << " \\item Run Type: PHYSICS" << endl;
238  outFile << " \\item Duration: at least 10 min" << endl;
239  outFile << " \\item GDC mStream Recording: Yes" << endl;
240  outFile << " \\item Period: " << period.Data() << endl;
241  outFile << " \\item Detectors: At least [ MUON\\_TRG \\& MUON\\_TRK ] as Readout" << endl;
242  outFile << " \\item Quality: globally GOOD and NOT BAD for readout Detectors" << endl;
243  outFile << " \\item Beam Mode: STABLE" << endl;
244  outFile << " \\end{itemize}" << endl;
245  outFile << "\\end{itemize}" << endl;
246  outFile << endl;
247  outFile << " \\vspace{5mm}" << endl;
248  outFile << endl;
249  outFile << "\\begin{columns}[onlytextwidth]" << endl;
250  outFile << " \\column{\\textwidth}" << endl;
251  outFile << " \\centering" << endl;
252  outFile << " \\begin{tabular}{|l|lll|}" << endl;
253  outFile << " \\hline" << endl;
254  outFile << " & Total runs & CMUL & CMSL \\\\" << endl;
255  outFile << " \\hline" << endl;
256  outFile << " ALICE logbook & xx & xx & xx\\\\" << endl;
257  outFile << " Good from QA & xx & xx & xx\\\\" << endl;
258  outFile << " \\hline" << endl;
259  outFile << " \\end{tabular}" << endl;
260  outFile << "\\end{columns}" << endl;
261  EndFrame(outFile);
262 
263  BeginFrame("Summary II",outFile);
264  outFile << endl;
265  outFile << "General:" << endl;
266  MakeDefaultItem(outFile);
267  outFile << endl;
268  outFile << "MTR efficiency:" << endl;
269  MakeDefaultItem(outFile,"More than xx\\% efficiency in trigger chambers, stable");
270  outFile << endl;
271  outFile << "MCH and MUON data quality:" << endl;
272  MakeDefaultItem(outFile);
273  EndFrame(outFile);
274 
275  TString runList = GetRunList(trackerQA);
276  TObjArray* runListArr = runList.Tokenize(",");
277 
278  TString romanNum[10] = {"I","II","III","IV","V","VI","VII","VIII","IX","X"};
279 
280  Int_t nRuns = runListArr->GetEntries();
281  Int_t nRunsPerPage = 40;
282  Int_t nRunsPerColumn = nRunsPerPage/2;
283 
284  Int_t nPages = nRuns/nRunsPerPage;
285  if ( nRuns%nRunsPerPage > 0 ) nPages++;
286 
287  Int_t irun = 0;
288 
289  for ( Int_t ipage=0; ipage<nPages; ipage++ ) {
290  TString title = "Run summary";
291  if ( nPages > 1 ) title += Form(" (%s)",romanNum[ipage].Data());
292  BeginFrame(title,outFile);
293  outFile << " \\begin{columns}[onlytextwidth,T]" << endl;
294  outFile << " \\footnotesize" << endl;
295  outFile << " \\column{0.5\\textwidth}" << endl;
296  outFile << " \\centering" << endl;
297  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
298  outFile << " \\hline" << endl;
299  if ( nRuns == 0 ) {
300  outFile << " \\runTab[\\errorColor]{xxx}{xxx}" << endl;
301  }
302  else {
303  while ( irun<nRuns ) {
304  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
305  if ( irun%nRunsPerColumn == 0 ) break;
306  }
307  }
308 
309  outFile << " \\hline" << endl;
310  outFile << " \\end{tabular}" << endl;
311  outFile << endl;
312  outFile << " \\column{0.5\\textwidth}" << endl;
313  outFile << " \\begin{tabular}{|cp{0.63\\textwidth}|}" << endl;
314  Bool_t hasRuns = ( irun < nRuns );
315  if ( hasRuns ) outFile << " \\hline" << endl;
316  while ( irun<nRuns ) {
317  outFile << " \\runTab{" << static_cast<TObjString*>(runListArr->At(irun++))->GetString().Atoi() << "}{}" << endl;
318  if ( irun%nRunsPerColumn == 0 ) break;
319  }
320  if ( hasRuns ) outFile << " \\hline" << endl;
321  if ( ipage == nPages -1 ) {
322  outFile << " \\hline" << endl;
323  outFile << " \\colorLegend" << endl;
324  outFile << " \\hline" << endl;
325  }
326  outFile << " \\end{tabular}" << endl;
327  outFile << " \\end{columns}" << endl;
328  EndFrame(outFile);
329  }
330 
331  delete runListArr;
332 }
333 
334 //_________________________________
335 void MakePreamble ( ofstream &outFile )
336 {
337  outFile << "\\documentclass[9pt,table]{beamer}" << endl;
338  outFile << "\\mode<presentation>" << endl;
339  outFile << "\\usepackage[T1]{fontenc}" << endl;
340  outFile << "\\usepackage{lmodern}" << endl;
341  outFile << "\\usepackage{textcomp}" << endl;
342  outFile << "\\usepackage{amsmath}" << endl;
343  outFile << "\\usepackage{color,graphicx}" << endl;
344  outFile << "\\usepackage{colortbl}" << endl;
345  outFile << "\\usepackage{multirow}" << endl;
346  outFile << "\\usepackage{pifont}" << endl;
347  outFile << "\\usepackage{wasysym}" << endl;
348  outFile << "\\usepackage{appendixnumberbeamer}" << endl;
349  outFile << "\\usepackage[absolute,overlay]{textpos}" << endl;
350  outFile << "\\usetheme{Madrid}" << endl;
351  outFile << "\\useoutertheme{shadow}" << endl;
352 
353  outFile << "\\setbeamersize{text margin left=0.5cm, text margin right=0.5cm}" << endl;
354  outFile << endl;
355  outFile << "% Slightly change the template" << endl;
356  outFile << "\\setbeamertemplate{navigation symbols}{} %suppress navigation symbols (bottom-right of frame)" << endl;
357 
358  outFile << "\\setbeamercolor*{author in head/foot}{parent=palette tertiary}" << endl;
359  outFile << "\\setbeamercolor*{title in head/foot}{parent=palette secondary}" << endl;
360  outFile << "\\setbeamercolor*{date in head/foot}{parent=palette primary}" << endl;
361  outFile << "\\setbeamercolor*{section in head/foot}{parent=palette tertiary}" << endl;
362  outFile << "\\setbeamercolor*{subsection in head/foot}{parent=palette primary}" << endl;
363  outFile << "\\newcommand{\\changeFootline}[1]{" << endl;
364  outFile << " \\setbeamertemplate{footline}{" << endl;
365  outFile << " \\hbox{%" << endl;
366  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%" << endl;
367  outFile << " \\insertshortauthor%~~(\\insertshortinstitute)" << endl;
368  outFile << " \\end{beamercolorbox}%" << endl;
369  outFile << " \\begin{beamercolorbox}[wd=.6\\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%" << endl;
370  outFile << " \\insertshorttitle" << endl;
371  outFile << " \\hspace*{2em}\\insertshortdate{}" << endl;
372  outFile << " \\end{beamercolorbox}%" << endl;
373  outFile << " \\begin{beamercolorbox}[wd=.2\\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%" << endl;
374  outFile << " #1\\hspace*{2ex}" << endl;
375  outFile << " \\end{beamercolorbox}}%" << endl;
376  outFile << " }}" << endl;
377  outFile << "\\changeFootline{\\insertframenumber{} / \\inserttotalframenumber}" << endl;
378  outFile << "\\setbeamertemplate{headline}{}" << endl;
379  outFile << endl;
380  outFile << endl;
381  outFile << "\\newcommand{\\errorColor}{red!50!white}" << endl;
382  outFile << "\\newcommand{\\warningColor}{orange!50!white}" << endl;
383  outFile << "\\newcommand{\\pendingColor}{yellow!50!white}" << endl;
384  outFile << "\\newcommand{\\newColor}{blue!20!white}" << endl;
385  outFile << "\\newcommand{\\notInLogColor}{black!20!white}" << endl;
386  outFile << "\\newcommand{\\colorLegend}{" << endl;
387  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\newColor}{~~} = newly analyzed}\\\\" << endl;
388  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\notInLogColor}{~~} = non-selected from e-logbook}\\\\" << endl;
389  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\pendingColor}{~~} = pending statement}\\\\" << endl;
390  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\warningColor}{~~} = possible problem}\\\\" << endl;
391  outFile << " \\multicolumn{2}{|l|}{\\colorbox{\\errorColor}{~~} = problem spotted}\\\\}" << endl;
392  outFile << "\\newcommand{\\runTab}[3][white]{\\cellcolor{#1} #2 & \\cellcolor{#1} #3\\\\}" << endl;
393  outFile << endl;
394  outFile << "\\newcommand{\\pik}{\\ensuremath{\\pi\\mathrm{/K}}}" << endl;
395  outFile << "\\newcommand{\\mum}{\\mbox{$\\mu {\\rm m}$}}" << endl;
396  outFile << "\\newcommand{\\mom}{\\mbox{GeV$\\kern-0.15em /\\kern-0.12em c$}}" << endl;
397  outFile << "\\newcommand{\\pt}{\\ensuremath{p_{\\mathrm{T}}}}" << endl;
398  outFile << "\\newcommand{\\dd}{\\text{d}}" << endl;
399  outFile << "\\newcommand{\\raa}{\\ensuremath{R_{AA}}}" << endl;
400  outFile << "\\newcommand{\\un}[1]{\\protect\\detokenize{#1}}" << endl;
401  outFile << endl;
402 }
403 
404 //_________________________________
405 void BeginSlides ( TString period, TString pass, TString authors, ofstream &outFile )
406 {
407  TString authorsShort = "";
408  Bool_t previousIsLetter = kFALSE;
409  for ( Int_t ichar=0; ichar<authors.Length(); ichar++ ) {
410  TString currChar = authors[ichar];
411  currChar.ToUpper();
412  Int_t currentIsLetter = currChar.IsAlpha();
413  if ( currentIsLetter && ! previousIsLetter ) authorsShort += currChar + ".";
414  if ( currChar == "," ) authorsShort += ",";
415  previousIsLetter = currentIsLetter;
416  }
417 
418  outFile << "\\title{Muon QA: " << period.Data() << " " << pass.Data() << "}" << endl;
419  outFile << "\\author[" << authorsShort.Data() << "]{" << authors.Data() << "}" << endl;
420  outFile << "\\date{\\today}" << endl;
421 
422  outFile << "\\begin{document}" << endl;
423  outFile << "\\setlength{\\TPHorizModule}{1bp}" << endl;
424  outFile << "\\setlength{\\TPVertModule}{1bp}" << endl;
425  outFile << "\\textblockorigin{0bp}{0bp}" << endl;
426  outFile << endl;
427  outFile << "\\graphicspath{{images/}}" << endl;
428 
429  outFile << endl;
430  outFile << "\\begin{frame}" << endl;
431  outFile << " \\titlepage" << endl;
432  outFile << "\\end{frame}" << endl;
433 }
434 
435 //_________________________________
436 void EndSlides ( ofstream &outFile )
437 {
438  outFile << "\\end{document}" << endl;
439  outFile.close();
440 }
441 
442 //_________________________________
443 void StartAppendix ( ofstream &outFile )
444 {
445  outFile << endl;
446  outFile << endl;
447  outFile << "\\AtBeginSection[] % Do nothing for \\section*" << endl;
448  outFile << "{" << endl;
449  outFile << " \\begin{frame}<beamer>" << endl;
450  outFile << " \\begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}" << endl;
451  outFile << " \\usebeamerfont{title}\\insertsectionhead" << endl;
452  outFile << " \\end{beamercolorbox}" << endl;
453  outFile << " \\end{frame}" << endl;
454  outFile << "}" << endl;
455  outFile << endl;
456  outFile << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
457  outFile << "\\appendix" << endl;
458  outFile <<"\\changeFootline{A.\\insertframenumber{}}" << endl;
459  outFile << "\\section{\\huge Backup slides}" << endl;
460 }
461 
462 //_________________________________
463 void WriteRunList ( TString trackerQA, TString outFilename = "runListQA.txt" )
464 {
465  TString runList = GetRunList(trackerQA);
466  TObjArray* runListArr = runList.Tokenize(",");
467 
468  ofstream outFile(outFilename);
469  for ( Int_t irun=0; irun<runListArr->GetEntries(); irun++ ) {
470  outFile << static_cast<TObjString*>(runListArr->At(irun))->GetString().Atoi() << endl;
471  }
472  outFile.close();
473  delete runListArr;
474 
475  PdfToTxt(trackerQA,kTRUE);
476 }
477 
478 //_________________________________
479 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 = "" )
480 {
481  if ( gSystem->AccessPathName(texFilename.Data()) == 0 ) {
482  printf("Output file %s already exists\nPlease remove it!\n", texFilename.Data());
483  return;
484  }
485 
486  TString hasGs = gSystem->GetFromPipe("which gs");
487  if ( hasGs.IsNull() ) {
488  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");
489  return;
490  }
491 
492  EscapeSpecialChars(period);
493  EscapeSpecialChars(pass);
494 
495  TObjArray* trigList = triggerList.Tokenize(",");
496 
497  ofstream outFile(texFilename);
498  outFile << "%TriggerList=" << triggerList.Data() << endl;
499  MakePreamble(outFile);
500  BeginSlides(period,pass,authors,outFile);
501 
502  MakeSummary(period,outFile,trackerQA);
503 
504  MakeSingleFigureSlide("Selections: RUN",trackerQA,"Number of events per trigger",outFile);
505  MakeSingleFigureSlide("L2A from QA",triggerQA,"Reconstruction: reconstructed triggers in QA wrt L2A from OCDB scalers",outFile);
506  MakeTriggerSlide(triggerQA,outFile);
507 
508  for ( Int_t itrig=0; itrig<trigList->GetEntries(); itrig++ ) {
509  TString currTrig = trigList->At(itrig)->GetName();
510  TString shortTrig = GetTriggerShort(currTrig);
511  MakeSingleFigureSlide("Number of Tracks",trackerQA,Form("Muon tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
512  MakeSingleFigureSlide("Sum of trigger tracks (matched + trigger-only) / # events in",trackerQA,Form("Muon tracker-trigger tracks / event in %s events",shortTrig.Data()),outFile,currTrig);
513  MakeSingleFigureSlide("Matched tracks charge asymmetry for&with acc. cuts",trackerQA,Form("Charge asymmetry in %s events",shortTrig.Data()),outFile,currTrig);
514  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);
515  }
516  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);
517  MakeSingleFigureSlide("averaged number of clusters in chamber i per track",trackerQA,"Average number of clusters per chamber",outFile);
518 
519  StartAppendix(outFile);
520  MakeSingleFigureSlide("Physics Selection Cut on selected triggers:",trackerQA,"Physics selection effects",outFile);
521  MakeSingleFigureSlide("<X> of clusters - associated to a track - in chamber i",trackerQA,"Average cluster position per chamber",outFile);
522  MakeSingleFigureSlide("averaged normalized",trackerQA,"Tracking quality",outFile);
523 
524  MakeTriggerRPCslide(triggerQA,outFile);
525  MakeTriggerRPCslide(triggerQA,outFile,kTRUE);
526  MakeSingleFigureSlide("Trigger Lpt cut per run",trackerQA,"Trigger \\pt\\ cut",outFile);
527 
528  BeginFrame("Hardware issues",outFile);
529  outFile << "MUON Trigger" << endl;
530  MakeDefaultItem(outFile);
531  outFile << endl;
532  outFile << "MUON tracker" << endl;
533  MakeDefaultItem(outFile);
534  EndFrame(outFile);
535 
536  EndSlides(outFile);
537 
538  delete trigList;
539 
540  if ( ! outRunList.IsNull() ) WriteRunList(trackerQA, outRunList);
541 
542  // Clean converted txt files
543  TString filenames[2] = {trackerQA, triggerQA};
544  for ( Int_t ifile=0; ifile<2; ifile++ ) {
545  PdfToTxt(filenames[ifile],kTRUE);
546  }
547 }
void BeginSlides(TString period, TString pass, TString authors, ofstream &outFile)
Definition: MakeSlides.C:405
Bool_t MakeTriggerSlide(TString filename, ofstream &outFile)
Definition: MakeSlides.C:191
const char * title
Definition: MakeQAPdf.C:26
void MakeDefaultItem(ofstream &outFile, TString defaultItem="")
Definition: MakeSlides.C:165
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:479
void MakeSummary(TString period, ofstream &outFile, TString trackerQA)
Definition: MakeSlides.C:230
void BeginFrame(TString title, ofstream &outFile)
Definition: MakeSlides.C:150
TSystem * gSystem
void WriteRunList(TString trackerQA, TString outFilename="runListQA.txt")
Definition: MakeSlides.C:463
TString GetRunList(TString filename)
Definition: MakeSlides.C:113
Bool_t MakeTriggerRPCslide(TString filename, ofstream &outFile, Bool_t outliers=kFALSE)
Definition: MakeSlides.C:212
void MakePreamble(ofstream &outFile)
Definition: MakeSlides.C:335
void EscapeSpecialChars(TString &str)
Definition: MakeSlides.C:137
void EndSlides(ofstream &outFile)
Definition: MakeSlides.C:436
Int_t GetPage(TString pattern, TString filename, TString trigger="")
Definition: MakeSlides.C:63
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:159
void StartAppendix(ofstream &outFile)
Definition: MakeSlides.C:443
TString PdfToTxt(TString filename, Bool_t clear=kFALSE)
Definition: MakeSlides.C:18
void EscapeSpecialCharsForRegex(TString &str)
Definition: MakeSlides.C:50
Bool_t MakeSingleFigureSlide(TString pattern, TString filename, TString title, ofstream &outFile, TString trigger="")
Definition: MakeSlides.C:173
TString GetTriggerShort(TString trigName)
Definition: MakeSlides.C:38