CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
classes.py
Go to the documentation of this file.
1 from __future__ import print_function
2 ##########################################################################
3 # Classes which are needed by the mps_validate.py file.
4 ##
5 
6 
7 class PlotData:
8  """ Hold information about XYZ
9  """
10 
11  def __init__(self, mode):
12  self.numberOfBins = [0, 0, 0]
13  self.maxShift = [0, 0, 0]
14  self.minShift = [0, 0, 0]
15  self.maxBinShift = [0, 0, 0]
16  # used binShift
17  self.binShift = [0, 0, 0]
18  self.hiddenEntries = [0, 0, 0]
19  self.binPosition = [1, 1, 1]
20  self.usedRange = [0, 0, 0]
21  self.histo = []
22  self.histoAxis = []
23  # plot title and text
24  self.title = 0
25  self.text = 0
26  self.label = ""
27  self.objid = 0
28  # switch mode for position, rotation, distortion
29  if (mode == "xyz"):
30  self.xyz = {0: "X", 1: "Y", 2: "Z"}
31  self.data = [0, 1, 2]
32  self.unit = "#mum"
33  if (mode == "rot"):
34  self.xyz = {0: "#alpha", 1: "#beta", 2: "#gamma"}
35  self.data = [3, 4, 5]
36  self.unit = "mrad"
37  if (mode == "dist"):
38  self.xyz = {0: "A", 1: "B", 2: "C"}
39  self.data = [6, 7, 8]
40  self.unit = ""
41 
42 
44  """ information out of the pede.dump.gz file
45  """
46 
47  def __init__(self):
48  self.sumValue = 0
49  self.sumWValue = 0
50  self.sumSteps = ""
51  self.correction = 0
52  self.memory = 0
53  self.time = []
54  self.warning = []
55  # number of records
56  self.nrec = 0
57  # total numer of parameters
58  self.ntgb = 0
59  # number of variable parameters
60  self.nvgb = 0
61 
62  def printLog(self):
63  if (self.sumValue != 0):
64  print("Sum(Chi^2)/Sum(Ndf) = {0} = {1}".format(self.sumSteps, self.sumValue))
65  else:
66  print("Sum(W*Chi^2)/Sum(Ndf)/<W> = {0} = {1}".format(self.sumSteps, self.sumWValue))
67  print("with correction for down-weighting: {0}".format(self.correction))
68  print("Peak dynamic memory allocation: {0} GB".format(self.memory))
69  print("Total time: {0} h {1} m {2} s".format(self.time[0], self.time[1], self.time[2]))
70  print("Number of records: {0}".format(self.nrec))
71  print("Total number of parameters: {0}".format(self.ntgb))
72  print("Number of variable parameters: {0}".format(self.nvgb))
73  print("Warning:")
74  for line in self.warning:
75  print(line)
76 
77 
79  """ information out of the monitor root files
80  """
81  monitors = []
82 
83  def __init__(self, name, ntracks, weight = None):
84  self.name = name
85  self.ntracks = ntracks
86  self.weight = weight
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
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
Classes which are needed by the mps_validate.py file.
Definition: classes.py:7