CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
presentation.PageLayout Class Reference
Inheritance diagram for presentation.PageLayout:

Public Member Functions

def __init__ (self, pattern=[], width=1, height=1)
 
def fit (self, plots)
 

Public Attributes

 height
 
 pattern
 
 width
 

Detailed Description

Definition at line 46 of file presentation.py.

Constructor & Destructor Documentation

◆ __init__()

def presentation.PageLayout.__init__ (   self,
  pattern = [],
  width = 1,
  height = 1 
)

Definition at line 47 of file presentation.py.

47  def __init__(self, pattern=[], width=1, height=1):
48  self.pattern = [] # List of rows; row contains the order numbers
49  # of its plots; e.g. [[1,2,3], [4,5,6]]
50  self.width = width # Maximum width of one plot,
51  # with respect to textwidth.
52  self.height = height # Maximum height of one plot,
53  # with respect to textheight.
54 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ fit()

def presentation.PageLayout.fit (   self,
  plots 
)

Definition at line 57 of file presentation.py.

References mps_setup.append, presentation.PageLayout.height, svgfig.Plot.height, svgfig.Frame.height, svgfig.Dots.height, createfilelist.int, presentation.PageLayout.pattern, FastTimerService_cff.range, presentation.PageLayout.width, svgfig.Plot.width, svgfig.Frame.width, and svgfig.Dots.width.

Referenced by trackingPlots.Iteration.modules().

57  def fit(self, plots):
58  rowlengths = []
59  # First, try to place plots in a square.
60  nplots = sum(len(p) for p in plots)
61  length = int(math.ceil(math.sqrt(nplots)))
62  # Then, fill the square from the bottom and remove extra rows.
63  fullRows = int(nplots/length)
64  residual = nplots - length*fullRows
65  nrows = fullRows
66  if residual != 0:
67  rowlengths.append(residual)
68  nrows += 1
69  for _ in range(fullRows):
70  rowlengths.append(length)
71 
72  # Now, fill the pattern.
73  self.pattern = []
74  if residual == 0 and len(plots[0])%length != 0 and\
75  len(plots[0])%nrows == 0:
76  # It's better to arrange plots in columns, not rows.
77  self.pattern.extend(list(range(i, i+nrows*(length-1)+1, nrows))
78  for i in range(1, nrows+1))
79  else:
80  if residual != 0:
81  self.pattern.append(list(range(1, 1+residual)))
82  self.pattern.extend(list(range(i, i+length)) for i in
83  range(residual+1, nplots-length+2, length))
84 
85  self.width = 1.0/length
86  self.height = 0.8/nrows
87 
88 
89 # Write a set of pages, one for each subdetector.
90 # Arguments: identifier: regular expression to get the wanted plots,
91 # used together with subdetector name
92 # title: title of the plot type
93 # validations: list of relevant ValidationPlots objects.
94 # Returns the parsed script.

Member Data Documentation

◆ height

presentation.PageLayout.height

◆ pattern

presentation.PageLayout.pattern

Definition at line 48 of file presentation.py.

Referenced by presentation.PageLayout.fit(), and dataset.BaseDataset.printFiles().

◆ width

presentation.PageLayout.width