Skip to content

Fix how nevents is extracted for MG jO

Spyros Argyropoulos requested to merge fixlp into master

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 containing INFO "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

Screenshot_2020-05-03_at_13.40.29
Works ok

Test on the case reported in !372 (merged)

Screenshot_2020-05-03_at_13.41.17

Note 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.

Multiple occurrences of nevents

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

logParser gives:
Screenshot_2020-05-03_at_13.46.42

Issues resolved

Closes #107 (closed)

Merge request reports