CMS 3D CMS Logo

Functions
produceOfflineValidationTex Namespace Reference

Functions

def main ()
 

Function Documentation

def produceOfflineValidationTex.main ( )

Definition at line 29 of file produceOfflineValidationTex.py.

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

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