test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CalibMuon
DTCalibration
python
Workflow
CmsswTask.py
Go to the documentation of this file.
1
import
os
2
3
class
CmsswTask
:
4
def
__init__
(self, dir, configs, psets=None):
5
self.
dir
= dir
6
self.
configs
= configs
7
self.
psets
= psets
8
self.
initTask
()
9
10
def
initTask
(self):
11
if
self.
psets
:
12
if
not
os.path.exists(self.
dir
): os.makedirs(self.
dir
)
13
for
pset_name
in
self.
configs
:
14
pset = self.
psets
[pset_name]
15
open(self.
dir
+
'/'
+ pset_name,
'w'
).
write
(pset)
16
17
def
run
(self):
18
if
not
os.path.exists(self.
dir
): os.makedirs(self.
dir
)
19
cwd = os.getcwd()
20
for
pset
in
self.
configs
:
21
os.chdir(self.
dir
)
22
if
not
os.path.exists(pset):
raise
RuntimeError(
'%s not found in dir %s'
% (pset,os.getcwd()))
23
24
cmd =
'cmsRun %s'
% pset
25
print
"Running"
, cmd,
"in dir"
, self.
dir
26
os.system(cmd)
27
os.chdir(cwd)
TablePrint.write
write
Definition:
TablePrint.py:3
CmsswTask.CmsswTask.run
def run
Definition:
CmsswTask.py:17
CmsswTask.CmsswTask.initTask
def initTask
Definition:
CmsswTask.py:10
CmsswTask.CmsswTask.dir
dir
Definition:
CmsswTask.py:5
CmsswTask.CmsswTask
Definition:
CmsswTask.py:3
CmsswTask.CmsswTask.configs
configs
Definition:
CmsswTask.py:6
CmsswTask.CmsswTask.psets
psets
Definition:
CmsswTask.py:7
CmsswTask.CmsswTask.__init__
def __init__
Definition:
CmsswTask.py:4
Generated for CMSSW Reference Manual by
1.8.5