MadSpin: ValueError : invalid literal for int() with base 10

Asked by Benedikt Maier

Dear MadSpin experts,

I am getting the following error when decaying an LHE event file (process p p > t b~ j [QCD]) with MadSpin:

...
INFO: Event nb 50000 4m 14s
INFO: Event nb 60000 5m 10s
INFO: Event nb 70000 5m 53s
INFO: Event nb 80000 6m 34s
INFO: Event nb 90000 7m 17s
INFO: Event nb 100000 8m 9s
Command "decay_events run_04" interrupted with error:
ValueError : invalid literal for int() with base 10: 'Unable'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/run_04_tag_2_debug.log'.
Please attach this file to your report.
fiducial>exit

____________________________________________

The logfile says the following:

decay_events run_04
Traceback (most recent call last):
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 879, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/common_run_interface.py", line 1554, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 1035, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 919, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/interface_madspin.py", line 461, in do_launch
    generate_all.run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2040, in run
    self.ending_run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2046, in ending_run
    efficiency = self.decaying_events(self.inverted_decay_mapping)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2158, in decaying_events
    trial_nb, BWvalue, weight, momenta, failed, use_mc_masses, helicities = self.loadfortran( 'unweighting', decay_me['path'], stdin_text)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 3127, in loadfortran
    nexternal=int(firstline[0])
ValueError: invalid literal for int() with base 10: 'Unable'

__________________________________

Did you ever encounter something similar?
It's just with this one LHE file. Previous runs went fine!

__________________________________
Here is the madspin_card.dat:

#Some options (uncomment to apply)
#
# set seed 1

 set max_weight_ps_point 400 # number of PS to estimate the maximum for each event

#
# specify the decay for the final state particles
define l+ = e+ mu+ ta+
define l- = e- mu- ta-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
decay t > w+ b, w+ > l+ vl
decay t~ > w- b~, w- > l- vl~
decay w+ > l+ vl
decay w- > l- vl~
decay z > all all
# running the actual code
launch

Thanks in advance,
Benedikt

Question information

Language:
English Edit question
Status:
Open
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Pierre Artoisenet Edit question
Last query:
Last reply:
Revision history for this message
Pierre Artoisenet (partois) said :
#1

Hi Benedikt,

Many Thanks for this bug report.
I could not reproduce it, probably because a different seed was used on my side.
Nevertheless I tried to fix the problem based on your bug report.
I pushed the corrected branch to

https://code.launchpad.net/~maddevelopers/mg5amcnlo/MadSpin_fix_bug_iconfig

Could you try to

1) import the file MadSpin_fix_bug_iconfig/MadSpin/src/driver.f

    into your directory

   MG5_aMC_v2_1_2/MadSpin/scr/.

2) decay the same production event file (with exactly the same card as before)

and tell me if the problem persists ?

Cheers and thanks again,

Pierre

Revision history for this message
Benedikt Maier (bmaier) said :
#2

Hi Pierre,

thanks for the help!

I put the new driver.f in my MadSpin/src directory and did the same command as before (decay_events run_04). However, it still fails with the same error:

decay_events run_04
Traceback (most recent call last):
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 879, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/common_run_interface.py", line 1554, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 1035, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 919, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/interface_madspin.py", line 461, in do_launch
    generate_all.run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2040, in run
    self.ending_run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2046, in ending_run
    efficiency = self.decaying_events(self.inverted_decay_mapping)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2158, in decaying_events
    trial_nb, BWvalue, weight, momenta, failed, use_mc_masses, helicities = self.loadfortran( 'unweighting', decay_me['path'], stdin_text)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 3127, in loadfortran
    nexternal=int(firstline[0])
ValueError: invalid literal for int() with base 10: 'Unable'

I copied the LHE file and the madspin card to my dropbox.
Here is the link to both:

https://www.dropbox.com/sh/2fzu0d45wajal0e/AABbwnRTZ9tjKyPihGgzbu9Za

Maybe you are then able to reproduce the problem with them?

Thanks a lot,

Benedikt

Revision history for this message
Pierre Artoisenet (partois) said :
#3

Thanks for the files,

that will be indeed useful

I will let you know when the problem is fixed
Pierre

Revision history for this message
Pierre Artoisenet (partois) said :
#4

Hi Benedikt,

I reproduced the problem and I implemented the fix in the branch

lp:~maddevelopers/mg5amcnlo/MadSpin_fix_bug_iconfig

Two files have been modified:

MadSpin/src/driver.f
MadSpin/decay.py

