Parton shower for NLO processes

Asked by Rishabh Jain

Hi,

I am trying to parton shower NLO events with pythia8 and am getting a segmentation error. The showering works fine with LO events.

Here is the error message:

INFO: Events generated
reweight -from_cards
decay_events -from_cards
INFO: Preparing MCatNLO run
INFO: Using LHAPDF v6.5.4 interface for PDFs
INFO: Compiling MCatNLO for PYTHIA8...
INFO: ... done
INFO: Showering events...
INFO: (Running in /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/MCatNLO/RUN_PYTHIA8_1)
INFO: Idle: 1, Running: 0, Completed: 0 [ current time: 21h50 ]
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/MCatNLO/RUN_PYTHIA8_1/shower.sh: line 44: 3381886 Segmentation fault (core dumped) ./Pythia8.exe Pythia8.cmd > mcatnlo_run.log 2>&1
mv: cannot stat 'Pythia8.hep': No such file or directory
gzip: events.hepmc: No such file or directory
INFO: Idle: 0, Running: 0, Completed: 1 [ 0.1s ]
Error detected in "launch auto "
write debug file /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/run_01_tag_1_debug.log
If you need help with this issue, please, contact us on https://answers.launchpad.net/mg5amcnlo
str : No file has been generated, an error occurred. More information in /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/amcatnlo_run.log

