Madspin error: KeyError : -4

Bug #1435527 reported by Sébastien Brochet
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Pierre Artoisenet

Bug Description

Dear experts,

I'm facing an issue while trying to run Madspin on a simple process. Basically, I'm trying to convert the Madgraph4 syntax:

pp>(s1>tt~)jj (s1 is a particle defined in a custom model, topBSM)

to Madgraph5. First, I came up with ' p p > s1 > t t~ j j ' but it does not do what I want, ie forcing the decay of s1 to t t~. Next, I tried ' p p > s1 j j, s1 > t t~ '. This time, it's seems to be ok, but I have an error when trying to run MadSpin.

I use the following MadSpin configuration:

decay s1 > t t~, (t > w+ b, w+ > all all), (t~ > w- b~, w- > all all)

MadSpin crash with the following error (debug log attached, run 03):

    INFO: detect independant decays
    Command "launch" interrupted with error:
    KeyError : -4

If I try with the default MadSpin configuration (top, W and Z decays), the error is different (log attached, run 04):

    INFO: generating the production square matrix element
    INFO: generate p p > s1 j j, s1 > t t~ --no_warning=duplicate;
    INFO: Done 8.089
    INFO: keeping dummy decay for passthrough mode
    INFO: generating the full square matrix element (with decay)
    INFO: generate p p > s1 j j, (t > b w+ , w+ > all all QCD=99), ( s1 > t t~, (t > b w+ , w+ > all all QCD=99)) --no_warning=duplicate;
    Command "launch" interrupted with error:
    KeyError : 6000047 (this is the PDG ID of s1)

I've also tried to generate only 'p p > s1 j j' in MadGraph, and using MadSpin for the decay, but it fails with the same error.

Am I doing something wrong or is this a bug in MadSpin?

I attached two LHE files:
unweighted_events_pp_s1.lhe.gz : process p p > s1 j j
unweighted_events_pp_s1_tt_s1_tt.lhe.gz : process p p > s1 j j, s1 > t t~

Thanks a lot!!

Revision history for this message
Sébastien Brochet (blinkseb) wrote :
Revision history for this message
Sébastien Brochet (blinkseb) wrote :

I forgot to add the UFO model in case you need it to launch MadSpin. You can find it here:
https://www.dropbox.com/s/b27wbftflih2flz/topBSM_UFO.zip?dl=!

Thanks!

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1435527] Madspin error: KeyError : -4

Hi,

The correct way to use MadSpin is to ask for
> p p > s1 j j
at the production level (i.e. generate p p > s1 j j)

and then ask the full decay in madspin
> decay s1 > t t~, (t > w+ b, w+ > all all), (t~ > w- b~, w- > all all)

in the madspin_card.dat

Cheers,

Olivier

On 24 Mar 2015, at 22:49, Sébastien Brochet <email address hidden> wrote:

> I forgot to add the UFO model in case you need it to launch MadSpin. You can find it here:
> https://www.dropbox.com/s/b27wbftflih2flz/topBSM_UFO.zip?dl=!
>
> Thanks!
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1435527
>
> Title:
> Madspin error: KeyError : -4
>
> Status in MadGraph5_aMC@NLO Generator:
> New
>
> Bug description:
> Dear experts,
>
> I'm facing an issue while trying to run Madspin on a simple process.
> Basically, I'm trying to convert the Madgraph4 syntax:
>
> pp>(s1>tt~)jj (s1 is a particle defined in a custom model, topBSM)
>
> to Madgraph5. First, I came up with ' p p > s1 > t t~ j j ' but it
> does not do what I want, ie forcing the decay of s1 to t t~. Next, I
> tried ' p p > s1 j j, s1 > t t~ '. This time, it's seems to be ok, but
> I have an error when trying to run MadSpin.
>
> I use the following MadSpin configuration:
>
> decay s1 > t t~, (t > w+ b, w+ > all all), (t~ > w- b~, w- > all all)
>
> MadSpin crash with the following error (debug log attached, run 03):
>
> INFO: detect independant decays
> Command "launch" interrupted with error:
> KeyError : -4
>
> If I try with the default MadSpin configuration (top, W and Z decays),
> the error is different (log attached, run 04):
>
> INFO: generating the production square matrix element
> INFO: generate p p > s1 j j, s1 > t t~ --no_warning=duplicate;
> INFO: Done 8.089
> INFO: keeping dummy decay for passthrough mode
> INFO: generating the full square matrix element (with decay)
> INFO: generate p p > s1 j j, (t > b w+ , w+ > all all QCD=99), ( s1 > t t~, (t > b w+ , w+ > all all QCD=99)) --no_warning=duplicate;
> Command "launch" interrupted with error:
> KeyError : 6000047 (this is the PDG ID of s1)
>
> I've also tried to generate only 'p p > s1 j j' in MadGraph, and using
> MadSpin for the decay, but it fails with the same error.
>
> Am I doing something wrong or is this a bug in MadSpin?
>
> I attached two LHE files:
> unweighted_events_pp_s1.lhe.gz : process p p > s1 j j
> unweighted_events_pp_s1_tt_s1_tt.lhe.gz : process p p > s1 j j, s1 > t t~
>
> Thanks a lot!!
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1435527/+subscriptions

