Fix how nevents is extracted for MG jO
Description of bug
From @ewelina
File "scripts/logParser.py", line 488, in main
madgraphChecks(opts.INPUT_FILE)
File "scripts/logParser.py", line 271, in madgraphChecks
neventsMG=int(generatorDict['nevents'][0])
ValueError: invalid literal for int() with base 10: '11000.'
This is because log.generate
contains the following printouts
22:32:58 Py:MadGraphUtils INFO Setting nevents = 11000.
22:33:05 Py:MadGraphUtils INFO "nevents" = 11000
and logParser takes the first instead of the second.
Changes introduced
- Take
nevents
from line containingINFO "nevents"
(with quotes) - The first occurrence of this line is used so if a file contains
22:33:05 Py:MadGraphUtils INFO "nevents" = 5000
22:33:05 Py:MadGraphUtils INFO "nevents" = 9000
the code would use 5000. It is not clear whether this would ever happen and what we would want to do in this case; @zmarshal @mcfayden can comment
Tests
Test on the problematic case reported by Ewelina
!372 (merged)
Test on the case reported inNote that log.generate
there contained the following line:
05:18:48 Py:MadGraphUtils INFO "nevents" = 10000
and the jO is not setting nevents
. I am not sure how MG knows to set nevents to 10000 (probably through NEventsPerJob
?) but since MG was indeed generating 10k events I think the behaviour of logParser is correct in this case.
nevents
Multiple occurrences of If I hack the log.generate
file to contain:
22:33:05 Py:MadGraphUtils INFO "nevents" = 5000
22:33:05 Py:MadGraphUtils INFO "nevents" = 11000
Issues resolved
Closes #107 (closed)