55 |
|
self.cfg.maxEvents.setMaxEventsInput(maxEv) |
56 |
|
return |
57 |
|
|
58 |
+ |
def skipEvent(self, skipEv): |
59 |
+ |
""" |
60 |
+ |
Set max event in the standalone untracked module |
61 |
+ |
""" |
62 |
+ |
self.cfg.inputSource.setSkipEvents(skipEv) |
63 |
+ |
return |
64 |
+ |
|
65 |
|
def psetWriter(self, name): |
66 |
|
""" |
67 |
|
Write out modified CMSSW.cfg |
71 |
|
outFile = open(common.work_space.jobDir()+name,"w") |
72 |
|
if name.endswith('py'): |
73 |
|
outFile.write("import FWCore.ParameterSet.Config as cms\n") |
74 |
< |
outFile.write(self.cmsProcess.dumpPython()) |
74 |
> |
try: |
75 |
> |
outFile.write(self.cmsProcess.dumpPython()) |
76 |
> |
except Exception, ex: |
77 |
> |
msg = "Your cfg file is not valid, %s\n" % str(ex) |
78 |
> |
msg += " https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#Problem_with_ParameterSet_parsin\n" |
79 |
> |
msg += " may help you understand the problem." |
80 |
> |
raise CrabException(msg) |
81 |
> |
|
82 |
|
else: |
83 |
|
outFile.write(self.cfg.data.dumpConfig()) |
84 |
|
outFile.close() |