Revision history for this message
Sébastien Brochet (blinkseb) wrote :
Download full text (5.1 KiB)

Hi Olivier,

Thanks for your answer. I already tried to do that, and it fails with
the exact same error (keyerror)

2015-03-24 15:45 GMT+01:00 Olivier Mattelaer <email address hidden>:
> Hi,
>
>
> The correct way to use MadSpin is to ask for
>> p p > s1 j j
> at the production level (i.e. generate p p > s1 j j)
>
> and then ask the full decay in madspin
>> decay s1 > t t~, (t > w+ b, w+ > all all), (t~ > w- b~, w- > all all)
>
> in the madspin_card.dat
>
> Cheers,
>
> Olivier
>
> On 24 Mar 2015, at 22:49, Sébastien Brochet <email address hidden>
> wrote:
>
>> I forgot to add the UFO model in case you need it to launch MadSpin. You can find it here:
>> https://www.dropbox.com/s/b27wbftflih2flz/topBSM_UFO.zip?dl=!
>>
>> Thanks!
>>
>> --
>> You received this bug notification because you are subscribed to
>> MadGraph5_aMC@NLO.
>> https://bugs.launchpad.net/bugs/1435527
>>
>> Title:
>> Madspin error: KeyError : -4
>>
>> Status in MadGraph5_aMC@NLO Generator:
>> New
>>
>> Bug description:
>> Dear experts,
>>
>> I'm facing an issue while trying to run Madspin on a simple process.
>> Basically, I'm trying to convert the Madgraph4 syntax:
>>
>> pp>(s1>tt~)jj (s1 is a particle defined in a custom model, topBSM)
>>
>> to Madgraph5. First, I came up with ' p p > s1 > t t~ j j ' but it
>> does not do what I want, ie forcing the decay of s1 to t t~. Next, I
>> tried ' p p > s1 j j, s1 > t t~ '. This time, it's seems to be ok, but
>> I have an error when trying to run MadSpin.
>>
>> I use the following MadSpin configuration:
>>
>> decay s1 > t t~, (t > w+ b, w+ > all all), (t~ > w- b~, w- > all all)
>>
>> MadSpin crash with the following error (debug log attached, run 03):
>>
>> INFO: detect independant decays
>> Command "launch" interrupted with error:
>> KeyError : -4
>>
>> If I try with the default MadSpin configuration (top, W and Z decays),
>> the error is different (log attached, run 04):
>>
>> INFO: generating the production square matrix element
>> INFO: generate p p > s1 j j, s1 > t t~ --no_warning=duplicate;
>> INFO: Done 8.089
>> INFO: keeping dummy decay for passthrough mode
>> INFO: generating the full square matrix element (with decay)
>> INFO: generate p p > s1 j j, (t > b w+ , w+ > all all QCD=99), ( s1 > t t~, (t > b w+ , w+ > all all QCD=99)) --no_warning=duplicate;
>> Command "launch" interrupted with error:
>> KeyError : 6000047 (this is the PDG ID of s1)
>>
>> I've also tried to generate only 'p p > s1 j j' in MadGraph, and using
>> MadSpin for the decay, but it fails with the same error.
>>
>> Am I doing something wrong or is this a bug in MadSpin?
>>
>> I attached two LHE files:
>> unweighted_events_pp_s1.lhe.gz : process p p > s1 j j
>> unweighted_events_pp_s1_tt_s1_tt.lhe.gz : process p p > s1 j j, s1 > t t~
>>
>> Thanks a lot!!
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/mg5amcnlo/+bug/1435527/+subscriptions
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1435527
>
> Title:
> Madspin error: KeyError : -4
>
> Status in Mad...

Read more...

Revision history for this message
Sébastien Brochet (blinkseb) wrote :

Dear experts, I had some time to investigate the issue and found the root cause. I attach a patch for the fix.

I have the following decay chain :

s1 > t t~
t~ > w- b~
w- > all all
t > w+ b
w+ > all all

There should be five decays. If you look at the code, where the decays chain is built (decay,py, lines 431 - 457), there's some recursion going on, where propa_id is decreased by one each time. Now, for the first decay, I have two particles in my case, so 3 iterations of the for loop line 444 (first is s1, next t and finally t~). But, add_decay is each time called with the same propa_id (-2 in this case), which means that the t decay chain will have ids -2, -3, and will then be overwritted by the t~ decay chain, with the same ids.

As a result, self.nb_decays (5 in this case) is correct, but the dict is missing one decay leg, resulting in a crash later on when some code tries to access the -4 id.

The attached patched, against the 2.3 branch, fix this issue.

Thanks

Revision history for this message
Sébastien Brochet (blinkseb) wrote :

The previous patch broke madspin for all others processes. I attach a new patch which should hopefully work for all processes.

Changed in mg5amcnlo:
assignee: nobody → Pierre Artoisenet (partois)
Revision history for this message
Pierre Artoisenet (partois) wrote :

Hi Sebastien,

Many thanks for the fix, I imported your patch into a separated branch and asked the modification to be imported into 2.3

Changed in mg5amcnlo:
status: New → Fix Committed
Changed in mg5amcnlo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.