CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
produceOfflineValidationTex.PageLayout Class Reference

Public Member Functions

def __init__
 
def fit
 

Public Attributes

 height
 
 pattern
 
 width
 

Detailed Description

Definition at line 47 of file produceOfflineValidationTex.py.

Constructor & Destructor Documentation

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

Definition at line 48 of file produceOfflineValidationTex.py.

48 
49  def __init__(self, pattern=[], width=1, height=1):
50  self.pattern = [] # List of rows; row contains the order numbers
51  # of its plots; e.g. [[1,2,3], [4,5,6]]
52  self.width = width # Maximum width of one plot,
53  # with respect to textwidth.
54  self.height = height # Maximum height of one plot,
55  # with respect to textheight.

Member Function Documentation

def produceOfflineValidationTex.PageLayout.fit (   self,
  plots 
)

Definition at line 58 of file produceOfflineValidationTex.py.

References produceOfflineValidationTex.PageLayout.height, svgfig.Plot.height, svgfig.Frame.height, svgfig.Dots.height, produceOfflineValidationTex.PageLayout.pattern, produceOfflineValidationTex.PageLayout.width, svgfig.Plot.width, svgfig.Frame.width, and svgfig.Dots.width.

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

Member Data Documentation

produceOfflineValidationTex.PageLayout.height

Definition at line 53 of file produceOfflineValidationTex.py.

Referenced by Vispa.Main.MainWindow.MainWindow._saveIni(), Vispa.Gui.VispaWidget.VispaWidget.autosize(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), Vispa.Gui.ConnectableWidget.ConnectableWidget.centerSinglePortVertically(), Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.VispaWidget.VispaWidget.defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineRoundRectBackgroundShape(), produceOfflineValidationTex.PageLayout.fit(), Vispa.Gui.VispaWidget.VispaWidget.imageRectF(), Vispa.Gui.VispaWidget.VispaWidget.paint(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), and Vispa.Main.MainWindow.MainWindow.updateStartupScreenGeometry().

produceOfflineValidationTex.PageLayout.pattern

Definition at line 49 of file produceOfflineValidationTex.py.

Referenced by produceOfflineValidationTex.PageLayout.fit().

produceOfflineValidationTex.PageLayout.width

Definition at line 51 of file produceOfflineValidationTex.py.

Referenced by python.rootplot.utilities.Hist.__init_TGraph(), Vispa.Main.MainWindow.MainWindow._saveIni(), Vispa.Gui.VispaWidget.VispaWidget.autosize(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.VispaWidget.VispaWidget.defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineRoundRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.drawHeaderBackground(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), produceOfflineValidationTex.PageLayout.fit(), Vispa.Gui.VispaWidget.VispaWidget.imageRectF(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), Vispa.Views.PropertyView.PropertyView.resizeEvent(), Vispa.Views.PropertyView.PropertyView.sectionResized(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), and Vispa.Main.MainWindow.MainWindow.updateStartupScreenGeometry().