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 |
|
|
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 |
|
|
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) |