MadSpin ZeroDivisionError on single top decay at LO

Asked by Richard Ruiz on 2018-02-03

Hi Folks,

I am a bit stumped by this one and would appreciate insight. In summary, I am trying to do a single top quark process at LO, followed by decay via MadSpin. As the summary title indicates, I am getting a "ZeroDivisionError" from MadSpin but cannot track down the origin of the problem.

There is a complaint by MadSpin about multiple processes, which might originate from having e/mu/tau final states (tau is massive in my model file). MadGraph does give me four sub-processes altogether, but I cannot tell if this is my problem.
INFO: P1_qb_tamtapqt
INFO: P2_bq_tamtapqt
INFO: P1_qb_llqt
INFO: P2_bq_llqt

Best,
Richard

Version:
2.6.2 (Yes, I bzr-ed for this version)

Process:
(Note: I am working with a model with massive generation 3)
define qq = u c d s u~ c~ d~ s~
define bb = b b~
define tt = t t~
define ell = e+ e- mu+ mu- ta+ ta-
generate qq bb > ell ell qq tt
add process bb qq > ell ell qq tt
output SM_pp_tqll_LO

Run script:
launch SM_pp_tqll_LO
shower=PYTHIA8
madspin=ON
set mb 1.e-5
compute_widths t
set run_tag smBkg_pp_tqll_3lX_LO_LHC14
set LHC 14
set nevents 10000
set no_parton_cut
set etal 4
set mmll 8

MadSpin:
define ell = e+ e- mu+ mu- ta+ ta-
define vv = ve ve~ vm vm~ vt vt~
define tt = t t~
define bb = b b~
define ww = w+ w-
decay tt > ww bb, ww > ell vv
launch

MadSpin Output:
INFO: Estimating the maximum weight
INFO: *****************************
INFO: Probing the first 75 events
INFO: with 400 phase space points
INFO:
INFO: No independent decay for one type of final states -> skip those events for the maximum weight computation
INFO:
INFO: Decaying the events...
WARNING: The partial cross section for each subprocess can not be determine. due
    Reason: multiple final state in the same subprocess (and the presence of multiple BR)
    Consequence: the <init> information of the lhe will therefore be incorrect. Please correct it if needed.
INFO: Total number of events written: 0/10000
Command "generate_events run_07" interrupted with error:
ZeroDivisionError : float division by zero
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/.../smBkg_pp_tqll_3lX_LO_LHC14_debug.log'.
Please attach this file to your report.
INFO: storing files of previous run
gzipping output file: unweighted_events.lhe
INFO: Done

smBkg_pp_tqll_3lX_LO_LHC14_debug.log:
  File "/.../madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/.../MadSpin/interface_madspin.py", line 582, in do_launch
    generate_all.run()
  File "/.../MadSpin/decay.py", line 2127, in run
    self.ending_run()
  File "/.../MadSpin/decay.py", line 2133, in ending_run
    efficiency = self.decaying_events(self.inverted_decay_mapping)
  File "/.../MadSpin/decay.py", line 2357, in decaying_events
    +str(float(trial_nb_all_events)/float(event_nb)))
ZeroDivisionError: float division by zero

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
2018-02-05
Last reply:
2018-02-07
Richard Ruiz (rruiz) said : #1

Update: I stripped taus from the production-level process, i.e.,
generate qq bb > emu emu qq tt
add process bb qq > emu emu qq tt

and still get the same problem. I also stripped emus from the process, i.e.,
generate qq bb > ta+ ta- qq tt
add process bb qq > ta+ ta- qq tt

and unsurprisingly get the same "ZeroDivisionError" problem.

Richard Ruiz (rruiz) said : #2

Update: The problem is also present if I user the built-in model file, sm-no_b_mass

Hi Richard,

Thanks to have spot this before the release. (I guess that the test suite should have spot it but we never knows for sure).

doing a bzr pull should be enough, but since I'm in the plane right now, I might forget to push right away.
So in case here is the patch:

Enjoy Fermilab,

Olivier

=== modified file 'MadSpin/decay.py'
--- MadSpin/decay.py 2018-01-11 10:40:04 +0000
+++ MadSpin/decay.py 2018-02-05 06:02:32 +0000
@@ -2746,6 +2746,8 @@
             decay_text = ', '.join(decay_text)
             commandline = ''
             for proc in processes:
+ if not proc.strip().startswith(('add','generate')):
+ proc = 'add process %s' % proc
                 commandline += self.get_proc_with_decay(proc, decay_text, mgcmd._curr_model)

             commandline = commandline.replace('add process', 'generate',1)
