Fail to madspin :IndexError : pop from empty list

Asked by Yuan

Hello!

I am a complete beginner of Madgraph. I am trying to generate SM process: w+ a > w+ w+ w- z and w+ z > w+ w+ w- z , and let w+ decay to mu+ vm . Everything is going well except decaying events by madspin.

Here are my command in Madgraph v3.3.1:
set group_subprocesses False
define vbp = w+ a z
define vbm = w- a z
generate vbp vbm > w+ w+ w- z
output Muon_BSM/TypeIII/Decay/mmzw-3TeV-data/vbf-mmzw-bac-1.5TeV
y
launch
done
set lpp1 -4
set lpp2 4
set pdlabel eva
set fixed_fac_scale false
set dynamical_scale_choice 4
set scalefact 0.5
set ebeam 1500
set nevents 10000
set nhel 1
done

For madspin I enter the madspin card , change the "w+ > all all " to "w+ > mu+ vm", and delete "w- > all all " and "z > all all".
The results:

#####################
INFO: generating the production square matrix element
INFO: generate vbp vbm > w+ w+ w- z;
INFO: Done 4.999
INFO: generating the full matrix element squared (with decay)
INFO: generate vbp vbm > w+ w+ w- z, w+ > mu+ vm QCD=99 --no_warning=duplicate;
INFO: Done 5.865
Command "generate_events run_01" interrupted with error:
IndexError : pop from empty list
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/Users/maxwell/Software/MG5_aMC_v3_3_1/test3/run_01_tag_1_debug.log'.
Please attach this file to your report.
INFO: storing files of previous run
gzipping output file: unweighted_events.lhe
INFO: Done
INFO:
quit
INFO:

##########
run_01_tag_1_debug.log
##########

#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.3.1 2021-12-04 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *
#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
generate_events run_01
Traceback (most recent call last):
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1544, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
    return func(arg, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/madevent_interface.py", line 2362, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/common_run_interface.py", line 7295, in new_fct
    original_fct(obj, *args, **opts)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/madevent_interface.py", line 2461, in run_generate_events
    self.exec_cmd('decay_events -from_cards', postcmd=False)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1573, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
    return func(arg, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/common_run_interface.py", line 3903, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1692, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1573, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
    return func(arg, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/various/misc.py", line 110, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/MadSpin/interface_madspin.py", line 658, in do_launch
    generate_all = madspin.decay_all_events(self, self.banner, self.events_file,
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/MadSpin/decay.py", line 2050, in __init__
    self.generate_all_matrix_element()
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/various/misc.py", line 110, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/madgraph/various/misc.py", line 2014, in deco_f_set
    out = f(*args, **opt)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/MadSpin/decay.py", line 2869, in generate_all_matrix_element
    self.all_ME.add_decay(matrix_element, me_path)
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/MadSpin/decay.py", line 1017, in add_decay
    'decay_struct':self.get_full_process_structure(proc_list),
  File "/Users/maxwell/Software/MG5_aMC_v3_3_1/MadSpin/decay.py", line 1055, in get_full_process_structure
    i, proc = to_decay[pid].pop()
IndexError: pop from empty list
                              Run Options
                              -----------
               stdout_level : 20 (user set)

                         MadEvent Options
                         ----------------
     automatic_html_opening : False (user set)
        notification_center : True
                   run_mode : 2
              cluster_queue : None (user set)
               cluster_time : None (user set)
               cluster_size : 100
             cluster_memory : 100 (user set)
                    nb_core : 20 (user set)
          cluster_temp_path : None

                      Configuration Options
                      ---------------------
               pythia8_path : /Users/maxwell/Software/MG5_aMC_v3_3_1/HEPTools/pythia8 (user set)
                  hwpp_path : None (user set)
                thepeg_path : None (user set)
                 hepmc_path : None (user set)
           madanalysis_path : None (user set)
          madanalysis5_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
        exrootanalysis_path : None (user set)
               syscalc_path : None (user set)
                     lhapdf : lhapdf-config
                 lhapdf_py2 : None
                 lhapdf_py3 : None
                    timeout : 60
              f2py_compiler : None
          f2py_compiler_py2 : None
          f2py_compiler_py3 : None
                web_browser : None
                 eps_viewer : None
                text_editor : None
           fortran_compiler : None
               cpp_compiler : None
                auto_update : 7 (user set)
               cluster_type : condor
      cluster_status_update : (600, 30)
           cluster_nb_retry : 1
         cluster_local_path : None
         cluster_retry_wait : 300
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.3.1 2021-12-04 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************
set group_subprocesses Auto
set ignore_six_quark_processes False
set low_mem_multicore_nlo_generation False
set complex_mass_scheme False
set include_lepton_initiated_processes False
set gauge unitary
set loop_optimized_output True
set loop_color_flows False
set max_npoint_for_channel 0
set default_unset_couplings 99
set max_t_for_channel 99
set zerowidth_tchannel True
set nlo_mixed_expansion True
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
set group_subprocesses False
define vbp = w+ a z
define vbm = w- a z
generate vbp vbm > w+ w+ w- z
output test3
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####
######################################################################
## ##
## Width set on Auto will be computed following the information ##
## present in the decay.py files of the model. ##
## See arXiv:1402.1178 for more details. ##
## ##
######################################################################

###################################
## INFORMATION FOR MASS
###################################
Block mass
    5 4.700000e+00 # MB
    6 1.730000e+02 # MT
   15 1.777000e+00 # MTA
   23 9.118800e+01 # MZ
   25 1.250000e+02 # MH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
  1 0.000000e+00 # d : 0.0
  2 0.000000e+00 # u : 0.0
  3 0.000000e+00 # s : 0.0
  4 0.000000e+00 # c : 0.0
  11 0.000000e+00 # e- : 0.0
  12 0.000000e+00 # ve : 0.0
  13 0.000000e+00 # mu- : 0.0
  14 0.000000e+00 # vm : 0.0
  16 0.000000e+00 # vt : 0.0
  21 0.000000e+00 # g : 0.0
  22 0.000000e+00 # a : 0.0
  24 8.041900e+01 # w+ : cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - (aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2)))

###################################
## INFORMATION FOR SMINPUTS
###################################
Block sminputs
    1 1.325070e+02 # aEWM1
    2 1.166390e-05 # Gf
    3 1.180000e-01 # aS (Note that Parameter not used if you use a PDF set)

###################################
## INFORMATION FOR YUKAWA
###################################
Block yukawa
    5 4.700000e+00 # ymb
    6 1.730000e+02 # ymt
   15 1.777000e+00 # ymtau

###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.491500e+00 # WT
DECAY 23 2.441404e+00 # WZ
DECAY 24 2.047600e+00 # WW
DECAY 25 6.382339e-03 # WH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
DECAY 1 0.000000e+00 # d : 0.0
DECAY 2 0.000000e+00 # u : 0.0
DECAY 3 0.000000e+00 # s : 0.0
DECAY 4 0.000000e+00 # c : 0.0
DECAY 5 0.000000e+00 # b : 0.0
DECAY 11 0.000000e+00 # e- : 0.0
DECAY 12 0.000000e+00 # ve : 0.0
DECAY 13 0.000000e+00 # mu- : 0.0
DECAY 14 0.000000e+00 # vm : 0.0
DECAY 15 0.000000e+00 # ta- : 0.0
DECAY 16 0.000000e+00 # vt : 0.0
DECAY 21 0.000000e+00 # g : 0.0
DECAY 22 0.000000e+00 # a : 0.0
#*********************************************************************
# MadGraph5_aMC@NLO *
# *
# run_card.dat MadEvent *
# *
# This file is used to set the parameters of the run. *
# *
# Some notation/conventions: *
# *
# Lines starting with a '# ' are info or comments *
# *
# mind the format: value = variable ! comment *
# *
# To display more options, you can type the command: *
# update full_run_card *
#*********************************************************************
#
#*********************************************************************
# Tag name for the run (one word) *
#*********************************************************************
  tag_1 = run_tag ! name of the run
#*********************************************************************
# Number of events and rnd seed *
# Warning: Do not generate more than 1M events in a single run *
#*********************************************************************
  10000 = nevents ! Number of unweighted events requested
  0 = iseed ! rnd seed (0=assigned automatically=default))
#*********************************************************************
# Collider type and energy *
# lpp: 0=No PDF, 1=proton, -1=antiproton, 2=elastic photon of proton,*
# +/-3=PDF of electron/positron beam *
# +/-4=PDF of muon/antimuon beam *
#*********************************************************************
  -4 = lpp1 ! beam 1 type
  4 = lpp2 ! beam 2 type
  1500.0 = ebeam1 ! beam 1 total energy in GeV
  1500.0 = ebeam2 ! beam 2 total energy in GeV
#*********************************************************************
# Beam polarization from -100 (left-handed) to 100 (right-handed) *
#*********************************************************************
  0.0 = polbeam1 ! beam polarization for beam 1
  0.0 = polbeam2 ! beam polarization for beam 2

#*********************************************************************
# PDF CHOICE: this automatically fixes alpha_s and its evol. *
# pdlabel: lhapdf=LHAPDF (installation needed) [1412.7420] *
# iww=Improved Weizsaecker-Williams Approx.[hep-ph/9310350] *
# eva=Effective W/Z/A Approx. [21yy.zzzzz] *
# none=No PDF, same as lhapdf with lppx=0 *
#*********************************************************************
     eva = pdlabel ! PDF set
  230000 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number
# To see heavy ion options: type "update ion_pdf"
#*********************************************************************
# Renormalization and factorization scales *
#*********************************************************************
  False = fixed_ren_scale ! if .true. use fixed ren scale
     False = fixed_fac_scale ! if .true. use fixed fac scale
  91.188 = scale ! fixed ren scale
  91.188 = dsqrt_q2fact1 ! fixed fact scale for pdf1
  91.188 = dsqrt_q2fact2 ! fixed fact scale for pdf2
  4 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
  0.5 = scalefact ! scale factor for event-by-event scales
  0 = ievo_eva ! scale evolution for EW pdfs (eva):
                         ! 0 for evo by q^2; 1 for evo by pT^2

#*********************************************************************
# Type and output format
#*********************************************************************
  False = gridpack !True = setting up the grid pack
  -1.0 = time_of_flight ! threshold (in mm) below which the invariant livetime is not written (-1 means not written)
  average = event_norm ! average/sum. Normalization of the weight in the LHEF
# To see MLM/CKKW merging options: type "update MLM" or "update CKKW"

#*********************************************************************
#
#*********************************************************************
# Phase-Space Optimization strategy (basic options)
#*********************************************************************
  1 = nhel ! using helicities importance sampling or not.
                             ! 0: sum over helicity, 1: importance sampling
  2 = sde_strategy ! default integration strategy (hep-ph/2021.xxxxx)
                             ! 1 is old strategy (using amp square)
        ! 2 is new strategy (using only the denominator)
# To see advanced option for Phase-Space optimization: type "update psoptim"
#*********************************************************************
# Generation bias, check the wiki page below for more information: *
# 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' *
#*********************************************************************
  None = bias_module ! Bias type of bias, [None, ptj_bias, -custom_folder-]
  {} = bias_parameters ! Specifies the parameters of the module.
#
#*******************************
# Parton level cuts definition *
#*******************************
  0.0 = dsqrt_shat ! minimal shat for full process
#
#
#*********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
#*********************************************************************
  15.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
#*********************************************************************
# Standard Cuts *
#*********************************************************************
# Minimum and maximum pt's (for max, -1 means no cut) *
#*********************************************************************
  {} = pt_min_pdg ! pt cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = pt_max_pdg ! pt cut for other particles (syntax e.g. {6: 100, 25: 50})
#
# For display option for energy cut in the partonic center of mass frame type 'update ecut'
#
#*********************************************************************
# Maximum and minimum absolute rapidity (for max, -1 means no cut) *
#*********************************************************************
  {} = eta_min_pdg ! rap cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = eta_max_pdg ! rap cut for other particles (syntax e.g. {6: 2.5, 23: 5})
#*********************************************************************
# Minimum and maximum DeltaR distance *
#*********************************************************************
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
#*********************************************************************
  {} = mxx_min_pdg ! min invariant mass of a pair of particles X/X~ (e.g. {6:250})
  {'default': False} = mxx_only_part_antipart ! if True the invariant mass is applied only
                       ! to pairs of particle/antiparticle and not to pairs of the same pdg codes.
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
  0.0 = ptheavy ! minimum pt for at least one heavy final state
#*********************************************************************
# maximal pdg code for quark to be considered as a light jet *
# (otherwise b cuts are applied) *
#*********************************************************************
  4 = maxjetflavor ! Maximum jet pdg code
#*********************************************************************
#
#*********************************************************************
# Store info for systematics studies *
# WARNING: Do not use for interference type of computation *
#*********************************************************************
  True = use_syst ! Enable systematics studies
#
  systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
  ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule

By the way, I off the madspin, and try to use another code "generate vbp vbm > w+ w+ w- z , w+ > mu+ vm ". I set nevents 10000, but fail to reach target 10000 , only 4.

#######
INFO: fail to reach target 10000
  === Results Summary for run: run_01 tag: tag_1 ===

     Cross-section : 10.17 +- 5.086 pb
     Nb of events : 4

INFO: No version of lhapdf. Can not run systematics computation
store_events
INFO: Storing parton level results
INFO: End Parton
reweight -from_cards
decay_events -from_cards
INFO: storing files of previous run
INFO: Done
quit

Look forward to your reply, thanks.
Yuan

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

Dear Yuan,

Thanks a lot for this bug report, the issue is that madspin tries to assign a decay to the W in the initial state and then fails short of one decay for the final state. Those are the typical side effect of adding feature on one side of the code creating un-expected crash on some other part of the code.

You will find the associated patch here: https://bazaar.launchpad.net/~maddevelopers/mg5amcnlo/3.4.0/revision/991
This will be included (in a few minutes) in the Release candidate version of 3.4.0.

Cheers,

Olivier

Revision history for this message
Yuan (maxwell12138) said :
#2

Dear Olivier,

Thank you so much for solving my questions so quickly. You did me a big favor, and I'm very grateful to you.

By the way, I want to ask another question. I off the madspin, and try to use another code "generate vbp vbm > w+ w+ w- z , w+ > mu+ vm ". I set nevents 10000, but fail to reach target 10000 , only 4.
Why? Is there any way to improve it.

#######
INFO: fail to reach target 10000
  === Results Summary for run: run_01 tag: tag_1 ===

     Cross-section : 10.17 +- 5.086 pb
     Nb of events : 4

INFO: No version of lhapdf. Can not run systematics computation
store_events
INFO: Storing parton level results
INFO: End Parton
reweight -from_cards
decay_events -from_cards
INFO: storing files of previous run
INFO: Done
quit

Look forward to your reply, thanks.
Yuan

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

I guess that this is the kind of issue that this paper should be able to solve:
https://arxiv.org/pdf/2203.10440.pdf

But this is not yet implemented in MG5aMC (likely for 3.5.0) and the model is not yet public (this is likely going to be the case after their next publication)

Cheers,

Olivier

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

Actually, it seems that you face a singularity when adding the decay.
Which should not be gauge invariant related (but maybe since adding fixed width can destroy gauge invariance)

You likely need to add cut,
Actually the eva mode typically requires a shat cut at at least 1 TeV to be valid, so I guess that you should start to have that cut set anyway.

Cheers,

Olivier

Revision history for this message
Yuan (maxwell12138) said :
#5

Dear Olivier,

I did what you said ,and thank you for solving my problem. There's one more thing to ask, is the cross section correct when number of events fail to reach target. Can I use this cross section?

Thanks,

Yuan

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

Hi,

yes the cross-section quoted is typically correct (up to the quoted statistical uncertainty) if that uncertainty is large (more than 20%)
then I would not trust it.

Cheers,

Olivier

Revision history for this message
Yuan (maxwell12138) said :
#7

Thanks Olivier Mattelaer, that solved my question.