Main Page
Namespaces
Classes
Package Documentation
DQM
Integration
python
config
dqmPythonTypes.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
from
FWCore.ParameterSet.Types
import
PSet
3
import
FWCore.ParameterSet.Config
as
cms
4
class
RunType
(PSet):
5
def
__init__
(self,types=['pp_run','pp_run_stage1','cosmic_run','cosmic_run_stage1','hi_run','hpu_run']):
6
PSet.__init__(self)
7
self.
__runTypesDict
= {}
8
t=[(x,types.index(x))
for
x
in
types ]
9
for
k,v
in
t:
10
self.
__runTypesDict
[k] = v
11
self.__dict__[k] = v
12
13
self.
__runType
= self.
__runTypesDict
[types[0]]
14
self.
__runTypeName
= types[0]
15
16
def
getRunType
(self):
17
return
self.
__runType
18
19
def
getRunTypeName
(self):
20
return
self.
__runTypeName
21
22
def
setRunType
(self,rt):
23
if
isinstance(rt,int):
24
if
rt
not
in
self.__runTypesDict.values():
25
raise
TypeError(
"%d not a valid Run Type"
% rt)
26
27
self.
__runType
= rt
28
self.
__runTypeName
= [k
for
k, v
in
self.__runTypesDict.items()
if
v == rt][0]
29
return
30
31
if
isinstance(rt,str):
32
if
rt
not
in
self.__runTypesDict.keys():
33
raise
TypeError(
"%s not a valid Run Type"
% rt)
34
35
self.
__runTypeName
= rt
36
self.
__runType
= self.
__runTypesDict
[rt]
37
38
def
__str__
(self):
39
return
"RunType='%s':%d of %s"
% (self.
__runTypeName
,
40
self.
__runType
,
41
self.
__runTypesDict
)
42
43
def
__repr__
(self):
44
return
"RunType='%s':%d of %s"
% (self.
__runTypeName
,
45
self.
__runType
,
46
self.
__runTypesDict
)
47
dqmPythonTypes.RunType.__init__
def __init__(self, types=['pp_run', pp_run_stage1, cosmic_run, cosmic_run_stage1, hi_run, hpu_run)
Definition:
dqmPythonTypes.py:5
dqmPythonTypes.RunType.__repr__
def __repr__(self)
Definition:
dqmPythonTypes.py:43
dqmPythonTypes.RunType.getRunTypeName
def getRunTypeName(self)
Definition:
dqmPythonTypes.py:19
dqmPythonTypes.RunType.setRunType
def setRunType(self, rt)
Definition:
dqmPythonTypes.py:22
dqmPythonTypes.RunType.__runTypesDict
__runTypesDict
Definition:
dqmPythonTypes.py:7
dqmPythonTypes.RunType.__runType
__runType
Definition:
dqmPythonTypes.py:13
dqmPythonTypes.RunType.getRunType
def getRunType(self)
Definition:
dqmPythonTypes.py:16
dqmPythonTypes.RunType.__runTypeName
__runTypeName
Definition:
dqmPythonTypes.py:14
dqmPythonTypes.RunType
Definition:
dqmPythonTypes.py:4
dqmPythonTypes.RunType.__str__
def __str__(self)
Definition:
dqmPythonTypes.py:38
Generated for CMSSW Reference Manual by
1.8.11