ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/writeCfg.py
(Generate patch)

Comparing COMP/CRAB/python/writeCfg.py (file contents):
Revision 1.19 by ewv, Tue May 5 15:29:38 2009 UTC vs.
Revision 1.20 by ewv, Wed Jun 17 20:58:08 2009 UTC

# Line 39 | Line 39 | def main(argv) :
39      """
40      writeCfg
41  
42 <    - Read in existing, user supplied cfg or pycfg file
43 <    - Modify job specific parameters based on environment variables
44 <    - Write out modified cfg or pycfg file
42 >    - Read in existing, user supplied cfg or pickled pycfg file
43 >    - Modify job specific parameters based on environment variables and arguments.xml
44 >    - Write out modified cfg or pickled pycfg file
45  
46      required parameters: none
47  
# Line 113 | Line 113 | def main(argv) :
113                  skipEvents = int(elem.getAttribute("SkipEvents"))
114              if elem.getAttribute("FirstEvent"):
115                  firstEvent = int(elem.getAttribute("FirstEvent"))
116            if elem.getAttribute("CompHEPFirstEvent"):
117                compHEPFirstEvent = int(elem.getAttribute("CompHEPFirstEvent"))
116              if elem.getAttribute("FirstRun"):
117                  firstRun = int(elem.getAttribute("FirstRun"))
118  
119 +            generator      = str(elem.getAttribute('Generator'))
120              inputFiles     = str(elem.getAttribute('InputFiles'))
121              parentFiles    = str(elem.getAttribute('ParentFiles'))
122  
# Line 154 | Line 153 | def main(argv) :
153  
154      if skipEvents:
155          inModule.setSkipEvents(skipEvents)
156 <    if firstEvent != -1:
156 >
157 >    # Set "skip events" for various generators
158 >    if generator == 'comphep':
159 >        cmsProcess.source.CompHEPFirstEvent = CfgTypes.int32(firstEvent)
160 >    elif generator == 'lhe':
161 >        cmsProcess.LHESource.skipEvents = CfgTypes.untracked(CfgTypes.uint32(firstEvent))
162 >    elif firstEvent != -1: # (Old? Madgraph)
163          cmsProcess.source.firstEvent = CfgTypes.untracked(CfgTypes.uint32(firstEvent))
164 <    if compHEPFirstEvent:
160 <        cmsProcess.source.CompHEPFirstEvent = CfgTypes.int32(compHEPFirstEvent)
164 >
165      if inputFiles:
166          inputFileNames = inputFiles.split(',')
167          inModule.setFileNames(*inputFileNames)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines