MadSpin ZeroDivisionError on single top decay at LO

Asked by Richard Ruiz

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:
Last reply:
Revision history for this message
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.

Revision history for this message
Richard Ruiz (rruiz) said :
#2

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

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

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.

Revision history for this message
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?

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

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

Revision history for this message
Ramkrishna (ramkrishna-sharma71) said :
#6

Dear Olivier,

I am also getting the similar error [1]. And my madgraph version is 2.6.1.

As I can read from the previous post after adding the path that you have given for 2.6.2 it worked. I also tried to do the same but it seems that there is many diffences in the corresponding files for 2.6.1 and 2.6.2.

Could you please also send me the pathch for the version 2.6.1?

For your information, I am trying to generate the below process using the reweight card.

set group_subprocesses Auto
set ignore_six_quark_processes False
set complex_mass_scheme False
import model SM_LS_LM_LT_UFO
generate p p > w+ w+ j j QED=4 QCD=0 NP=1

Let me know if you need more information.

with regards,
Ram

[1]
INFO: generate matrix element for decay only (1 - > N).
INFO: output standalone_msF /uscms_data/d3/asahmed/Gridpack2017/genproductions/bin/MadGraph5_aMCatNLO/aQGC_WPlepWPhadJJ_EWK_LO_NPle1_mjj100pt10/aQGC_WPlepWPhadJJ_EWK_LO_NPle1_mjj100pt10_gridpack/work/process/madspingrid/decay_me
INFO: Done 3.368
INFO: Compiling code
INFO: detect independant decays
INFO: Done in 7.56426692009s
INFO:
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...
INFO: Total number of events written: 0/1000
Command "launch" interrupted with error:
ZeroDivisionError : float division by zero
Please report this bug to developers
       More information is found in 'MS_debug'.

       Please attach this file to your report.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#7

Hi,

We tend to do not provide patch for old version of MG5aMC.
Please update to 2.6.5.

This being said I do not think that your problem is the same as the one reported in the question.
I actually believe that you are responsible here (i.e. that you ask something that is not supported or something like that)
But without any information on what you do, I can not help.

So please check with 2.6.5 if this is already fix or not, and if not create a bug report with the debug file, the model directory and the madspin_card (if not present in the debug file)

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.