CMS 3D CMS Logo

classes.py
Go to the documentation of this file.
1 from __future__ import print_function
2 
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
classes.PlotData.data
data
Definition: classes.py:31
classes.PlotData.maxBinShift
maxBinShift
Definition: classes.py:15
classes.PlotData.histo
histo
Definition: classes.py:21
classes.PlotData.binPosition
binPosition
Definition: classes.py:19
classes.PlotData.text
text
Definition: classes.py:25
classes.PlotData.title
title
Definition: classes.py:24
classes.PedeDumpData.warning
warning
Definition: classes.py:54
classes.PedeDumpData.ntgb
ntgb
Definition: classes.py:58
classes.MonitorData.monitors
list monitors
Definition: classes.py:81
classes.PlotData.maxShift
maxShift
Definition: classes.py:13
classes.PlotData.objid
objid
Definition: classes.py:27
classes.PlotData.unit
unit
Definition: classes.py:32
classes.MonitorData.weight
weight
Definition: classes.py:86
classes.PlotData.xyz
xyz
Definition: classes.py:30
classes.PedeDumpData.correction
correction
Definition: classes.py:51
classes.PlotData.usedRange
usedRange
Definition: classes.py:20
classes.PedeDumpData.__init__
def __init__(self)
Definition: classes.py:47
classes.OutputData
Definition: classes.py:90
classes.OutputData.__init__
def __init__(self, plottype="", name="", number="", parameter="", filename="")
Definition: classes.py:94
classes.PlotData.__init__
def __init__(self, mode)
Definition: classes.py:11
classes.PedeDumpData.nvgb
nvgb
Definition: classes.py:60
classes.OutputData.plottype
plottype
Definition: classes.py:95
classes.PedeDumpData.memory
memory
Definition: classes.py:52
classes.PlotData.hiddenEntries
hiddenEntries
Definition: classes.py:18
classes.OutputData.filename
filename
Definition: classes.py:99
classes.PlotData.minShift
minShift
Definition: classes.py:14
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
mps_setup.append
append
Definition: mps_setup.py:85
classes.OutputData.number
number
Definition: classes.py:97
classes.MonitorData.__init__
def __init__(self, name, ntracks, weight=None)
Definition: classes.py:83
classes.PlotData
Classes which are needed by the mps_validate.py file.
Definition: classes.py:7
classes.PedeDumpData.nrec
nrec
Definition: classes.py:56
classes.PlotData.label
label
Definition: classes.py:26
classes.MonitorData
Definition: classes.py:78
classes.PlotData.binShift
binShift
Definition: classes.py:17
classes.MonitorData.ntracks
ntracks
Definition: classes.py:85
classes.OutputData.name
name
Definition: classes.py:96
classes.PedeDumpData.sumSteps
sumSteps
Definition: classes.py:50
classes.MonitorData.name
name
Definition: classes.py:84
format
classes.PlotData.numberOfBins
numberOfBins
Definition: classes.py:12
classes.PedeDumpData.time
time
Definition: classes.py:53
classes.PedeDumpData.printLog
def printLog(self)
Definition: classes.py:62
classes.PedeDumpData.sumValue
sumValue
Definition: classes.py:48
classes.PedeDumpData.sumWValue
sumWValue
Definition: classes.py:49
classes.OutputData.parameter
parameter
Definition: classes.py:98
classes.PedeDumpData
Definition: classes.py:43
classes.PlotData.histoAxis
histoAxis
Definition: classes.py:22