@@ -2847,7 +2849,10 @@
             #catch line like "define" where no decay need to be added
             if not new_proc.strip():
                 continue
- if not new_proc.startswith(('add', 'generate')):
+ if new_proc.startswith('p '):
+ new_proc = 'add process %s' % new_proc
+ logger.critical("wrongly formatted input for MadSpin. Please report this!")
+ elif not new_proc.startswith(('add', 'generate')):
                 commands.append(new_proc)
                 continue

=== modified file 'tests/unit_tests/madspin/test_madspin.py'
--- tests/unit_tests/madspin/test_madspin.py 2018-01-11 10:40:04 +0000
+++ tests/unit_tests/madspin/test_madspin.py 2018-02-05 06:06:55 +0000
@@ -105,7 +105,11 @@
         out = madspin.decay_all_events.get_proc_with_decay('generate g g > h QED=1 [noborn=QCD]', 'h > b b~', cmd._curr_model)
         self.assertEqual(['add process g g > h QED=1 [sqrvirt=QCD], h > b b~ --no_warning=duplicate;'],
                          [out])
-
+
+ # simple case but failing initial implementation. Handle it now but raising a critical message [mute here]
+ with misc.MuteLogger(['decay'], [60]):
+ out = madspin.decay_all_events.get_proc_with_decay('p p > t t~', 't~ > w- b~ QCD=99, t > w+ b QCD=99', cmd._curr_model)
+ self.assertEqual(['add process p p > t t~, t~ > w- b~ QCD=99, t > w+ b QCD=99 --no_warning=duplicate;'],[out])

         self.assertRaises(Exception, madspin.decay_all_events.get_proc_with_decay, 'generate p p > t t~, (t> w+ b, w+ > e+ ve)')

> On 3 Feb 2018, at 23:17, Richard Ruiz <email address hidden> wrote:
>
> Question #664031 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/664031
>
> Richard Ruiz posted a new comment:
> Update: I stripped taus from the production-level process, i.e.,
> generate qq bb > emu emu qq tt
> add process bb qq > emu emu qq tt
>
> and still get the same problem. I also stripped emus from the process, i.e.,
> generate qq bb > ta+ ta- qq tt
> add process bb qq > ta+ ta- qq tt
>
> and unsurprisingly get the same "ZeroDivisionError" problem.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Richard Ruiz (rruiz) said : #4

Thanks Olivier,

This seemed to do the trick. One more question: I am still getting the following warning:

INFO: Estimating the maximum weight
INFO: *****************************
...
...
INFO: Event 146/150 : 7.9s
INFO:
INFO: Decaying the events...
WARNING: The partial cross section for each subprocess can not be determine. due
    Reason: multiple final state in the same subprocess (and the presence of multiple BR)
    Consequence: the <init> information of the lhe will therefore be incorrect. Please correct it if needed.
INFO: Event nb 1000 1.8s
INFO: Event nb 2000 3s

To reiterate, I am decaying tops to e (massless), mu (massless), and taus (massive), so I am wondering if the difference in W boson BRs, i.e.,
INFO: decay channels for w+ : ( width = 2.026475 GeV )
INFO: BR d1 d2
...
INFO: 1.111203e-01 mu+ vm
INFO: 1.111203e-01 e+ ve
INFO: 1.110379e-01 ta+ vt

Is causing this. Suggestions/thoughts?

Hi Richard,

I'm running this script:

import model sm-no_b_mass
define qq = u c d s u~ c~ d~ s~
define bb = b b~
define tt = t t~
define ell = e+ e- mu+ mu- ta+ ta-
define tt = t t~
define bb = b b~
define ww = w+ w-
define vv = ve ve~ vm vm~ vt vt~
generate qq bb > ta+ ta- qq tt
add process bb qq > ta+ ta- qq tt
output
launch
shower=OFF
madspin=ON
#decay t > w+ b
#decay t~ > w- b~
decay tt > ww bb, ww > ell vv
set mb 1.e-5
#set wt Auto
set run_tag smBkg_pp_tqll_3lX_LO_LHC14
set LHC 14
set nevents 10000
set no_parton_cut
set etal 4
set mmll 8

and do not reproduce this warning.

Do you also have such warning in this model or is it only for your BSM model?
Or do you see some part that I missing in my script compare to yours?

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Richard Ruiz for more information if necessary.

To post a message you must log in.