Error when running madspin (KeyError: -11)

Asked by Sihyun Jeon on 2018-10-27

Hi Olivier,

I have been getting trouble with madspin using mg2.6.3.2.

command line after ./bin/mg5 is like below (EffLRSM_NLO is in http://feynrules.irmp.ucl.ac.be/wiki/EffLRSM)

import model EffLRSM_NLO
define e = e+ e-
define j = u d c s b t u~ d~ c~ s~ b~ t~
generate p p > n1 e [QCD]

and in the madspin

set spinmode none # Use one of the madspin special mode
decay n1 > e+ j j
decay n1 > e- j j

but it seems it's not running.

Command "launch auto " interrupted with error:
KeyError : -11
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/TEST/run_01_tag_1_debug.log'.
Please attach this file to your report.

Traceback (most recent call last):
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/amcatnlo_run_interface.py", line 1678, in do_launch
    self.exec_cmd('decay_events -from_cards', postcmd=False)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/common_run_interface.py", line 3653, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1643, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/MadSpin/interface_madspin.py", line 573, in do_launch
    return self.run_bridge(line)
  File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/MadSpin/interface_madspin.py", line 990, in run_bridge
    nb_decay = len(evt_decayfile[particle.pdg])
KeyError: -11

Can you help me with this?

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2018-11-09
Last query:
2018-11-09
Last reply:
2018-10-31

Hi,

Thanks for the report. Here is the patch to make it work:

=== modified file 'MadSpin/interface_madspin.py'
--- MadSpin/interface_madspin.py 2018-10-26 13:32:23 +0000
+++ MadSpin/interface_madspin.py 2018-10-31 10:06:36 +0000
@@ -1008,11 +1008,18 @@
                     cumul = 0
                     for j,events in evt_decayfile[particle.pdg].items():
                         cumul += events.cross
- if r < cumul:
+ if r <= cumul:
                             decay_file = events
                             decay_file_nb = j
- else:
                             break
+ else:
+ # security for numerical accuracy issue... (unlikely but better safe)
+ if (cumul-tot)/tot < 1e-5:
+ decay_file = events
+ decay_file_nb = j
+ else:
+ misc.sprint(j,cumul, events.cross, tot, (tot-cumul)/tot)
+ raise Exception

                 if self.options['new_wgt'] == 'BR':
                     tot_width = float(self.banner.get('param', 'decay', abs(pdg)).value)

> command line after ./bin/mg5 is like below (EffLRSM_NLO is in http://feynrules.irmp.ucl.ac.be/wiki/EffLRSM)

Just for information, that this model is in your database, so if you give that command:
> import model EffLRSM_NLO
and that such model is not installed on your machine, it will automatically download it from the above link.

Cheers and thanks,

Olivier

PS: this will be release in 2.6.4

> On 27 Oct 2018, at 15:37, Sihyun Jeon <email address hidden> wrote:
>
> New question #675661 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/675661
>
> Hi Olivier,
>
> I have been getting trouble with madspin using mg2.6.3.2.
>
> command line after ./bin/mg5 is like below (EffLRSM_NLO is in http://feynrules.irmp.ucl.ac.be/wiki/EffLRSM)
>
> import model EffLRSM_NLO
> define e = e+ e-
> define j = u d c s b t u~ d~ c~ s~ b~ t~
> generate p p > n1 e [QCD]
>
> and in the madspin
>
> set spinmode none # Use one of the madspin special mode
> decay n1 > e+ j j
> decay n1 > e- j j
>
> but it seems it's not running.
>
> Command "launch auto " interrupted with error:
> KeyError : -11
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in '/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/TEST/run_01_tag_1_debug.log'.
> Please attach this file to your report.
>
> Traceback (most recent call last):
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/amcatnlo_run_interface.py", line 1678, in do_launch
> self.exec_cmd('decay_events -from_cards', postcmd=False)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/common_run_interface.py", line 3653, in do_decay_events
> madspin_cmd.import_command_file(path)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1643, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/madgraph/various/misc.py", line 100, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/MadSpin/interface_madspin.py", line 573, in do_launch
> return self.run_bridge(line)
> File "/home/shjeon/Desktop/Physics/MadGraph/MG5_aMC_v2_6_3_2/MadSpin/interface_madspin.py", line 990, in run_bridge
> nb_decay = len(evt_decayfile[particle.pdg])
> KeyError: -11
>
>
> Can you help me with this?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Sihyun Jeon (shjeon) said : #2

Thanks Olivier Mattelaer, that solved my question.