CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
produceOfflineValidationTex Namespace Reference

Functions

def main
 

Function Documentation

def produceOfflineValidationTex.main ( )

Definition at line 30 of file produceOfflineValidationTex.py.

References print(), python.rootplot.root2matplotlib.replace(), presentation.validationclasses(), and TablePrint.write.

30 
31 def main():
32  print('Producing a .tex file from plots...')
33 
34  # Get plots from given paths
35  if len(sys.argv) < 2:
36  print('Error: Need path of plots as an argument!')
37  sys.exit(1)
38 
39  validations = []
40  for plotpath in sys.argv[1:]:
41  validations.append(ValidationPlots(plotpath))
42 
43  classes = validationclasses(validations)
44 
45  # Compose .tex frames
46  frames = ''
47  for cls in classes:
48  for subsection in cls.presentationsubsections():
49  frames += subsection.write([_ for _ in validations if _.validationclass == cls])
50  # Summary
51  frames += SummarySection().write(validations)
52  # Additional plots
53  #frames += writePageReg('YourRegExp', 'PageTitle', validations)
54 
55  # Write final .tex file
56  file = open('presentation.tex', 'w')
57  file.write(texTemplate.replace('[frames]', frames).\
58  replace('[time]', time.ctime()))
59  file.close()
60 
61  # A script to get from .tex to .pdf
62  pdfScript = open('toPdf.sh', 'w')
63  pdfScript.write(toPdf)
64  pdfScript.close()
65  os.chmod("toPdf.sh", stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
66 
67 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def validationclasses
Definition: presentation.py:38