MadSpin error in loop induced process

Asked by Sihyun Jeon on 2020-08-06

Dear MG team,

I am facing problem when running loop induced process with MadSpin.
Could you help me with this?

::Process card::
import model 2HDMtII_NLO #I think you can get the model card by doing wget https://cms-project-generators.web.cern.ch/cms-project-generators/2HDMtII_NLO.tar.gz
generate g g > h3 [QCD] @0
output pptoh3_bw15000
launch

::customizations::
set mass 25 125
set mass 35 2000
set mass 36 2000
set mass 37 2000
set no_parton_cut
set bwcutoff 15000 #I am doing this to check what the effect is by changing bw/ I also verified the error I am facing also happens when bwcutoff is set to 15

::MadSpin card::
set ms_dir ./madspingrid
set Nevents_for_max_weigth 250 # number of events for the estimate of the max. weight
set max_weight_ps_point 400 # number of PS to estimate the maximum for each event
set max_running_process 1
define ell+ = e+ mu+ ta+
define ell+ = e+ mu+ ta+
Defined multiparticle ell+ = e+ mu+ ta+
define ell- = e- mu- ta-
define ell- = e- mu- ta-
Defined multiparticle ell- = e- mu- ta-
set spinmode none
decay h3 > h1 z, h1 > ta+ ta-, z > ell+ ell-
launch

WRITE GRIDCARD /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/madevent
Traceback (most recent call last):
  File "./madevent/bin/gridrun", line 86, in <module>
    cmd_line = cmd_interface.GridPackCmd(me_dir=root_path, nb_event=args[0], seed=args[1], gran=args[2])
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/madevent/bin/internal/madevent_interface.py", line 6320, in __init__
    self.write_gridcard(nb_event, seed, gran) # set readonly on True if needed
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/madevent/bin/internal/madevent_interface.py", line 6371, in write_gridcard
    gridpackcard['gseed'] = seed
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/madevent/bin/internal/banner.py", line 1200, in __setitem__
    value = self.format_variable(value, targettype, name=name)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/madevent/bin/internal/banner.py", line 1350, in format_variable
    raise InvalidCmd, "%s can not be mapped to an integer" % value
