Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:35

0001 from __future__ import print_function
0002 ##########################################################################
0003 # Classes which are needed by the mps_validate.py file.
0004 ##
0005 
0006 
0007 class PlotData:
0008     """ Hold information about XYZ
0009     """
0010 
0011     def __init__(self, mode):
0012         self.numberOfBins = [0, 0, 0]
0013         self.maxShift = [0, 0, 0]
0014         self.minShift = [0, 0, 0]
0015         self.maxBinShift = [0, 0, 0]
0016         # used binShift
0017         self.binShift = [0, 0, 0]
0018         self.hiddenEntries = [0, 0, 0]
0019         self.binPosition = [1, 1, 1]
0020         self.usedRange = [0, 0, 0]
0021         self.histo = []
0022         self.histoAxis = []
0023         # plot title and text
0024         self.title = 0
0025         self.text = 0
0026         self.label = ""
0027         self.objid = 0
0028         # switch mode for position, rotation, distortion
0029         if (mode == "xyz"):
0030             self.xyz = {0: "X", 1: "Y", 2: "Z"}
0031             self.data = [0, 1, 2]
0032             self.unit = "#mum"
0033         if (mode == "rot"):
0034             self.xyz = {0: "#alpha", 1: "#beta", 2: "#gamma"}
0035             self.data = [3, 4, 5]
0036             self.unit = "mrad"
0037         if (mode == "dist"):
0038             self.xyz = {0: "A", 1: "B", 2: "C"}
0039             self.data = [6, 7, 8]
0040             self.unit = ""
0041 
0042 
0043 class PedeDumpData:
0044     """ information out of the pede.dump.gz file
0045     """
0046 
0047     def __init__(self):
0048         self.sumValue = 0
0049         self.sumWValue = 0
0050         self.sumSteps = ""
0051         self.correction = 0
0052         self.memory = 0
0053         self.time = []
0054         self.warning = []
0055         # number of records
0056         self.nrec = 0
0057         # total numer of parameters
0058         self.ntgb = 0
0059         # number of variable parameters
0060         self.nvgb = 0
0061 
0062     def printLog(self):
0063         if (self.sumValue != 0):
0064             print("Sum(Chi^2)/Sum(Ndf) = {0} = {1}".format(self.sumSteps, self.sumValue))
0065         else:
0066             print("Sum(W*Chi^2)/Sum(Ndf)/<W> = {0} = {1}".format(self.sumSteps, self.sumWValue))
0067         print("with correction for down-weighting: {0}".format(self.correction))
0068         print("Peak dynamic memory allocation: {0} GB".format(self.memory))
0069         print("Total time: {0} h {1} m {2} s".format(self.time[0], self.time[1], self.time[2]))
0070         print("Number of records: {0}".format(self.nrec))
0071         print("Total number of parameters: {0}".format(self.ntgb))
0072         print("Number of variable parameters: {0}".format(self.nvgb))
0073         print("Warning:")
0074         for line in self.warning:
0075             print(line)
0076 
0077 
0078 class MonitorData:
0079     """ information out of the monitor root files
0080     """
0081     monitors = []
0082 
0083     def __init__(self, name, ntracks, weight = None):
0084         self.name = name
0085         self.ntracks = ntracks
0086         self.weight = weight
0087         self.monitors.append(self)
0088 
0089 
0090 class OutputData:
0091     """ stores the information about the data which should be part of the Output
0092     """
0093 
0094     def __init__(self, plottype="", name="", number="", parameter="", filename=""):
0095         self.plottype = plottype
0096         self.name = name
0097         self.number = number
0098         self.parameter = parameter
0099         self.filename = filename