CMS 3D CMS Logo

Functions
produceOfflineValidationTex Namespace Reference

Functions

def main ()
 

Function Documentation

◆ main()

def produceOfflineValidationTex.main ( )

Definition at line 30 of file produceOfflineValidationTex.py.

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

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