CMS 3D CMS Logo

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