26 |
|
#convert Pset |
27 |
|
from FWCore.ParameterSet.Config import include |
28 |
|
common.logger.debug(3,"PsetManipulator::__init__: PSet file = "+self.pset) |
29 |
+ |
# FUTURE: Can drop cfg mode for CMSSW < 2_1_x |
30 |
|
if self.pset.endswith('py'): |
31 |
|
handle = open(self.pset, 'r') |
32 |
|
try: # Nested form for Python < 2.5 |
56 |
|
self.cfg.maxEvents.setMaxEventsInput(maxEv) |
57 |
|
return |
58 |
|
|
59 |
+ |
def skipEvent(self, skipEv): |
60 |
+ |
""" |
61 |
+ |
Set max event in the standalone untracked module |
62 |
+ |
""" |
63 |
+ |
self.cfg.inputSource.setSkipEvents(skipEv) |
64 |
+ |
return |
65 |
+ |
|
66 |
|
def psetWriter(self, name): |
67 |
|
""" |
68 |
|
Write out modified CMSSW.cfg |
86 |
|
|
87 |
|
return |
88 |
|
|
81 |
– |
def addCrabFJR(self,name): |
82 |
– |
""" |
83 |
– |
_addCrabFJR_ |
84 |
– |
add CRAB specific FrameworkJobReport (FJR) |
85 |
– |
if a FJR already exists in input CMSSW parameter-set, add a second one. |
86 |
– |
This code is not needed for CMSSW >= 1.5.x and is non-functional in CMSSW >= 1.7.x. |
87 |
– |
It should be removed at some point in the future. |
88 |
– |
""" |
89 |
– |
|
90 |
– |
# Check if MessageLogger service already exists in configuration. If not, add it |
91 |
– |
svcs = self.cfg.data.services |
92 |
– |
if not svcs.has_key('MessageLogger'): |
93 |
– |
self.cfg.data.add_(CfgModules.Service("MessageLogger")) |
94 |
– |
|
95 |
– |
messageLogger = self.cfg.data.services['MessageLogger'] |
96 |
– |
|
97 |
– |
# Add fwkJobReports to Message logger if it doesn't exist |
98 |
– |
if "fwkJobReports" not in messageLogger.parameterNames_(): |
99 |
– |
messageLogger.fwkJobReports = CfgTypes.untracked(CfgTypes.vstring()) |
100 |
– |
|
101 |
– |
# should figure out how to remove "name" if it is there. |
102 |
– |
|
103 |
– |
if name not in messageLogger.fwkJobReports: |
104 |
– |
messageLogger.fwkJobReports.append(name) |
105 |
– |
|
106 |
– |
return |
107 |
– |
|
89 |
|
def getTFileService(self): |
90 |
|
""" Get Output filename from TFileService and return it. If not existing, return None """ |
91 |
|
if not self.cfg.data.services.has_key('TFileService'): |