Could you try again with these two files ?

Thanks a lot for your help,

Pierre

Revision history for this message
Benedikt Maier (bmaier) said :
#5

Hi Pierre,

thank YOU for the help.

after updating the two files, the decay of all 250000 events worked, so the problem seems to be fixed - thanks!

I guess the following two error messages are ~of not so high importance? (I encoutered the first error about the larger weight many times before, also in other process generations etc ... looking at the distributions afterwards, I did not see really strange features. The second error message is new to me, however).

INFO: Event nb 90000 3m 35s
INFO: Event nb 100000 3m 59s
INFO: Event nb 200000 8m 26s
ERROR: Found a weight MUCH larger than the computed max_weight (ratio: 11.6222311336).
    This usually means that the Narrow width approximation reaches it's limit on part of the Phase-Space.
    Do not trust too much the tale of the distribution and/or relaunch the code with smaller BW_cut.
    This is for channel ('tx_bxwm_wm_mumvmx',) with current BW_value at : 9.44766'
INFO: Total number of events written: 250000/250000
INFO: Average number of trial points per production event: 7.68358
INFO: Branching ratio to allowed decays: 0.332358
INFO: Number of events with weights larger than max_weight: 3
INFO: Number of subprocesses 79
INFO: Number of failures when restoring the Monte Carlo masses: 5
INFO: Decayed events have been written in /afs/cern.ch/work/b/bmaier/public/Requests/fiducial/Events/run_04/events_decayed.lhe.gz
INFO: The decayed event file has been moved to the following location:
INFO: /afs/cern.ch/work/b/bmaier/public/Requests/fiducial/Events/run_04_decayed_1/events.lhe.gz
Command "decay_events run_04 " interrupted with error:
KeyError : 'mgruncard'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/run_04_decayed_1_tag_2_debug.log'.
Please attach this file to your report.
fiducial>exit

#####################

The debuglog says:

decay_events run_04
Traceback (most recent call last):
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 879, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/common_run_interface.py", line 1596, in do_decay_events
    (self.run_name, self.run_tag)))
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/banner.py", line 234, in write
    self.lhe_version = self.get('run_card', 'lhe_version', default=1.0)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/banner.py", line 390, in get_detail
    self.charge_card(attr_tag)
  File "/afs/cern.ch/work/b/bmaier/public/Requests/fiducial/bin/internal/banner.py", line 330, in charge_card
    run_card = self[tag].split('\n')
KeyError: 'mgruncard'

#################

Thanks again!
Benedikt

Revision history for this message
Benedikt Maier (bmaier) said :
#6

Dear Pierre,

I'm sorry to bother you again, but over night, I had another event generation running, this time not the single top process, but the single top + Higgs, i.e.

generate p p > b t~ h j $$ w+ w- [QCD]
add process p p > t b~ h j $$ w+ w- [QCD]

Now I wanted to check whether the generation went smoothly, but I get the very same error like at the beginning:

##############################

launch auto
Traceback (most recent call last):
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 879, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/amcatnlo_run_interface.py", line 1194, in do_launch
    self.exec_cmd('decay_events -from_cards', postcmd=False)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 919, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/common_run_interface.py", line 1554, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 1035, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 919, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/madgraph/interface/extended_cmd.py", line 872, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/interface_madspin.py", line 461, in do_launch
    generate_all.run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2040, in run
    self.ending_run()
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2046, in ending_run
    efficiency = self.decaying_events(self.inverted_decay_mapping)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 2158, in decaying_events
    trial_nb, BWvalue, weight, momenta, failed, use_mc_masses, helicities = self.loadfortran( 'unweighting', decay_me['path'], stdin_text)
  File "/afs/cern.ch/work/b/bmaier/private/MADGRAPH/MG5_aMC_v2_1_2/MadSpin/decay.py", line 3131, in loadfortran
    nexternal=int(firstline[0])
ValueError: invalid literal for int() with base 10: 'Warning:'

###################################

Again, I put the madspin_card.dat and the event.lhe to my dropbox:

https://www.dropbox.com/sh/09qlgppzs0b4blq/AACWJTg3pEo9mEBcbAQfRHVva

The fix of the decay.py and the driver.f seems to have worked well for the single top process, but maybe now the presence of the Higgs requires some further treatment?

It would be great if you could have a look :)
I get the error somewhere between the 200 000th and 300 000th event.

Thanks a lot in advance,

Benedikt

Can you help with this problem?

Provide an answer of your own, or ask Benedikt Maier for more information if necessary.

To post a message you must log in.