test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Alignment
MillePedeAlignmentAlgorithm
python
mpsvalidate
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
44
class
PedeDumpData
:
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
79
class
MonitorData
:
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
classes.PedeDumpData.ntgb
ntgb
Definition:
classes.py:59
classes.PedeDumpData.printLog
def printLog
Definition:
classes.py:63
classes.OutputData.__init__
def __init__
Definition:
classes.py:94
classes.PedeDumpData.__init__
def __init__
Definition:
classes.py:48
classes.MonitorData.ntracks
ntracks
Definition:
classes.py:86
classes.OutputData
Definition:
classes.py:90
classes.OutputData.plottype
plottype
Definition:
classes.py:95
classes.PlotData.numberOfBins
numberOfBins
Definition:
classes.py:13
classes.PedeDumpData.warning
warning
Definition:
classes.py:55
classes.PlotData.minShift
minShift
Definition:
classes.py:15
classes.PlotData.objid
objid
Definition:
classes.py:28
classes.PlotData.hiddenEntries
hiddenEntries
Definition:
classes.py:19
classes.MonitorData.name
name
Definition:
classes.py:85
classes.PedeDumpData.memory
memory
Definition:
classes.py:53
classes.PlotData.binShift
binShift
Definition:
classes.py:18
classes.PedeDumpData.correction
correction
Definition:
classes.py:52
classes.PedeDumpData.nvgb
nvgb
Definition:
classes.py:61
classes.PlotData.data
data
Definition:
classes.py:32
classes.PlotData.binPosition
binPosition
Definition:
classes.py:20
classes.PlotData.text
text
Definition:
classes.py:26
classes.MonitorData
Definition:
classes.py:79
classes.PlotData.label
label
Definition:
classes.py:27
classes.PedeDumpData.nrec
nrec
Definition:
classes.py:57
classes.PlotData.__init__
def __init__
Definition:
classes.py:12
classes.PlotData.unit
unit
Definition:
classes.py:33
classes.OutputData.filename
filename
Definition:
classes.py:99
classes.OutputData.name
name
Definition:
classes.py:96
classes.PedeDumpData
Definition:
classes.py:44
classes.MonitorData.__init__
def __init__
Definition:
classes.py:84
classes.PedeDumpData.time
time
Definition:
classes.py:54
classes.PlotData
Classes which are needed by the mps_validate.py file.
Definition:
classes.py:8
classes.PlotData.histoAxis
histoAxis
Definition:
classes.py:23
classes.PlotData.usedRange
usedRange
Definition:
classes.py:21
classes.PlotData.maxBinShift
maxBinShift
Definition:
classes.py:16
classes.PlotData.maxShift
maxShift
Definition:
classes.py:14
classes.OutputData.parameter
parameter
Definition:
classes.py:98
format
classes.PedeDumpData.sumSteps
sumSteps
Definition:
classes.py:51
classes.PlotData.xyz
xyz
Definition:
classes.py:31
classes.PlotData.title
title
Definition:
classes.py:25
classes.PedeDumpData.sumValue
sumValue
Definition:
classes.py:49
classes.PedeDumpData.sumWValue
sumWValue
Definition:
classes.py:50
classes.PlotData.histo
histo
Definition:
classes.py:22
classes.OutputData.number
number
Definition:
classes.py:97
Generated for CMSSW Reference Manual by
1.8.5