CMS 3D CMS Logo

classes.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 ##########################################################################
4 # Classes which are needed by the mps_validate.py file.
5 
6 
7 
8 class PlotData:
9  """ Hold information about XYZ
10  """
11 
12  def __init__(self, mode):
13  self.numberOfBins = [0, 0, 0]
14  self.maxShift = [0, 0, 0]
15  self.minShift = [0, 0, 0]
16  self.maxBinShift = [0, 0, 0]
17  # used binShift
18  self.binShift = [0, 0, 0]
19  self.hiddenEntries = [0, 0, 0]
20  self.binPosition = [1, 1, 1]
21  self.usedRange = [0, 0, 0]
22  self.histo = []
23  self.histoAxis = []
24  # plot title and text
25  self.title = 0
26  self.text = 0
27  self.label = ""
28  self.objid = 0
29  # switch mode for position, rotation, distortion
30  if (mode == "xyz"):
31  self.xyz = {0: "X", 1: "Y", 2: "Z"}
32  self.data = [0, 1, 2]
33  self.unit = "#mum"
34  if (mode == "rot"):
35  self.xyz = {0: "#alpha", 1: "#beta", 2: "#gamma"}
36  self.data = [3, 4, 5]
37  self.unit = "mrad"
38  if (mode == "dist"):
39  self.xyz = {0: "A", 1: "B", 2: "C"}
40  self.data = [6, 7, 8]
41  self.unit = ""
42 
43 
45  """ information out of the pede.dump.gz file
46  """
47 
48  def __init__(self):
49  self.sumValue = 0
50  self.sumWValue = 0
51  self.sumSteps = ""
52  self.correction = 0
53  self.memory = 0
54  self.time = []
55  self.warning = []
56  # number of records
57  self.nrec = 0
58  # total numer of parameters
59  self.ntgb = 0
60  # number of variable parameters
61  self.nvgb = 0
62 
63  def printLog(self):
64  if (self.sumValue != 0):
65  print "Sum(Chi^2)/Sum(Ndf) = {0} = {1}".format(self.sumSteps, self.sumValue)
66  else:
67  print "Sum(W*Chi^2)/Sum(Ndf)/<W> = {0} = {1}".format(self.sumSteps, self.sumWValue)
68  print "with correction for down-weighting: {0}".format(self.correction)
69  print "Peak dynamic memory allocation: {0} GB".format(self.memory)
70  print "Total time: {0} h {1} m {2} s".format(self.time[0], self.time[1], self.time[2])
71  print "Number of records: {0}".format(self.nrec)
72  print "Total number of parameters: {0}".format(self.ntgb)
73  print "Number of variable parameters: {0}".format(self.nvgb)
74  print "Warning:"
75  for line in self.warning:
76  print line
77 
78 
80  """ information out of the monitor root files
81  """
82  monitors = []
83 
84  def __init__(self, name, ntracks):
85  self.name = name
86  self.ntracks = ntracks
87  self.monitors.append(self)
88 
89 
90 class OutputData:
91  """ stores the information about the data which should be part of the Output
92  """
93 
94  def __init__(self, plottype="", name="", number="", parameter="", filename=""):
95  self.plottype = plottype
96  self.name = name
97  self.number = number
98  self.parameter = parameter
99  self.filename = filename
def __init__(self, mode)
Definition: classes.py:12
def __init__(self)
Definition: classes.py:48
Classes which are needed by the mps_validate.py file.
Definition: classes.py:8
def __init__(self, name, ntracks)
Definition: classes.py:84
def __init__(self, plottype="", name="", number="", parameter="", filename="")
Definition: classes.py:94
def printLog(self)
Definition: classes.py:63