I think part of the issue might be that pythia is looking for an events.hepmc file but madgraph generates a events.lhe file, which is why there is an error with gzip.
Here is the error log:

  127 | struct _GLIBCXX17_DEPRECATED iterator
      | ^~~~~~~~
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/hepmc/include/HepMC/GenEvent.h:335:23: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  335 | public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{ | ^~~~~~~~ /cvmfs/sft.cern.ch/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here 127 | struct _GLIBCXX17_DEPRECATED iterator
      | ^~~~~~~~
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/hepmc/include/HepMC/GenEvent.h:392:23: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  392 | public std::iterator<std::forward_iterator_tag,HepMC::GenVertex*,ptrdiff_t>{
      | ^~~~~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here 127 | struct _GLIBCXX17_DEPRECATED iterator
      | ^~~~~~~~
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/hepmc/include/HepMC/GenEvent.h:465:23: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  465 | public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
      | ^~~~~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 | struct _GLIBCXX17_DEPRECATED iterator
      | ^~~~~~~~
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/hepmc/include/HepMC/GenEvent.h:521:23: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
  521 | public std::iterator<std::forward_iterator_tag,HepMC::GenParticle*,ptrdiff_t>{
      | ^~~~~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~

***** Now ready for showering 10000 events with PYTHIA8

Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 612: [: =: unary operator expected
Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 623: [: =: unary operator expected
Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 634: [: =: unary operator expected Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 645: [: =: unary operator expected

Please let me know if there is a way to resolve this.

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
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

pythia8 does look for an lhef file, and the output of the pythia8 code should be an hepmc file.
Since pytin8 crashes, they are not hepmc generated and the gzip fails.

So I guess that the real error occurs in the script
Scripts/MCatNLO_MadFKS_PYTHIA8.Script
where it seems that you have three undefined variable:
the first one being:
$space_shower_me_corrections

So now the question is ... why.

Can you provide your shower_card? Such that I can have a look if this is related or not.

Revision history for this message
Rishabh Jain (rishabh-jain) said :
#2

Hello,

Here is the shower card.

#***********************************************************************
# MadGraph5_aMC@NLO *
# *
# shower_card.dat aMC@NLO *
# *
# This file is used to set the parameters for the shower. * # *
# Some notation/conventions: *
# *
# Lines starting with a hash (#) are info or comments *
# *
# mind the format: variable = value # comment *
#***********************************************************************
#
#***********************************************************************
# Shower settings *
#***********************************************************************
# Number of events, jobs, errors, and random seeds *
#***********************************************************************
nevents = -1 # N evts to shower (< 0 = all)
nsplit_jobs = 1 # N jobs to run in parallel (< 100!!)
combine_td = T # combine the topdrawer/HwU files if nsplit_jobs>1
maxprint = 2 # N evts to print in the log
maxerrs = 0.1 # max fraction of errors
rnd_seed = 0 # 1st random seed (0 = default)
rnd_seed2 = 0 # 2nd random seed (0 = default) !ONLY FOR HWERIG6!
#***********************************************************************
# PDFs and non-perturbative modelling *
#***********************************************************************
pdfcode = 1 # 0 = internal, 1 = same as NLO, other = lhaglue
ue_enabled = F # underlying event
hadronize = T # hadronisation on/off !IGNORED BY HERWIG6! lambda_5 = -1.0 # Lambda_5 (< 0 = default) !IGNORED BY PYTHIA8! #***********************************************************************
# Stable or unstable particles *
#***********************************************************************
b_stable = F # set B hadrons stable
pi_stable = T # set pi0's stable
wp_stable = F # set w+'s stable
wm_stable = F # set w-'s stable
z_stable = F # set z0's stable
h_stable = F # set Higgs' stable
tap_stable = F # set tau+'s stable
tam_stable = F # set tau-'s stable
mup_stable = F # set mu+'s stable
mum_stable = F # set mu-'s stable
#***********************************************************************
# Mass of the b quark *
#***********************************************************************
b_mass = -1.0 # if < 0 = read from SubProcesses/MCmasses_*.inc
#***********************************************************************
# Special settings *
#***********************************************************************
is_4lep = F # T if 4-lepton production !ONLY FOR PYTHIA6!
is_bbar = F # T if bb~ production !ONLY FOR HERWIG6!
#***********************************************************************
# Pythia8 Specific Options (FxFx and advanced options)
#***********************************************************************
Qcut = -1.0 # Merging scale for FxFx njmax = -1 # Maximal multiplicity in the merging (fxFx).
# # -1 means guessed from the process definition
qed_shower = T # T = enable QED shower for Q and L
primordialkt = F # T = enable primordial parton k_T
pythia8_options = {} # Dictionary specifying any additional entry in the pythia8 command file
                       # Warning changing some parameter will break NLO accuracy.
#***********************************************************************
# Matrix-element corrections !ONLY FOR PYTHIA8!
#***********************************************************************
space_shower_me_corrections = F # MECs for ISR
time_shower_me_corrections = T # MECs for FSR
time_shower_me_extended = F # see Pythia8 manual as well as
time_shower_me_after_first = F # hep-ph/2308.06389 for details
#***********************************************************************
# Decay channels *
#***********************************************************************
# Syntax for HERWIG6 *
# DM_I = M > D1 D2 @ BR @ ME *
# corresponding to call to HWMODK(M,BR,ME,D1,D2) *
# I < 100, M is the decaying resonance, D1, D2, ... are the decay *
# products (up to five), BR is the branching ratio and ME is the type *
# of matrix element to be used in the decay. *
# BR's are correctly understood only if they add up to 1, and only if *
# no more than three modes are required for a given resonance. *
# WARNING: the order of decay products in > 2-body decays IS RELEVANT. *
# *
# Syntax for PYTHIA6 *
# DM_I = M > D1 D2 @ BR @ ME *
# WARNING: turning hadronisation off disables top decays *
# WARNING: 1 -> n decays (with n > 2) are handled through a sequence *
# of 1 -> 2 decays. *
# WARNING: entries BR and ME are ignored *
# *
# Syntax for HERWIG++ *
# DM_I = M > D1 D2 @ BR @ ME *
# WARNING: entries BR and ME are ignored *
# *
# Syntax for PYTHIA8 *
# DM_I = M:onIfAny = D1 D2 *
# or similar, according to the offical PYTHIA8 decay syntax, see *
# the online PYTHIA8 manual *
# WARNING: 1 -> n decays (with n > 2) are handled through a sequence *
# of 1 -> 2 decays. *
# *
# Examples *
# Z -> e+ e- or mu+ mu- with BR = 0.5 each, HERWIG6 *
# DM_1 = 23 > -11 11 @ 0.5d0 @ 100
# DM_2 = 23 > -13 13 @ 0.5d0 @ 100
# H -> ta+ ta- with BR = 1, HERWIG6 or HERWIG++ *
# DM_3 = 25 > -15 15 @ 1.0d0 @ 0
# t -> ve e+ b with BR = 1, HERWIG6 or HERWIG++ * # DM_4 = 6 > 12 -11 5 @ 1d0 @ 100 # t -> ve e+ b with BR = 1, PYTHIA6 *
# DM_5 = 6 > 24 5 @ 1d0 @ 100
# DM_6 = 24 > 12 -11 @ 1d0 @ 100
# W+ -> ve e+, W- -> vm~ mu-, PYTHIA8 *
# DM_1 = 24:onMode = off
# DM_2 = 24:onPosIfAny = 11 12
# DM_3 = 24:onNegIfAny = 13 14
# W+ -> ve e+, W- -> ve~ e- and vm~ mu-, PYTHIA8 *
# DM_1 = 24:onMode = off
# DM_2 = 24:onIfAny = 11 12
# DM_3 = 24:onNegIfAny = 13 14
#***********************************************************************
# Extra libraries/analyses *
#***********************************************************************
# The following lines need to be changed if the user does not want to *
# create a StdHEP/HepMC file, but to directly run an own analysis (to *
# be placed in HWAnalyzer or analogous MCatNLO subfolders). *
# Please use files in those folders as examples. *
# Remember that if your analysis uses hbook or is in the HwU format, *
# you must also add to hbook.o or HwU.o to the ANALYSE list as well. *
#***********************************************************************
EXTRALIBS = pythia8 z dl stdc++ # Extra-libraries (not LHAPDF)
                                 # Default: "stdhep Fmcfio"
                                 # PYTHIA > 8.200 may require library dl
EXTRAPATHS = ../lib /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/pythia8/lib l,-rpath,/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/pythia8/lib /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/zlib/lib l,-rpath,/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/zlib/lib # Path to the extra-libraries
                                 # Default: "../lib"
INCLUDEPATHS = # Path to header files needed by c++
                                 # Dir names separated by white spaces
ANALYSE = # User's analysis and histogramming
                                 # routines (please use .o as extension
                                 # and use spaces to separate files).
                                 # If the HwU.o files has to be linked,
                                 # it should be put *first*.

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

Hi,

Sorry quite busy days for the moment, so I'm quite slow.
Could you also attach the file
MCatNLO/shower_card.dat

This is a file that should have been created from the previous file (where everything is fine). My guess is that such file is corrupted.

For the moment, I still have close to no clue what the issue is but I think I'm closing the gap of where the issue is.

Thanks for your patience,

Olivier

Revision history for this message
Rishabh Jain (rishabh-jain) said :
#4

Hello,

Here is that file.

NEVENTS=-1
MAXPR_PY8=2
ERR_FR_PY8=0.100
RNDEVSEED_PY8=0
PDFCODE=1
UE_PY8=.FALSE.
HADRONIZE_PY8=.TRUE.
LAMBDAPYTH=-1.000
B_STABLE_PY8=.FALSE.
PI_STABLE_PY8=.TRUE.
WP_STABLE_PY8=.FALSE.
WM_STABLE_PY8=.FALSE.
Z_STABLE_PY8=.FALSE.
H_STABLE_PY8=.FALSE.
TAUP_STABLE_PY8=.FALSE.
TAUM_STABLE_PY8=.FALSE.
MUP_STABLE_PY8=.FALSE.
MUM_STABLE_PY8=.FALSE.
B_MASS=-1.000
QCUT=-1.000
NJMAX=-1
EXTRALIBS="pythia8 z dl stdc++"
EXTRAPATHS="../lib /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/pythia8/lib l,-rpath,/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/pythia8/lib /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/zlib/lib l,-rpath,/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/HEPTools/zlib/lib"
INCLUDEPATHS=
PY8UTI=""
QED_SHOWER=.TRUE.
PRIMORDIALKT=.FALSE.
SPACE_SHOWER_ME_CORRECTIONS=.FALSE.
TIME_SHOWER_ME_CORRECTIONS=.TRUE.
TIME_SHOWER_ME_EXTENDED=.FALSE.
TIME_SHOWER_ME_AFTER_FIRST=.FALSE.
EXTRA_LINE=""

Revision history for this message
Rishabh Jain (rishabh-jain) said :
#5

Hello,

I have spent a few days trying to figure this out and here are my thoughts. I think there is problem with Pythia8.exe in /MCatNLO/RUN_PYTHIA8_1. This is because from the shower.sh program, the Pythia executable is supposed to run and put results in a file called mcatnlo_run.log:

elif [ "$SHOWER" == "PYTHIA8" ] ; then
    if [ -f config.sh ] ; then source config.sh ; fi
    ./Pythia8.exe Pythia8.cmd > mcatnlo_run.log 2>&1
fi

When I open this file, I see that it is completely empty meaning that Pythia.exe itself is not working. This might be what is causing the other problems as well. Now the question is why isn't Pythia working? Is there something missing in my initial setup? I am currently using CERN's LCG release version 105a, which in theory should contain all the packages I need. Any help would be much appreciated.

Thanks

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

My current approach for your issue is to understand how you can get the following error:
Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line : [: =: unary operator expected
Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 623: [: =: unary operator expected
Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 634: [: =: unary operator expected Scripts/MCatNLO_MadFKS_PYTHIA8.Script: line 645: [: =: unary operator expected

So If I look at those lines, I do have the following:
 if [ $space_shower_me_corrections = ".TRUE." ]
 then
 cat <<EOF >> $ifile

The issue seems to occur because the variable space_shower_me_corrections is simply not set (or empty). (I confirmed that statement by copilot chat).

What I just realised (thanks to copilot, I missed such point) is that your file MCatNLO/shower_card.dat
defines such variable but with upper case and not in lower case.

I'm checking now such point to see if the issue is with the file MCatNLO/shower_card.dat or with the code itself...
(and why I do not face such issue)

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#7
Revision history for this message
Rishabh Jain (rishabh-jain) said :
#8

Hi,

Even after making the script change I get the same error message:

INFO: Events generated
reweight -from_cards
decay_events -from_cards
INFO: Preparing MCatNLO run
INFO: Using LHAPDF v6.5.4 interface for PDFs
INFO: Compiling MCatNLO for PYTHIA8...
INFO: ... done
INFO: Showering events...
INFO: (Running in /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/MCatNLO/RUN_PYTHIA8_2)
INFO: Idle: 1, Running: 0, Completed: 0 [ current time: 18h15 ]
/afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/MCatNLO/RUN_PYTHIA8_2/shower.sh: line 44: 1668107 Segmentation fault (core dumped) ./Pythia8.exe Pythia8.cmd > mcatnlo_run.log 2>&1
mv: cannot stat 'Pythia8.hep': No such file or directory
gzip: events.hepmc: No such file or directory
INFO: Idle: 0, Running: 0, Completed: 1 [ 0.16s ]
Error detected in "launch auto "
write debug file /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/ppzj_pythiashower/run_02_tag_1_debug.log
If you need help with this issue, please, contact us on https://answers.launchpad.net/mg5amcnlo
str : No file has been generated, an error occurred. More information in /afs/cern.ch/user/r/rijain/MG5_aMC_v3_5_6/amcatnlo_run.log

I still think the root issue is that the Pythia8.exe executable is failing (this is the error in line 44 of shower.sh). This might be because of issues with package versions or mismatched pathing but I am really not sure.

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

Did you regenerate the directory ppzj_pythiashower?
Or did you change the copy of the file inside that directory?

If you say no to both question, then they are still hope.

The issue is that pythia8.exe is a pythia8 code on which I can not help (first and foremost because my C++ level is super low and second I do not know enough details on their algorithm/implementation). So I really hope that this the above script issue.
If not, I would suggest to instally pythia8 outside of MG5aMC code and run it on the associated events, if you do reproduce the error, then you can create a bug report to pythia8 author and they will be able to help you on it.

Cheers,

Olivier

Revision history for this message
Rishabh Jain (rishabh-jain) said :
#10

I changed the Script file that was already in the ppzj_pythiashower directory then ran that same directory again. These are the commands (after finishing the Script file edit):

./bin/mg5_aMC

launch ./ppzj_pythiashower

Can you help with this problem?

Provide an answer of your own, or ask Rishabh Jain for more information if necessary.

To post a message you must log in.