internal.InvalidCmd: None can not be mapped to an integer
mv: cannot stat `./Events/GridRun_None/unweighted_events.lhe.gz': No such file or directory
write ./events.lhe.gz
Command "generate_events run_01" interrupted with error:
IOError : [Errno 2] No such file or directory: '/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/events.lhe.gz'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/pptoh3_bw15000/run_01_tag_1_debug.log'.
Please attach this file to your report.

[shjeon@cms2 MG5_aMC_v2_6_5]$ cat /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/pptoh3_bw15000/run_01_tag_1_debug.log
#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.5 2018-02-03 *
#* *
#* 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 "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1514, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/madevent_interface.py", line 2469, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/common_run_interface.py", line 6869, in new_fct
    original_fct(obj, *args, **opts)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/madevent_interface.py", line 2562, in run_generate_events
    self.exec_cmd('decay_events -from_cards', postcmd=False)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1543, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/common_run_interface.py", line 3687, in do_decay_events
    madspin_cmd.import_command_file(path)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1660, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1543, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/MadSpin/interface_madspin.py", line 574, in do_launch
    return self.run_bridge(line)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/MadSpin/interface_madspin.py", line 852, in run_bridge
    evt_decayfile[pdg] = self.generate_events(pdg, min(nb_needed,100000), mg5)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/MadSpin/interface_madspin.py", line 1266, in generate_events
    out[i] = lhe_parser.EventFile(pjoin(decay_dir, 'events.lhe.gz'))
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madgraph/various/lhe_parser.py", line 210, in __init__
    super(EventFile, self).__init__(path, mode, *args, **opt)
  File "/cvmfs/cms.cern.ch/slc6_amd64_gcc630/external/python/2.7.11-mlhled2/lib/python2.7/gzip.py", line 94, in __init__
    fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: '/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/events.lhe.gz'
Related File: /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/madspingrid/decay_36_0/events.lhe.gz
                              Run Options
                              -----------
               stdout_level : 20 (user set)

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

                      Configuration Options
                      ---------------------
                text_editor : vi (user set)
         cluster_local_path : None
      cluster_status_update : (600, 30)
               pythia8_path : /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/HEPTools/pythia8 (user set)
                  hwpp_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
                thepeg_path : None (user set)
               cluster_type : condor
          madanalysis5_path : None (user set)
           cluster_nb_retry : 1
                 eps_viewer : None
                web_browser : None
               syscalc_path : None (user set)
           madanalysis_path : None (user set)
                     lhapdf : /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/LHAPDF/bin/lhapdf-config (user set)
              f2py_compiler : /cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/py2-numpy/1.6.1-cms2/bin/f2py (user set)
                 hepmc_path : None (user set)
         cluster_retry_wait : 300
           fortran_compiler : None
                auto_update : 0 (user set)
        exrootanalysis_path : /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_6_5/ExRootAnalysis (user set)
                    timeout : 60
               cpp_compiler : None
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.5 2018-02-03 *
#* *
#* 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 default_unset_couplings 99
set group_subprocesses Auto
set ignore_six_quark_processes False
set loop_optimized_output True
set loop_color_flows False
set gauge unitary
set complex_mass_scheme False
set max_npoint_for_channel 0
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~
import model 2HDMtII_NLO
define ell+ = e+ mu+ ta+
define ell- = e- mu- ta-
generate g g > h3 [QCD] @0
output pptoh3_bw15000
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 ####
######################################################################
###################################
## INFORMATION FOR FRBLOCK
###################################
BLOCK FRBLOCK #
      1 1.537480e+00 # tanbeta
      2 1.000000e-01 # sinbma
###################################
## INFORMATION FOR HIGGS
###################################
BLOCK HIGGS #
      1 5.000000e-01 # l2
      2 1.000000e+00 # l3
      3 1.000000e-01 # lr7
###################################
## INFORMATION FOR LOOP
###################################
BLOCK LOOP #
      1 9.118800e+01 # mu_r
###################################
## INFORMATION FOR MASS
###################################
BLOCK MASS #
      5 4.700000e+00 # mb
      6 1.720000e+02 # mt
      23 9.118760e+01 # mz
      25 1.250000e+02 # mh1
      35 2.000000e+03 # mh2
      36 2.000000e+03 # mh3
      37 2.000000e+03 # mhc
      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
      15 0.000000e+00 # ta- : 0.0
      16 0.000000e+00 # vt : 0.0
      21 0.000000e+00 # g : 0.0
      22 0.000000e+00 # a : 0.0
      24 7.982466e+01 # w+ : cmath.sqrt(mz__exp__2/2. + cmath.sqrt(mz__exp__4/4. - (aew*cmath.pi*mz__exp__2)/(gf*sqrt__2)))
      9000002 9.118760e+01 # ghz : mz
      9000003 7.982466e+01 # ghwp : mw
      9000004 7.982466e+01 # ghwm : mw
###################################
## INFORMATION FOR SMINPUTS
###################################
BLOCK SMINPUTS #
      1 1.279000e+02 # aewm1
      2 1.166390e-05 # gf
      3 1.180000e-01 # as
###################################
## INFORMATION FOR YUKAWA
###################################
BLOCK YUKAWA #
      5 4.700000e+00 # ymb
      6 1.720000e+02 # ymt
      15 1.777000e+00 # ymtau
###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.508336e+00 # wt
DECAY 23 2.495200e+00 # wz
DECAY 24 2.085000e+00 # ww
DECAY 25 1.000000e+00 # wh1
DECAY 35 1.000000e+00 # wh2
DECAY 36 1.000000e+00 # wh3
DECAY 37 1.000000e+00 # whc
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
###################################
## INFORMATION FOR QNUMBERS 9000001
###################################
BLOCK QNUMBERS 9000001 # gha
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000002
###################################
BLOCK QNUMBERS 9000002 # ghz
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000003
###################################
BLOCK QNUMBERS 9000003 # ghwp
      1 3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000004
###################################
BLOCK QNUMBERS 9000004 # ghwm
      1 -3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 82
###################################
BLOCK QNUMBERS 82 # ghg
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 8 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 37
###################################
BLOCK QNUMBERS 37 # h+
      1 3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 35
###################################
BLOCK QNUMBERS 35 # h2
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 0 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 36
###################################
BLOCK QNUMBERS 36 # h3
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 0 # particle/antiparticle distinction (0=own anti)

#*********************************************************************
# 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 *
#*********************************************************************
#
#*******************
# Running parameters
#*******************
#
#*********************************************************************
# 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 *
# If you want to run Pythia, avoid more than 50k events in a run. *
#*********************************************************************
  100000 = 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=photon from proton, *
# 3=photon from electron *
#*********************************************************************
  1 = lpp1 ! beam 1 type
  1 = lpp2 ! beam 2 type
  6500.0 = ebeam1 ! beam 1 total energy in GeV
  6500.0 = ebeam2 ! beam 2 total energy in GeV
# To see polarised beam options: type "update beam_pol"
#*********************************************************************
# PDF CHOICE: this automatically fixes also alpha_s and its evol. *
#*********************************************************************
  nn23lo1 = 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
  -1 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
  1.0 = scalefact ! scale factor for event-by-event scales
#*********************************************************************
# 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)
  3.0 = lhe_version ! Change the way clustering information pass to shower.
  True = clusinfo ! include clustering tag in output
  average = event_norm ! average/sum. Normalization of the weight in the LHEF

#*********************************************************************
# Matching parameter (MLM only)
#*********************************************************************
  0 = ickkw ! 0 no matching, 1 MLM
  1.0 = alpsfact ! scale factor for QCD emission vx
  False = chcluster ! cluster only according to channel diag
  4 = asrwgtflavor ! highest quark flavor for a_s reweight
  False = auto_ptj_mjj ! Automatic setting of ptj and mjj if xqcut >0
                                   ! (turn off for VBF and single top processes)
  0.0 = xqcut ! minimum kt jet measure between partons
#*********************************************************************
#
#*********************************************************************
# handling of the helicities:
# 0: sum over all helicities
# 1: importance sampling over helicities
#*********************************************************************
  1 = nhel ! using helicities importance sampling or not.
#*********************************************************************
# 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 *
#*******************************
#
#
#*********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
#*********************************************************************
  15000.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
#*********************************************************************
# Apply pt/E/eta/dr/mij/kt_durham cuts on decay products or not
# (note that etmiss/ptll/ptheavy/ht/sorted cuts always apply)
#*********************************************************************
  False = cut_decays ! Cut decay products
#*********************************************************************
# Standard Cuts *
#*********************************************************************
# Minimum and maximum pt's (for max, -1 means no cut) *
#*********************************************************************
  0.0 = ptj ! minimum pt for the jets
  0.0 = ptb ! minimum pt for the b
  0.0 = pta ! minimum pt for the photons
  0.0 = ptl ! minimum pt for the charged leptons
  0.0 = misset ! minimum missing Et (sum of neutrino's momenta)
  -1.0 = ptjmax ! maximum pt for the jets
  -1.0 = ptbmax ! maximum pt for the b
  -1.0 = ptamax ! maximum pt for the photons
  -1.0 = ptlmax ! maximum pt for the charged leptons
  -1.0 = missetmax ! maximum missing Et (sum of neutrino's momenta)
  {} = 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})
#*********************************************************************
# Minimum and maximum E's (in the center of mass frame) *
#*********************************************************************
  0.0 = ej ! minimum E for the jets
  0.0 = eb ! minimum E for the b
  0.0 = ea ! minimum E for the photons
  0.0 = el ! minimum E for the charged leptons
  -1.0 = ejmax ! maximum E for the jets
  -1.0 = ebmax ! maximum E for the b
  -1.0 = eamax ! maximum E for the photons
  -1.0 = elmax ! maximum E for the charged leptons
  {} = e_min_pdg ! E cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = e_max_pdg ! E cut for other particles (syntax e.g. {6: 100, 25: 50})
#*********************************************************************
# Maximum and minimum absolute rapidity (for max, -1 means no cut) *
#*********************************************************************
  -1.0 = etaj ! max rap for the jets
  -1.0 = etab ! max rap for the b
  -1.0 = etaa ! max rap for the photons
  -1.0 = etal ! max rap for the charged leptons
  0.0 = etajmin ! min rap for the jets
  0.0 = etabmin ! min rap for the b
  0.0 = etaamin ! min rap for the photons
  0.0 = etalmin ! main rap for the charged leptons
  {} = 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 *
#*********************************************************************
  0.0 = drjj ! min distance between jets
  0.0 = drbb ! min distance between b's
  0.0 = drll ! min distance between leptons
  0.0 = draa ! min distance between gammas
  0.0 = drbj ! min distance between b and jet
  0.0 = draj ! min distance between gamma and jet
  0.0 = drjl ! min distance between jet and lepton
  0.0 = drab ! min distance between gamma and b
  0.0 = drbl ! min distance between b and lepton
  0.0 = dral ! min distance between gamma and lepton
  -1.0 = drjjmax ! max distance between jets
  -1.0 = drbbmax ! max distance between b's
  -1.0 = drllmax ! max distance between leptons
  -1.0 = draamax ! max distance between gammas
  -1.0 = drbjmax ! max distance between b and jet
  -1.0 = drajmax ! max distance between gamma and jet
  -1.0 = drjlmax ! max distance between jet and lepton
  -1.0 = drabmax ! max distance between gamma and b
  -1.0 = drblmax ! max distance between b and lepton
  -1.0 = dralmax ! maxdistance between gamma and lepton
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
# WARNING: for four lepton final state mmll cut require to have *
# different lepton masses for each flavor! *
#*********************************************************************
  0.0 = mmjj ! min invariant mass of a jet pair
  0.0 = mmbb ! min invariant mass of a b pair
  0.0 = mmaa ! min invariant mass of gamma gamma pair
  0.0 = mmll ! min invariant mass of l+l- (same flavour) lepton pair
  -1.0 = mmjjmax ! max invariant mass of a jet pair
  -1.0 = mmbbmax ! max invariant mass of a b pair
  -1.0 = mmaamax ! max invariant mass of gamma gamma pair
  -1.0 = mmllmax ! max invariant mass of l+l- (same flavour) lepton pair
  {} = 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.
#*********************************************************************
# Minimum and maximum invariant mass for all letpons *
#*********************************************************************
  0.0 = mmnl ! min invariant mass for all letpons (l+- and vl)
  -1.0 = mmnlmax ! max invariant mass for all letpons (l+- and vl)
#*********************************************************************
# Minimum and maximum pt for 4-momenta sum of leptons *
#*********************************************************************
  0.0 = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
  -1.0 = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
  0.0 = ptheavy ! minimum pt for at least one heavy final state
  0.0 = xptj ! minimum pt for at least one jet
  0.0 = xptb ! minimum pt for at least one b
  0.0 = xpta ! minimum pt for at least one photon
  0.0 = xptl ! minimum pt for at least one charged lepton
#*********************************************************************
# Control the pt's of the jets sorted by pt *
#*********************************************************************
  0.0 = ptj1min ! minimum pt for the leading jet in pt
  0.0 = ptj2min ! minimum pt for the second jet in pt
  0.0 = ptj3min ! minimum pt for the third jet in pt
  0.0 = ptj4min ! minimum pt for the fourth jet in pt
  -1.0 = ptj1max ! maximum pt for the leading jet in pt
  -1.0 = ptj2max ! maximum pt for the second jet in pt
  -1.0 = ptj3max ! maximum pt for the third jet in pt
  -1.0 = ptj4max ! maximum pt for the fourth jet in pt
  0 = cutuse ! reject event if fails any (0) / all (1) jet pt cuts
#*********************************************************************
# Control the pt's of leptons sorted by pt *
#*********************************************************************
  0.0 = ptl1min ! minimum pt for the leading lepton in pt
  0.0 = ptl2min ! minimum pt for the second lepton in pt
  0.0 = ptl3min ! minimum pt for the third lepton in pt
  0.0 = ptl4min ! minimum pt for the fourth lepton in pt
  -1.0 = ptl1max ! maximum pt for the leading lepton in pt
  -1.0 = ptl2max ! maximum pt for the second lepton in pt
  -1.0 = ptl3max ! maximum pt for the third lepton in pt
  -1.0 = ptl4max ! maximum pt for the fourth lepton in pt
#*********************************************************************
# Control the Ht(k)=Sum of k leading jets *
#*********************************************************************
  0.0 = htjmin ! minimum jet HT=Sum(jet pt)
  -1.0 = htjmax ! maximum jet HT=Sum(jet pt)
  0.0 = ihtmin !inclusive Ht for all partons (including b)
  -1.0 = ihtmax !inclusive Ht for all partons (including b)
  0.0 = ht2min ! minimum Ht for the two leading jets
  0.0 = ht3min ! minimum Ht for the three leading jets
  0.0 = ht4min ! minimum Ht for the four leading jets
  -1.0 = ht2max ! maximum Ht for the two leading jets
  -1.0 = ht3max ! maximum Ht for the three leading jets
  -1.0 = ht4max ! maximum Ht for the four leading jets
#***********************************************************************
# Photon-isolation cuts, according to hep-ph/9801442 *
# When ptgmin=0, all the other parameters are ignored *
# When ptgmin>0, pta and draj are not going to be used *
#***********************************************************************
  0.0 = ptgmin ! Min photon transverse momentum
  0.4 = r0gamma ! Radius of isolation code
  1.0 = xn ! n parameter of eq.(3.4) in hep-ph/9801442
  1.0 = epsgamma ! epsilon_gamma parameter of eq.(3.4) in hep-ph/9801442
  True = isoem ! isolate photons from EM energy (photons and leptons)
#*********************************************************************
# WBF cuts *
#*********************************************************************
  0.0 = xetamin ! minimum rapidity for two jets in the WBF case
  -1.0 = deltaeta ! minimum rapidity for two jets in the WBF case
#***********************************************************************
# Turn on either the ktdurham or ptlund cut to activate *
# CKKW(L) merging with Pythia8 [arXiv:1410.3012, arXiv:1109.4829] *
#***********************************************************************
  0.0 = ktdurham
  0.0 = dparameter
  0.0 = ptlund
  1, 2, 3, 4, 5, 6, 21, 82 = pdgs_for_merging_cut ! PDGs for two cuts above
#*********************************************************************
# 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 *
#*********************************************************************
  False = 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
# Syscalc is deprecated but to see the associate options type'update syscalc'#*********************************************************************
# Additional hidden parameters
#*********************************************************************
  ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments # Choose the argment to pass to the systematics command. like --mur=0.25,1,4. Look at the help of the systematics function for more details.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2020-09-01
Last query:
2020-09-01
Last reply:
2020-09-01

This question was reopened

Sihyun Jeon (shjeon) said : #1

Hi,

copy paste mistake made in MadSpin card

Defined multiparticle ell+ = e+ mu+ ta+
Defined multiparticle ell- = e- mu- ta-

These 2 should be removed!

Sihyun Jeon (shjeon) said : #2

I think I found the origin of the problem?

 set ms_dir ./madspingrid

by removing this line it worked

The option is valid (and makes sense with gridpack), but this sounds an old bug that has been fixed a while ago.

Cheers,

Olivier

Sihyun Jeon (shjeon) said : #4

Could you tell me in which version of MadGraph was this fixed?

I am currently using 265 (it's also CMS nominal version currently)

I think you need 2.7.3

Cheers,

Olivier

> On 6 Aug 2020, at 20:35, Sihyun Jeon <email address hidden> wrote:
>
> Question #692250 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692250
>
> Status: Answered => Open
>
> Sihyun Jeon is still having a problem:
> Could you tell me in which version of MadGraph was this fixed?
>
> I am currently using 265 (it's also CMS nominal version currently)
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Sihyun Jeon (shjeon) said : #6

Ahhh,,,
hmm then can you provide the patches for the fixes made in MGv273?
Currently CMS still sticks to MGv265, and although there are some workings going on to move up to newer release of MG, I am not really sure when this would happen.

Best regards,
Sihyun.

I guess that you need all those ones:

https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/290
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/293 <https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/293>
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/296 <https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/296>
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/307
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/317
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/318 <https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/318>

But I might miss some others since this assumes that no patch are needed before 2.7.2

Cheers,

Olivier

> On 6 Aug 2020, at 20:45, Sihyun Jeon <email address hidden> wrote:
>
> Question #692250 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692250
>
> Status: Answered => Open
>
> Sihyun Jeon is still having a problem:
> Ahhh,,,
> hmm then can you provide the patches for the fixes made in MGv273?
> Currently CMS still sticks to MGv265, and although there are some workings going on to move up to newer release of MG, I am not really sure when this would happen.
>
> Best regards,
> Sihyun.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Sihyun Jeon (shjeon) said : #8

Dear Olivier,

Thanks for the links!

Sihyun Jeon (shjeon) said : #9

Hi Olivier,

I tested MGv273 with CMS-specific settings and the gridpacks were made, which failed before during MadSpin.
However the event generation using CMS-gridpack still failed.

So this time I tested with standalone MGv273 with "gridpack = True" and "set ms_dir ./madspingrid".
I was able to make the gridpack so I tried event generation.
But as you can see it again failed with similar (or possibly the same) error.
Could you take a look?

[shjeon@cms2 yiwenwen]$ ./run.sh 10 1
Now generating 10 events with random seed 1 and granularity 1
WRITE GRIDCARD /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent
P0_gg_h3
Now generating 12 events with random seed None and granularity 1
WRITE GRIDCARD /data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent/madspingrid/decay_36_0/madevent
Traceback (most recent call last):
  File "./madevent/bin/gridrun", line 86, in <module>
    cmd_line = cmd_interface.GridPackCmd(me_dir=root_path, nb_event=args[0], seed=args[1], gran=args[2])
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent/madspingrid/decay_36_0/madevent/bin/internal/madevent_interface.py", line 6413, in __init__
    self.write_gridcard(nb_event, seed, gran) # set readonly on True if needed
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent/madspingrid/decay_36_0/madevent/bin/internal/madevent_interface.py", line 6464, in write_gridcard
    gridpackcard['gseed'] = seed
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent/madspingrid/decay_36_0/madevent/bin/internal/banner.py", line 1210, in __setitem__
    value = self.format_variable(value, targettype, name=name)
  File "/data9/Users/shjeon/MadGraph/CMSSW_9_3_16/src/MG5_aMC_v2_7_3/yiwenwen/madevent/madspingrid/decay_36_0/madevent/bin/internal/banner.py", line 1376, in format_variable
    raise InvalidCmd, "%s can not be mapped to an integer" % value
internal.InvalidCmd: None can not be mapped to an integer
mv: cannot stat `./Events/GridRun_None/unweighted_events.lhe.gz': No such file or directory
write ./events.lhe.gz
DONE
mv: cannot stat `./Events/GridRun_1/unweighted_events.lhe.gz': No such file or directory
write ./events.lhe.gz

Hi,

Sorry for the long time for this answer.
Here is the patch:
=== modified file 'MadSpin/interface_madspin.py'
--- MadSpin/interface_madspin.py 2020-06-30 10:15:11 +0000
+++ MadSpin/interface_madspin.py 2020-08-16 19:59:28 +0000
@@ -1307,6 +1307,15 @@
                 me5_cmd.exec_cmd("exit")
                 out[i] = lhe_parser.EventFile(pjoin(decay_dir, "Events", 'run_01', 'unweighted_events.lhe.gz'))
             else:
+ if not self.seed:
+ if hasattr(self, 'mother'):
+ try:
+ self.seed = 100 + self.mother.run_card['iseed']
+ except:
+ self.seed = random.randint(0, int(30081*30081))
+ if self.seed > 30081*30081:
+ self.seed -= 30081*30081
+ logger.info('Will use seed %s' % (self.seed))
                 misc.call(['run.sh', str(int(1.2*nb_event)), str(self.seed)], cwd=decay_dir)
                 out[i] = lhe_parser.EventFile(pjoin(decay_dir, 'events.lhe.gz'))
             if cumul:

=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2020-06-30 10:15:11 +0000
+++ madgraph/interface/common_run_interface.py 2020-08-16 19:46:29 +0000
@@ -3697,6 +3697,7 @@
             if isinstance(value, str):
                 madspin_cmd.mg5cmd.exec_cmd( 'set %s %s --no_save' %(key,value), errorhandling=False, printcmd=False, precmd=False, postcmd=True)
         madspin_cmd.cluster = self.cluster
+ madspin_cmd.mother = self

         madspin_cmd.update_status = lambda *x,**opt: self.update_status(*x, level='madspin',**opt)

They are indeed a weird combination of setup when you use a gridpack in spinmode none, which itself genrates a gridpack for the decay. One big issue is the handling of the seed. The best (to my point of view) would be to set that second seed to a full random value (you can do that by setting in the madspin_card --set seed 0--) otherwise we will use a value of seed connected to your choice of seed. I personally prefer fully random seed since this forbids any type of possible of bias but this breaks reproducibility.

Cheers,

Olivier

Sihyun Jeon (shjeon) said : #11

Hi Olivier,

It worked but one funny thing happened.
Updating these two [1] worked for MGv273.
Then I also tested in MGv265 with [2] did not work.
But when applying the two patches for MGv273 [1] to MGv265 without [2] worked and was able to make the LHE files.

Do you think this make sense?

[1]
 --- MadSpin/interface_madspin.py 2020-06-30 10:15:11 +0000
+++ MadSpin/interface_madspin.py 2020-08-16 19:59:28 +0000
 --- madgraph/interface/common_run_interface.py 2020-06-30 10:15:11 +0000
+++ madgraph/interface/common_run_interface.py 2020-08-16 19:46:29 +0000

[2]
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/290
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/293
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/296
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/307
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/317
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/318

I guess it does.
You never know what will happen when you cherry-pick patch (in top of that you can always miss one of the patch which is relevant).

Note that 2.8.0 is now released with that fixed included.

Cheers,

Olivier

Sihyun Jeon (shjeon) said : #13

Thanks Olivier Mattelaer, that solved my question.