Dear Experts,

Asked by wanghan

Dear Experts,
When I did the simulation at the ep colliders with the new physics model, I found that I lost a lot of events when I used Pythia. About half the events were left, and the hepmc file size was reduced. As the mass of the new particle increases, the number of generated events gets less and less.

I get the following error:
PYTHIA Abort from Pythia::next: processLevel failed; giving up

 Pythia::next(): 1000 events have been generated

 Pythia::next(): 2000 events have been generated

 Pythia::next(): 3000 events have been generated
 PYTHIA Warning in Pythia::check: energy-momentum not quite conserved

 Pythia::next(): 4000 events have been generated

 Pythia::next(): 5000 events have been generated

 Pythia::next(): 6000 events have been generated

 Pythia::next(): 7000 events have been generated
 PYTHIA Warning in SimpleSpaceShower::pT2nextQCD: weight above unity

 Pythia::next(): 8000 events have been generated

 Pythia::next(): 9000 events have been generated

 Pythia::next(): 10000 events have been generated

 Pythia::next(): 11000 events have been generated

 Pythia::next(): 12000 events have been generated

 Pythia::next(): 13000 events have been generated
 PYTHIA Abort from Pythia::next: reached end of Les Houches Events File
WARNING in MG5aMC_PY8_interface.cc: Reached end of LHEF after 24999 Normalisation will be decreased by-0.004%.

 *------- PYTHIA Event and Cross Section Statistics -------------------------------------------------------------*
 | |
 | Subprocess Code | Number of events | sigma +- delta |
 | | Tried Selected Accepted | (estimated) (mb) |
 | | | |
 |-----------------------------------------------------------------------------------------------------------------|
 | | | |
 | Les Houches User Process(es) 9999 | 25000 25000 13276 | 4.122e-17 0.000e+00 |
 | ... whereof user classification code 1 | 25000 25000 13276 | |
 | | | |
 | sum | 25000 25000 13276 | 4.122e-17 0.000e+00 |
 | |
 *------- End PYTHIA Event and Cross Section Statistics ----------------------------------------------------------*

 *------- PYTHIA Error and Warning Messages Statistics ----------------------------------------------------------*
 | |
 | times message |
 | |
 | 341 Abort from Pythia::next: processLevel failed; giving up |
 | 1 Abort from Pythia::next: reached end of Les Houches Events File |
 | 11724 Error in ProcessContainer::constructProcess: setting mass failed |
 | 1 Info from Pythia::init: be aware that successive calls to init() do not clear previous settings. |
 | 2 Info from SLHAinterface::initSLHA: No MODSEL found, keeping internal SUSY switched off |
 | 2 Info from SLHAinterface::initSLHA: importing DECAY tables |
 | 2 Info from SLHAinterface::initSLHA: importing MASS entries |
 | 2 Warning in Pythia::check: energy-momentum not quite conserved |
 | 2 Warning in SLHAinterface::initSLHA: ignoring DECAY tables |
 | 2 Warning in SLHAinterface::initSLHA: ignoring MASS entries |
 | 1 Warning in SLHAinterface::initSLHA: ignoring QNUMBERS |
 | 2 Warning in SLHAinterface::initSLHA: ignoring empty DECAY tables |
 | 2 Warning in SimpleSpaceShower::pT2nextQCD: weight above unity |
 | |
 *------- End PYTHIA Error and Warning Messages Statistics ------------------------------------------------------*

What is the reason? Any idea what is causing this?
Thanks!

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

Looks like the main problem is with:

  | 11724 Error in ProcessContainer::constructProcess: setting mass failed |

Since I'm not a pythia expert, I can not really comment more. Maybe a missmatch between the mass between the two code?
Or did you set bwcutoff too large? This will lead to particle information written in the lhef that might (I guess) also create mass issue.
But within any information on your process, I cannot say more...

Cheers,

Olivier

Revision history for this message
wanghan (wangwanghan) said :
#2

Hi Olivier,

Thanks for your comments. I will describe my process in detail.
The version of madgraph I use is version 3.1.0, and the version of pythia is pythia8306.
I am studying e- p > ve a a j process using a new physics model of axion-like particles.(http://feynrules.irmp.ucl.ac.be/attachment/wiki/ALPsEFT/ALP_linear_UFO.tar.gz)
I have set the parameter CWtil equals to CBtil in the model file. I also found that about half of the events were left for the signal, and all the events were left for the background.
I have no idea what's wrong, could you please help me with that?
Thanks!

The script I use is as follows:

import model ALP_linearfusion_UFO

generate e- p > ve a a j NP=2 QED=2

###########################################################################
#display diagrams
output LHeC_ma100
###########################################################################

launch
shower=Pythia8
detector=Delphes
analysis=OFF
0

###########################################################################
set CWtil = 0.25
set Ma = 100
set WALP = Auto
###########################################################################

set lpp1 0
set lpp2 1
set ebeam1 60
set ebeam2 7000
set nevents 200000

#########################################################################

/home/b804-03/下载/MG5_aMC_v3_1_0/Delphes/cards/delphes_card_LHeC.tcl

#########################################################################

0

The banner file is as follows:
<LesHouchesEvents version="3.0">
<header>
<!--
#*********************************************************************
# *
# MadGraph5_aMC@NLO *
# *
# Going Beyond *
# *
# http://madgraph.hep.uiuc.edu *
# http://madgraph.phys.ucl.ac.be *
# http://amcatnlo.cern.ch *
# *
# The MadGraph5_aMC@NLO team *
# *
#....................................................................*
# *
# This file contains all the information necessary to reproduce *
# the events generated: *
# *
# 1. software version *
# 2. proc_card : code generation info including model *
# 3. param_card : model primary parameters in the LH format *
# 4. run_card : running parameters (collider and cuts) *
# 5. pythia_card : present only if pythia has been run *
# 6. pgs_card : present only if pgs has been run *
# 7. delphes_cards : present only if delphes has been run *
# *
# *
#*********************************************************************
-->
<MGVersion>
3.1.0
</MGVersion>
<MG5ProcCard>
<![CDATA[
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.1.0 2021-03-30 *
#* *
#* 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 ALP_linearfusion_UFO
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~
generate e- p > ve a a j NP=2 QED=2
output LHeC_ma100
]]>
</MG5ProcCard>
<MGProcCard>
#*********************************************************************
# MadGraph/MadEvent *
# http://madgraph.hep.uiuc.edu *
# *
# proc_card.dat *
#*********************************************************************
# *
# This Files is generated by MADGRAPH 5 *
# *
# WARNING: This Files is generated for MADEVENT (compatibility issue)*
# This files is NOT a valid MG4 proc_card.dat *
# Running this in MG4 will NEVER reproduce the result of MG5*
# *
#*********************************************************************
#*********************************************************************
# Process(es) requested : mg2 input *
#*********************************************************************
# Begin PROCESS # This is TAG. Do not modify this line
e- p > ve a a j #Process
# Be carefull the coupling are here in MG5 convention
NP=2
QED=2

end_coup # End the couplings input

done # this tells MG there are no more procs
# End PROCESS # This is TAG. Do not modify this line
#*********************************************************************
# Model information *
#*********************************************************************
# Begin MODEL # This is TAG. Do not modify this line
ALP_linearfusion_UFO
# End MODEL # This is TAG. Do not modify this line
#*********************************************************************
# Start multiparticle definitions *
#*********************************************************************
# Begin MULTIPARTICLES # This is TAG. Do not modify this line

# End MULTIPARTICLES # This is TAG. Do not modify this line
</MGProcCard>
<MGRunCard>
<![CDATA[
#*********************************************************************
# 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 *
#*********************************************************************
  200000 = nevents ! Number of unweighted events requested
 21 = 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, 4=photon from muon *
#*********************************************************************
  0 = lpp1 ! beam 1 type
  1 = lpp2 ! beam 2 type
  60.0 = ebeam1 ! beam 1 total energy in GeV
  7000.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 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)
  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)
#*********************************************************************
  0 = 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 *
#*******************************
#
#
#*********************************************************************
# 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) *
#*********************************************************************
  20.0 = ptj ! minimum pt for the jets
  10.0 = pta ! minimum pt for the photons
  0.0 = misset ! minimum missing Et (sum of neutrino's momenta)
  -1.0 = ptjmax ! maximum pt for the jets
  -1.0 = ptamax ! maximum pt for the photons
  -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})
#
# 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) *
#*********************************************************************
  5.0 = etaj ! max rap for the jets
  2.5 = etaa ! max rap for the photons
  0.0 = etajmin ! min rap for the jets
  0.0 = etaamin ! min rap for the photons
  {} = 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.4 = draa ! min distance between gammas
  0.4 = draj ! min distance between gamma and jet
  -1.0 = draamax ! max distance between gammas
  -1.0 = drajmax ! max distance between gamma and jet
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
#*********************************************************************
  0.0 = mmaa ! min invariant mass of gamma gamma pair
  -1.0 = mmaamax ! max invariant mass of gamma gamma 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.
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
  0.0 = xpta ! minimum pt for at least one photon
 #***********************************************************************
 # 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)
#*********************************************************************
# 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
# Syscalc is deprecated but to see the associate options type'update syscalc'
]]>
</MGRunCard>
<slha>
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 ####
######################################################################
###################################
## INFORMATION FOR ALPPARS
###################################
BLOCK ALPPARS #
      1 1.000000e+03 # fa
      2 2.500000e-01 # cwtil
###################################
## INFORMATION FOR CKMBLOCK
###################################
BLOCK CKMBLOCK #
      1 2.277360e-01 # cabi
###################################
## INFORMATION FOR MASS
###################################
BLOCK MASS #
      1 5.040000e-03 # md
      2 2.550000e-03 # mu
      3 1.010000e-01 # ms
      4 1.270000e+00 # mc
      5 4.700000e+00 # mb
      6 1.720000e+02 # mt
      11 5.110000e-04 # me
      13 1.056600e-01 # mmu
      15 1.777000e+00 # mta
      23 9.118760e+01 # mz
      25 1.250000e+02 # mh
      9000005 1.000000e+02 # ma
      12 0.000000e+00 # ve : 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 7.982436e+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.279000e+02 # aewm1
      2 1.166370e-05 # gf
      3 1.184000e-01 # as (note that parameter not used if you use a pdf set)
###################################
## INFORMATION FOR YUKAWA
###################################
BLOCK YUKAWA #
      1 5.040000e-03 # ymdo
      2 2.550000e-03 # ymup
      3 1.010000e-01 # yms
      4 1.270000e+00 # ymc
      5 4.700000e+00 # ymb
      6 1.720000e+02 # ymt
      11 5.110000e-04 # yme
      13 1.056600e-01 # ymm
      15 1.777000e+00 # ymtau
###################################
## INFORMATION FOR DECAY
###################################
BLOCK QNUMBERS 9000005 # ax
      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)
#
#*************************
# Decay widths *
#*************************
#
# PDG Width
DECAY 1 0.000000e+00
#
# PDG Width
DECAY 2 0.000000e+00
#
# PDG Width
DECAY 3 0.000000e+00
#
# PDG Width
DECAY 4 0.000000e+00
#
# PDG Width
DECAY 5 0.000000e+00
#
# PDG Width
DECAY 6 1.508336e+00
#
# PDG Width
DECAY 11 0.000000e+00
#
# PDG Width
DECAY 12 0.000000e+00
#
# PDG Width
DECAY 13 0.000000e+00
#
# PDG Width
DECAY 14 0.000000e+00
#
# PDG Width
DECAY 15 0.000000e+00
#
# PDG Width
DECAY 16 0.000000e+00
#
# PDG Width
DECAY 21 0.000000e+00
#
# PDG Width
DECAY 22 0.000000e+00
#
# PDG Width
DECAY 23 2.495200e+00
#
# PDG Width
DECAY 24 2.085000e+00
#
# PDG Width
DECAY 25 4.070000e-03
#
# PDG Width
DECAY 9000005 4.973592e-03
# BR NDA ID1 ID2 ...
   1.000000e+00 2 22 22 # 0.0049735919716217296
</slha>
<MGPythiaCard>
<![CDATA[
!
! It is possible to run this card manually with:
! LD_LIBRARY_PATH=/home/b804-03/下载/MG5_aMC_v3_1_0/HEPTools/lib:$LD_LIBRARY_PATH /home/b804-03/下载/MG5_aMC_v3_1_0/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface tag_1_pythia8.cmd
!
!
! Pythia8 cmd card automatically generated by MadGraph5_aMC@NLO
! For more information on the use of the MG5aMC / Pythia8 interface, visit
! https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOPY8Merging
!
! ==================
! General parameters
! ==================
!
Main:numberOfEvents = -1
!
! -------------------------------------------------------------------
! Specify the HEPMC output of the Pythia8 shower. You can set it to:
! auto : MG5aMC will automatically place it the run_<i> directory
! autoremove: MG5aMC will automatically remove the file at the end of the run.
! (usefull when running with Delphes)
! /dev/null : to turn off the HEPMC output.
! <path> : to select where the HEPMC file must written. It will
! therefore not be placed in the run_<i> directory. The
! specified path, if not absolute, will be relative to
! the Event/run_<i> directory of the process output.
! fifo : to have MG5aMC setup the piping of the PY8 output to
! analysis tools such as MadAnalysis5.
! fifo@<fifo_path> :
! Same as 'fifo', but selecting a custom path to create the
! fifo pipe. (useful to select a mounted drive that supports
! fifo). Note that the fifo file extension *must* be '.hepmc.fifo'.
! -------------------------------------------------------------------
!
HEPMCoutput:file = tag_1_pythia8_events.hepmc
!
! --------------------------------------------------------------------
! Parameters relevant only when performing MLM merging, which can be
! turned on by setting ickkw to '1' in the run_card and chosing a
! positive value for the parameter xqcut.
! For details, see section 'Jet Matching' on the left-hand menu of
! http://home.thep.lu.se/~torbjorn/pythia81html/Welcome.html
! --------------------------------------------------------------------
! If equal to -1.0, MadGraph5_aMC@NLO will set it automatically based
! on the parameter 'xqcut' of the run_card.dat
! The following parameter was forced to be commented out by MG5aMC.
! JetMatching:qCut = -1.0
! Use default kt-MLM to match parton level jets to those produced by the
! shower. But the other Shower-kt scheme is available too with this option.
! The following parameter was forced to be commented out by MG5aMC.
! JetMatching:doShowerKt = off
! A value of -1 means that it is automatically guessed by MadGraph.
! It is however always safer to explicitly set it.
! The following parameter was forced to be commented out by MG5aMC.
! JetMatching:nJetMax = -1
!
! --------------------------------------------------------------------
! Parameters relevant only when performing CKKW-L merging, which can
! be turned on by setting the parameter 'ptlund' *or* 'ktdurham' to
! a positive value.
! For details, see section 'CKKW-L Merging' on the left-hand menu of
! http://home.thep.lu.se/~torbjorn/pythia81html/Welcome.html
! --------------------------------------------------------------------
! Central merging scale values you want to be used.
! If equal to -1.0, then MadGraph5_aMC@NLO will set this automatically
! based on the parameter 'ktdurham' of the run_card.dat
! The following parameter was forced to be commented out by MG5aMC.
! Merging:TMS = -1.0
! This must be set manually, according to Pythia8 directives.
! An example of possible value is 'pp>LEPTONS,NEUTRINOS'
! Alternatively, from Pythia v8.223 onwards, the value 'guess' can be
! used to instruct Pythia to guess the hard process. The guess would mean
! that all particles apart from light partons will be considered as a part
! of the hard process. This guess is prone to errors if the desired hard
! process is complicated (i.e. contains light partons). The user should
! then be wary of suspicious error messages in the Pythia log file.
! The following parameter was forced to be commented out by MG5aMC.
! Merging:Process = <set_by_user>
! A value of -1 means that it is automatically guessed by MadGraph.
! It is however always safer to explicitly set it.
! The following parameter was forced to be commented out by MG5aMC.
! Merging:nJetMax = -1
!
! For all merging schemes, decide whehter you want the merging scale
! variation computed for only the central weights or all other
! PDF and scale variation weights as well
SysCalc:fullCutVariation = off
!
! ==========================
! User customized parameters
! ==========================
!
! By default, Pythia8 generates multi-parton interaction events. This is
! often irrelevant for phenomenology and very slow. You can turn this
! feature off by uncommenting the line below if so desired.
!partonlevel:mpi = off
!
! Additional technical parameters set by MG5_aMC.
!
! Tell Pythia8 that an LHEF input is used.
Beams:frameType=4
! 1.0 corresponds to HEPMC weight given in [mb]. We choose here the [pb] normalization.
HEPMCoutput:scaling=1.0000000000e+09
! Be more forgiving with momentum mismatches.
Check:epTolErr=1.0000000000e-02
JetMatching:etaJetMax=1.0000000000e+03
! Specify one must read inputs from the MadGraph banner.
JetMatching:setMad=off
!
! ====================
! Subrun definitions
! ====================
!
LHEFInputs:nSubruns=1
Main:subrun=0
!
! Definition of subrun 0
!
Beams:LHEF=unweighted_events.lhe.gz
]]>
</MGPythiaCard>
<MGDelphesCard>
<![CDATA[
#######################################
# Order of execution of various modules
# 15.9.2014 try a fine granulated calorimeter for LHeC
# 0.025 in eta and phi
# 19.12.16 add paramterisations according to Peter Kostka's design
# muons not considered here - take CMS/FCC values
# without CTagging, with electrons, muons and b-tagging issues considered
# 30.1.2018 hammad add Muon Filter module
#######################################

set ExecutionPath {
  ParticlePropagator

  ChargedHadronTrackingEfficiency
  ElectronTrackingEfficiency
  MuonTrackingEfficiency

  ChargedHadronMomentumSmearing
  ElectronMomentumSmearing
  MuonMomentumSmearing

  TrackMerger
  Calorimeter
  EFlowMerger

  PhotonEfficiency
  PhotonIsolation

  ElectronFilter
  MuonFilter
  ElectronEfficiency
  ElectronIsolation

  MuonEfficiency
  MuonIsolation

  MissingET

  GenJetFinder
  FastJetFinder

  JetEnergyScale

  GenJetFlavorAssociation
  JetFlavorAssociation

  GenBTagging
  BTagging

  GenTauTagging
  TauTagging

  UniqueObjectFinder

  ScalarHT

  TreeWriter
}

# exclude since it adds also an entry to Jet->BTag
# TrackCountingBTagging

#################################
# Propagate particles in cylinder
#################################

module ParticlePropagator ParticlePropagator {
  set InputArray Delphes/stableParticles

  set OutputArray stableParticles
  set ChargedHadronOutputArray chargedHadrons
  set ElectronOutputArray electrons
  set MuonOutputArray muons

# LHeC
# radius of the magnetic field coverage, in m
  set Radius 1.14
  # half-length of the magnetic field coverage, in m
  set HalfLength 2.9

  # magnetic field
  set Bz 3.8

}

####################################
# Charged hadron tracking efficiency
####################################

module Efficiency ChargedHadronTrackingEfficiency {
  set InputArray ParticlePropagator/chargedHadrons
  set OutputArray chargedHadrons

# add EfficiencyFormula {efficiency formula as a function of eta and pt}

# tracking efficiency formula for charged hadrons
# set to 1 for full range (-0.2 eta already subtracted from edges)
  set EfficiencyFormula { ( eta <= 4.9 && eta >= -4.3) * (1.0) + \
    (eta > 4.9 || eta < -4.3 ) * (0.00)}
}
##############################
# Electron tracking efficiency
##############################

module Efficiency ElectronTrackingEfficiency {
  set InputArray ParticlePropagator/electrons
  set OutputArray electrons

  # set EfficiencyFormula {efficiency formula as a function of eta and pt}

  # tracking efficiency formula for electrons
# set to 1
  set EfficiencyFormula { ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
          ((eta > 4.9 || eta < -4.3)) * (0.00)}
 }
##########################
# Muon tracking efficiency
##########################

module Efficiency MuonTrackingEfficiency {
 set InputArray ParticlePropagator/muons
  set OutputArray muons

  # set EfficiencyFormula {efficiency formula as a function of eta and pt}

  # tracking efficiency formula for muons
# set to 1
  set EfficiencyFormula { (abs(eta) <= 4) * (1.0) + \
    (abs(eta) > 4) * (0.00)}
}

########################################
# Momentum resolution for charged tracks
########################################

module MomentumSmearing ChargedHadronMomentumSmearing {
  set InputArray ChargedHadronTrackingEfficiency/chargedHadrons
  set OutputArray chargedHadrons

  # set ResolutionFormula {resolution formula as a function of eta and pt}

  # resolution formula for charged hadrons
# taken from FCC but adjust to ep
#the abs(eta) <= 2.0 should be the "central best" and abs(eta) >
#2.0 and <= 4.9 the fwd / <= 4.3 the bwd (LHeC)
# and abs(eta) > 2.0 and <= 5.2 fwd / <= 5.0 the bwd (FCC)

  set ResolutionFormula { (abs(eta) <= 2.0) * (pt > 0.1 && pt <= 1.0) * (0.02) + \
                                           (abs(eta) <= 2.0) * (pt > 1.0 && pt <= 1.0e1) * (0.01) + \
                                           (abs(eta) <= 2.0) * (pt > 1.0e1 && pt <= 2.0e2) * (0.03) + \
                                           (abs(eta) <= 2.0) * (pt > 2.0e2) * (0.05) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 0.1 && pt <= 1.0) * (0.03) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0 && pt <= 1.0e1) * (0.02) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0e1 && pt <= 2.0e2) * (0.04) + \
                        (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 2.0e2) * (0.05)}
}

#################################
# Energy resolution for electrons
#################################

module MomentumSmearing ElectronMomentumSmearing {
  set InputArray ElectronTrackingEfficiency/electrons
  set OutputArray electrons

  # set ResolutionFormula {resolution formula as a function of eta and pt}

  # same as resolution formula for charged hadrons
# taken from FCC but adjust to ep
#the abs(eta) <= 2.0 should be the "central best" and abs(eta) >
#2.0 and <= 4.9 the fwd / <= 4.3 the bwd (LHeC)
# and abs(eta) > 2.0 and <= 5.2 fwd / <= 5.0 the bwd (FCC)

  set ResolutionFormula { (abs(eta) <= 2.0) * (pt > 0.1 && pt <= 1.0) * (0.02) + \
                                           (abs(eta) <= 2.0) * (pt > 1.0 && pt <= 1.0e1) * (0.01) + \
                                           (abs(eta) <= 2.0) * (pt > 1.0e1 && pt <= 2.0e2) * (0.03) + \
                                           (abs(eta) <= 2.0) * (pt > 2.0e2) * (0.05) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 0.1 && pt <= 1.0) * (0.03) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0 && pt <= 1.0e1) * (0.02) + \
                         (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 1.0e1 && pt <= 2.0e2) * (0.04) + \
                        (abs(eta) > 2.0 && ( eta <= 4.9 && eta >= -4.3 ) ) * (pt > 2.0e2) * (0.05)}
}

###############################
# Momentum resolution for muons
###############################

module MomentumSmearing MuonMomentumSmearing {
  set InputArray MuonTrackingEfficiency/muons
  set OutputArray muons

  # set ResolutionFormula {resolution formula as a function of eta and pt}

  # resolution formula for muons
# taken from FCC
   set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1 && pt <= 5.0) * (0.02) + \
                                           (abs(eta) <= 0.5) * (pt > 5.0 && pt <= 1.0e2) * (0.015) + \
                                           (abs(eta) <= 0.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.03) + \
                                           (abs(eta) <= 0.5) * (pt > 2.0e2) * (0.05 + pt*1.e-4) + \
                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1 && pt <= 5.0) * (0.03) + \
                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 5.0 && pt <= 1.0e2) * (0.02) + \
                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 1.0e2 && pt <= 2.0e2) * (0.04) + \
                         (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 2.0e2) * (0.05 + pt*1.e-4) + \
                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 0.1 && pt <= 5.0) * (0.04) + \
                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 5.0 && pt <= 1.0e2) * (0.035) + \
                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 1.0e2 && pt <= 2.0e2) * (0.05) + \
                         (abs(eta) > 1.5 && abs(eta) <= 4.0) * (pt > 2.0e2) * (0.05 + pt*1.e-4)}
}

##############
# Track merger
##############

module Merger TrackMerger {
# add InputArray InputArray
  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
  add InputArray ElectronMomentumSmearing/electrons
  add InputArray MuonMomentumSmearing/muons
  set OutputArray tracks
}

##################
# LHeC Calorimeter
##################

module Calorimeter Calorimeter {
  set ParticleInputArray ParticlePropagator/stableParticles
  set TrackInputArray TrackMerger/tracks

  set TowerOutputArray towers
  set PhotonOutputArray photons

  set EFlowTrackOutputArray eflowTracks
  set EFlowPhotonOutputArray eflowPhotons
  set EFlowNeutralHadronOutputArray eflowNeutralHadrons

  set pi [expr {acos(-1)}]

  # lists of the edges of each tower in eta and phi
  # each list starts with the lower edge of the first tower
  # the list ends with the higher edged of the last tower

  # use a delta_phi=0.025 for 2*phi range == 252 cells
  # use a delta_eta-0.025 for eta = -5 to 5 == 400 cells
  # Uta 22.12.16 use eta range from Peter Kostka -4.7 - 5.2
  set PhiBins {}
  for {set i -126} {$i <= 126} {incr i} {
      add PhiBins [expr {$i * $pi/126.0}]
  }
  foreach eta { -4.700 -4.675 -4.650 -4.625 -4.600 -4.575 -4.550 -4.525 -4.500 -4.475 -4.450 -4.425 -4.400 -4.375 -4.350 -4.325 -4.300 -4.275 -4.250 -4.225 -4.200 -4.175 -4.150 -4.125 -4.100 -4.075 -4.050 -4.025 -4.000 -3.975 -3.950 -3.925 -3.900 -3.875 -3.850 -3.825 -3.800 -3.775 -3.750 -3.725 -3.700 -3.675 -3.650 -3.625 -3.600 -3.575 -3.550 -3.525 -3.500 -3.475 -3.450 -3.425 -3.400 -3.375 -3.350 -3.325 -3.300 -3.275 -3.250 -3.225 -3.200 -3.175 -3.150 -3.125 -3.100 -3.075 -3.050 -3.025 -3.000 -2.975 -2.950 -2.925 -2.900 -2.875 -2.850 -2.825 -2.800 -2.775 -2.750 -2.725 -2.700 -2.675 -2.650 -2.625 -2.600 -2.575 -2.550 -2.525 -2.500 -2.475 -2.450 -2.425 -2.400 -2.375 -2.350 -2.325 -2.300 -2.275 -2.250 -2.225 -2.200 -2.175 -2.150 -2.125 -2.100 -2.075 -2.050 -2.025 -2.000 -1.975 -1.950 -1.925 -1.900 -1.875 -1.850 -1.825 -1.800 -1.775 -1.750 -1.725 -1.700 -1.675 -1.650 -1.625 -1.600 -1.575 -1.550 -1.525 -1.500 -1.475 -1.450 -1.425 -1.400 -1.375 -1.350 -1.325 -1.300 -1.275 -1.250 -1.225 -1.200 -1.175 -1.150 -1.125 -1.100 -1.075 -1.050 -1.025 -1.000 -0.975 -0.950 -0.925 -0.900 -0.875 -0.850 -0.825 -0.800 -0.775 -0.750 -0.725 -0.700 -0.675 -0.650 -0.625 -0.600 -0.575 -0.550 -0.525 -0.500 -0.475 -0.450 -0.425 -0.400 -0.375 -0.350 -0.325 -0.300 -0.275 -0.250 -0.225 -0.200 -0.175 -0.150 -0.125 -0.100 -0.075 -0.050 -0.025 0.000 0.025 0.050 0.075 0.100 0.125 0.150 0.175 0.200 0.225 0.250 0.275 0.300 0.325 0.350 0.375 0.400 0.425 0.450 0.475 0.500 0.525 0.550 0.575 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800 0.825 0.850 0.875 0.900 0.925 0.950 0.975 1.000 1.025 1.050 1.075 1.100 1.125 1.150 1.175 1.200 1.225 1.250 1.275 1.300 1.325 1.350 1.375 1.400 1.425 1.450 1.475 1.500 1.525 1.550 1.575 1.600 1.625 1.650 1.675 1.700 1.725 1.750 1.775 1.800 1.825 1.850 1.875 1.900 1.925 1.950 1.975 2.000 2.025 2.050 2.075 2.100 2.125 2.150 2.175 2.200 2.225 2.250 2.275 2.300 2.325 2.350 2.375 2.400 2.425 2.450 2.475 2.500 2.525 2.550 2.575 2.600 2.625 2.650 2.675 2.700 2.725 2.750 2.775 2.800 2.825 2.850 2.875 2.900 2.925 2.950 2.975 3.000 3.025 3.050 3.075 3.100 3.125 3.150 3.175 3.200 3.225 3.250 3.275 3.300 3.325 3.350 3.375 3.400 3.425 3.450 3.475 3.500 3.525 3.550 3.575 3.600 3.625 3.650 3.675 3.700 3.725 3.750 3.775 3.800 3.825 3.850 3.875 3.900 3.925 3.950 3.975 4.000 4.025 4.050 4.075 4.100 4.125 4.150 4.175 4.200 4.225 4.250 4.275 4.300 4.325 4.350 4.375 4.400 4.425 4.450 4.475 4.500 4.525 4.550 4.575 4.600 4.625 4.650 4.675 4.700 4.725 4.750 4.775 4.800 4.825 4.850 4.875 4.900 4.925 4.950 4.975 5.00 5.025 5.050 5.075 5.100 5.125 5.150 5.175 5.200
  } {
      add EtaPhiBins $eta $PhiBins
  }

  # default energy fractions {abs(PDG code)} {Fecal Fhcal}
  add EnergyFraction {0} {0.0 1.0}
  # energy fractions for e, gamma and pi0
  add EnergyFraction {11} {1.0 0.0}
  add EnergyFraction {22} {1.0 0.0}
  add EnergyFraction {111} {1.0 0.0}
  # energy fractions for muon, neutrinos and neutralinos
  add EnergyFraction {12} {0.0 0.0}
  add EnergyFraction {13} {0.0 0.0}
  add EnergyFraction {14} {0.0 0.0}
  add EnergyFraction {16} {0.0 0.0}
  add EnergyFraction {1000022} {0.0 0.0}
  add EnergyFraction {1000023} {0.0 0.0}
  add EnergyFraction {1000025} {0.0 0.0}
  add EnergyFraction {1000035} {0.0 0.0}
  add EnergyFraction {1000045} {0.0 0.0}
  # energy fractions for K0short and Lambda
  add EnergyFraction {310} {0.3 0.7}
  add EnergyFraction {3122} {0.3 0.7}

## no minimum p range given (Uta 22.12.16)
## sigma_E = E* (a/sqrt(E) + b) = sqrt ( E*a^2 E +E^2*b^2 )
## a = sampling term, b = constant term
# ECAL eta : 5.0 - 2.7 - -2.1 - -4.4 (subtract -0.1 in eta as safety distance to edges)
    set ECalResolutionFormula { ( eta <= 5.0 && eta > 2.7 ) * sqrt(energy*0.1^2 + energy^2*0.01^2) + \
         ( eta <=2.7 && eta >= -2.1 ) * sqrt(energy*0.09^2 + energy^2*0.02^2) + \
 ( eta < -2.1 && eta >= -4.4 ) * sqrt(energy*0.1^2 + energy^2*0.01^2) }

#### HCAL eta : 5.1 - 2.1 - -1.7 - -4.6 (subtract -0.1 in eta as safety distance to edges)
#set HCalResolutionFormula {resolution formula as a function of eta and energy}

    set HCalResolutionFormula { ( eta <= 5.1 && eta > 2.1 ) * sqrt(energy*0.4^2 + energy^2*0.02^2) + \
         ( eta <=2.1 && eta >= -1.7 ) * sqrt(energy*0.4^2 + energy^2*0.02^2) + \
 ( eta < -1.7 && eta >= -4.7 ) * sqrt(energy*0.4^2 + energy^2*0.04^2) }

}
####################
# Energy flow merger
####################

module Merger EFlowMerger {
# add InputArray InputArray
# exchange UK: 25.7.16 change back to all eflowtracks!
# add InputArray ImpactParameterSmearing/tracks
## eflowTracks kills electrons for Delphes 3.3.3 and ep??
  add InputArray Calorimeter/eflowTracks
  add InputArray Calorimeter/eflowPhotons
  add InputArray Calorimeter/eflowNeutralHadrons
  set OutputArray eflow
}

###################
# Photon efficiency
###################

module Efficiency PhotonEfficiency {
# set InputArray Calorimeter/eflowPhotons
# 21.7.16 use photons
  set InputArray Calorimeter/photons
  set OutputArray photons

  # set EfficiencyFormula {efficiency formula as a function of eta and pt}

# efficiency formula for photons - same as for electrons
# expand ad set flat
## OLD EFFICIENCY
## set EfficiencyFormula { ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
## ((eta > 4.9 || eta < -4.3)) * (0.00)}
#########################################################
# OF, 20.03.24: NEW EFFICIENCY TO AVOID SOFT PHOTONS ##
#########################################################
    set EfficiencyFormula { (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
          ((eta > 4.9 || eta < -4.3)) * (0.00)}

}

##################
# Photon isolation
##################

module Isolation PhotonIsolation {
  set CandidateInputArray PhotonEfficiency/photons
  set IsolationInputArray EFlowMerger/eflow

  set OutputArray photons

  set DeltaRMax 0.4

  set PTMin 0.5

  set PTRatioMax 0.1
}

#################
# Electron filter
#################

module PdgCodeFilter ElectronFilter {
  set InputArray Calorimeter/eflowTracks
  set OutputArray electrons
  set Invert true
    add PdgCode {11}
    add PdgCode {-11}
}

#################
# Muon filter
#################

module PdgCodeFilter MuonFilter {
  set InputArray Calorimeter/eflowTracks
  set OutputArray muons
  set Invert true
    add PdgCode {13}
    add PdgCode {-13}
}

#####################
# Electron efficiency
#####################

module Efficiency ElectronEfficiency {
  set InputArray ElectronFilter/electrons
  set OutputArray electrons

  # set EfficiencyFormula {efficiency formula as a function of eta and pt}

  # efficiency formula for electrons
    # 1 degree = eta<4.7
## OLD EFFICIENCY
## set EfficiencyFormula { ( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
## ((eta > 4.9 || eta < -4.3)) * (0.00)}
#########################################################
# OF, 20.03.24: NEW EFFICIENCY TO AVOID SOFT ELECTRONS ##
#########################################################
    set EfficiencyFormula { (pt <= 0.5) * (0.00) + (pt > 0.5) *( (eta <=4.9 && eta >= -4.3) ) * (1.0) + \
          ((eta > 4.9 || eta < -4.3)) * (0.00)}

}

####################
# Electron isolation
####################

module Isolation ElectronIsolation {
  set CandidateInputArray ElectronEfficiency/electrons
  set IsolationInputArray EFlowMerger/eflow

  set OutputArray electrons

  set DeltaRMax 0.4

  set PTMin 0.5

  set PTRatioMax 0.1
}

#################
# Muon efficiency
#################

module Efficiency MuonEfficiency {
  set InputArray MuonMomentumSmearing/muons
 set InputArray MuonFilter/muons
  set OutputArray muons

  # set EfficiencyFormula {efficiency as a function of eta and pt}

  # efficiency formula for muons
# set to 1 for |eta|<4
  set EfficiencyFormula { (abs(eta) <= 4) * (1.0) + \
                         (abs(eta) > 4) * (0.00)}
}

################
# Muon isolation
################

module Isolation MuonIsolation {
  set CandidateInputArray MuonEfficiency/muons
  set IsolationInputArray EFlowMerger/eflow

  set OutputArray muons

  set DeltaRMax 0.4

  set PTMin 0.5

  set PTRatioMax 0.1
}

###################
# Missing ET merger
###################

module Merger MissingET {
# add InputArray InputArray
  add InputArray EFlowMerger/eflow
  set MomentumOutputArray momentum
}

##################
# Scalar HT merger
##################

module Merger ScalarHT {
# add InputArray InputArray
  add InputArray UniqueObjectFinder/jets
  add InputArray UniqueObjectFinder/electrons
  add InputArray UniqueObjectFinder/photons
  add InputArray UniqueObjectFinder/muons
  set EnergyOutputArray energy
}

#####################
# MC truth jet finder
#####################

module FastJetFinder GenJetFinder {
  set InputArray Delphes/stableParticles

  set OutputArray jets

  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
  set JetAlgorithm 6
  set ParameterR 0.7

  set JetPTMin 3.0
}

############
# Jet finder
############

module FastJetFinder FastJetFinder {
# ATLAS uses towers
# set InputArray Calorimeter/towers
# CMS uses eflow?
  set InputArray EFlowMerger/eflow

  set OutputArray jets

  # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
  set JetAlgorithm 6
  set ParameterR 0.4

  set JetPTMin 1.0
}

##################
# Jet Energy Scale
##################

module EnergyScale JetEnergyScale {
  set InputArray FastJetFinder/jets
  set OutputArray jets

 # scale formula for jets
  set ScaleFormula {1.00}
}

########################
# GenJet Flavor Association
########################

module JetFlavorAssociation GenJetFlavorAssociation {
  set PartonInputArray Delphes/partons
  set ParticleInputArray Delphes/allParticles
  set ParticleLHEFInputArray Delphes/allParticlesLHEF
  set JetInputArray GenJetFinder/jets

  set DeltaR 0.4
  set PartonPTMin 0.5
  set PartonEtaMax 3.0

}

########################
# Jet Flavor Association
########################

module JetFlavorAssociation JetFlavorAssociation {

  set PartonInputArray Delphes/partons
  set ParticleInputArray Delphes/allParticles
  set ParticleLHEFInputArray Delphes/allParticlesLHEF
  set JetInputArray JetEnergyScale/jets

  set DeltaR 0.4
  set PartonPTMin 0.5
  set PartonEtaMax 3.0

}

###########
# b-tagging
###########
module BTagging GenBTagging {
  set PartonInputArray Delphes/partons
  set JetInputArray GenJetFinder/jets

  set BitNumber 0

  set DeltaR 0.4

  set PartonPTMin 0.5

  set PartonEtaMax 6.0

  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
  # PDG code = the highest PDG code of a quark or gluon inside DeltaR cone around jet axis
  # gluon's PDG code has the lowest priority

  # https://twiki.cern.ch/twiki/bin/view/CMSPublic/PhysicsResultsBTV
  # default efficiency formula (misidentification rate)
  add EfficiencyFormula {0} {0.001}

  # efficiency formula for c-jets (misidentification rate)
  add EfficiencyFormula {4} {0.05}

  # efficiency formula for b-jets
  add EfficiencyFormula {5} {0.75}
}

####################
# standard B-tagging
## ATTENTION : idealised values - use for cross check only
####################
module BTagging BTagging {
  set PartonInputArray Delphes/partons
  set JetInputArray JetEnergyScale/jets

  set BitNumber 0

  set DeltaR 0.4

  set PartonPTMin 0.5

  set PartonEtaMax 6.0

  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}
  # PDG code = the highest PDG code of a quark or gluon inside DeltaR cone around jet axis
  # gluon's PDG code has the lowest priority

  # https://twiki.cern.ch/twiki/bin/view/CMSPublic/PhysicsResultsBTV
  # default efficiency formula (misidentification rate)
  add EfficiencyFormula {0} {0.001}

  # efficiency formula for c-jets (misidentification rate)
  add EfficiencyFormula {4} {0.05}

  # efficiency formula for b-jets
  add EfficiencyFormula {5} {0.75}

}

module TauTagging TauTagging {
  set ParticleInputArray Delphes/allParticles
  set PartonInputArray Delphes/partons
  set JetInputArray JetEnergyScale/jets

  set DeltaR 0.4

  set TauPTMin 0.5

  set TauEtaMax 6.0

  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}

  # default efficiency formula (misidentification rate)
  add EfficiencyFormula {0} {0.001}
  # efficiency formula for tau-jets
  add EfficiencyFormula {15} {0.4}
}

module TauTagging GenTauTagging {
  set ParticleInputArray Delphes/allParticles
  set PartonInputArray Delphes/partons
  set JetInputArray GenJetFinder/jets

  set DeltaR 0.4

  set TauPTMin 0.5

  set TauEtaMax 6.0

  # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt}

  # default efficiency formula (misidentification rate)
  add EfficiencyFormula {0} {0.001}
  # efficiency formula for tau-jets
  add EfficiencyFormula {15} {0.4}
}

#####################################################
# Find uniquely identified photons/electrons/tau/jets
#####################################################

module UniqueObjectFinder UniqueObjectFinder {
# earlier arrays take precedence over later ones
# add InputArray InputArray OutputArray
  add InputArray PhotonIsolation/photons photons
  add InputArray ElectronIsolation/electrons electrons
  add InputArray MuonIsolation/muons muons
  add InputArray JetEnergyScale/jets jets
}

##################
# ROOT tree writer
##################

# tracks, towers and eflow objects are not stored by default in the output.
# if needed (for jet constituent or other studies), uncomment the relevant
# "add Branch ..." lines.

module TreeWriter TreeWriter {
# add Branch InputArray BranchName BranchClass
 add Branch Delphes/allParticles Particle GenParticle

# add Branch TrackMerger/tracks Track Track
# add Branch Calorimeter/towers Tower Tower

# add Branch Calorimeter/eflowTracks EFlowTrack Track
# add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
# add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower

  add Branch GenJetFinder/jets GenJet Jet
  add Branch UniqueObjectFinder/jets Jet Jet
  add Branch UniqueObjectFinder/electrons Electron Electron
  add Branch UniqueObjectFinder/photons Photon Photon
  add Branch UniqueObjectFinder/muons Muon Muon
  add Branch MissingET/momentum MissingET MissingET
  add Branch ScalarHT/energy ScalarHT ScalarHT
}
]]>
</MGDelphesCard>
<MGGenerationInfo>
# Number of Events : 200000
# Integrated weight (pb) : 0.0027399848000000003
</MGGenerationInfo>
</header>
<init>
11 2212 6.000000e+01 7.000000e+03 0 0 247000 247000 -4 1
2.739985e-03 2.495192e-06 2.739985e-03 1
<generator name='MadGraph5_aMC@NLO' version='3.1.0'>please cite 1405.0301 </generator>
</init>
</LesHouchesEvents>

The commands in MG5 are as follows:

************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 3.1.0 2021-03-30 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* and *
* http://amcatnlo.web.cern.ch/amcatnlo/ *
* *
* Type 'help' for in-line help. *
* Type 'tutorial' to learn how MG5 works *
* Type 'tutorial aMCatNLO' to learn how aMC@NLO works *
* Type 'tutorial MadLoop' to learn how MadLoop works *
* *
************************************************************
load MG5 configuration from ../input/mg5_configuration.txt
fastjet-config does not seem to correspond to a valid fastjet-config executable (v3+). We will use fjcore instead.
 Please set the 'fastjet'variable to the full (absolute) /PATH/TO/fastjet-config (including fastjet-config).
 MG5_aMC> set fastjet /PATH/TO/fastjet-config

lhapdf-config does not seem to correspond to a valid lhapdf-config executable.
Please set the 'lhapdf' variable to the (absolute) /PATH/TO/lhapdf-config (including lhapdf-config).
Note that you can still compile and run aMC@NLO with the built-in PDFs
 MG5_aMC> set lhapdf /PATH/TO/lhapdf-config

/home/b804-03/下载/MG5_aMC_v3_1_0/HEPTools/lhapdf6_py3/bin/lhapdf-config does not seem to correspond to a valid lhapdf-config executable.
Please set the 'lhapdf' variable to the (absolute) /PATH/TO/lhapdf-config (including lhapdf-config).
Note that you can still compile and run aMC@NLO with the built-in PDFs
 MG5_aMC> set lhapdf /PATH/TO/lhapdf-config

Using default eps viewer "evince". Set another one in ./input/mg5_configuration.txt
Using default web browser "firefox". Set another one in ./input/mg5_configuration.txt
import /home/b804-03/下载/MG5_aMC_v3_1_0/bin/0_LHeC
The import format was not given, so we guess it as command
import model ALP_linearfusion_UFO
INFO: Change particles name to pass to MG5 convention
Defined multiparticle p = g u c d s u~ c~ d~ s~
Defined multiparticle j = g u c d s u~ c~ d~ s~
Defined multiparticle l+ = e+ mu+
Defined multiparticle l- = e- mu-
Defined multiparticle vl = ve vm vt
Defined multiparticle vl~ = ve~ vm~ vt~
Defined multiparticle all = g a ve vm vt ve~ vm~ vt~ u c t d s b u~ c~ t~ d~ s~ b~ z w+ h ax w- e- mu- ta- e+ mu+ ta+
generate e- p > ve a a j NP=2 QED=2
Interpreting 'QED=2' as 'QED<=2'
Interpreting 'NP=2' as 'NP<=2'
INFO: Trying process: e- u > ve a a d NP<=2 QED<=2 @1
INFO: Process has 1 diagrams
INFO: Trying process: e- u > ve a a s NP<=2 QED<=2 @1
INFO: Process has 1 diagrams
INFO: Trying process: e- c > ve a a d NP<=2 QED<=2 @1
INFO: Process has 1 diagrams
INFO: Trying process: e- c > ve a a s NP<=2 QED<=2 @1
INFO: Process has 1 diagrams
INFO: Crossed process found for e- d~ > ve a a u~, reuse diagrams.
INFO: Crossed process found for e- d~ > ve a a c~, reuse diagrams.
INFO: Crossed process found for e- s~ > ve a a u~, reuse diagrams.
INFO: Crossed process found for e- s~ > ve a a c~, reuse diagrams.
8 processes with 8 diagrams generated in 0.044 s
Total: 8 processes with 8 diagrams
output LHeC_ma100
INFO: initialize a new directory: LHeC_ma100
INFO: remove old information in LHeC_ma100
INFO: Organizing processes into subprocess groups
INFO: Generating Helas calls for process: e- u > ve a a d NP<=2 QED<=2 @1
INFO: Processing color information for process: e- u > ve a a d NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- u > ve a a s NP<=2 QED<=2 @1
INFO: Processing color information for process: e- u > ve a a s NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- c > ve a a d NP<=2 QED<=2 @1
INFO: Processing color information for process: e- c > ve a a d NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- c > ve a a s NP<=2 QED<=2 @1
INFO: Processing color information for process: e- c > ve a a s NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- d~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Processing color information for process: e- d~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- d~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Processing color information for process: e- d~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- s~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Processing color information for process: e- s~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Generating Helas calls for process: e- s~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Processing color information for process: e- s~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Creating files in directory P1_emu_vlaad
INFO: Some T-channel width have been set to zero [new since 2.8.0]
 if you want to keep this width please set "zerowidth_tchannel" to False
INFO: Generating Feynman diagrams for Process: e- u > ve a a d NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emu_vlaad
INFO: Creating files in directory P1_emu_vlaas
INFO: Generating Feynman diagrams for Process: e- u > ve a a s NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emu_vlaas
INFO: Creating files in directory P1_emc_vlaad
INFO: Generating Feynman diagrams for Process: e- c > ve a a d NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emc_vlaad
INFO: Creating files in directory P1_emc_vlaas
INFO: Generating Feynman diagrams for Process: e- c > ve a a s NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emc_vlaas
INFO: Creating files in directory P1_emdx_vlaaux
INFO: Generating Feynman diagrams for Process: e- d~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emdx_vlaaux
INFO: Creating files in directory P1_emdx_vlaacx
INFO: Generating Feynman diagrams for Process: e- d~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emdx_vlaacx
INFO: Creating files in directory P1_emsx_vlaaux
INFO: Generating Feynman diagrams for Process: e- s~ > ve a a u~ NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emsx_vlaaux
INFO: Creating files in directory P1_emsx_vlaacx
INFO: Generating Feynman diagrams for Process: e- s~ > ve a a c~ NP<=2 QED<=2 @1
INFO: Finding symmetric diagrams for subprocess group emsx_vlaacx
Generated helas calls for 8 subprocesses (8 diagrams) in 0.050 s
Wrote files for 80 helas calls in 0.257 s
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates 2 routines in 0.307 s
save configuration file to /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/me5_configuration.txt
INFO: Use Fortran compiler gfortran
INFO: Use c++ compiler g++
INFO: Generate jpeg diagrams
INFO: Generate web pages
INFO: Generating MadAnalysis5 default cards tailored to this process
Output to directory /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100 done.
Type "launch" to generate events from this process, or see
/home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/README
Run "open index.html" to see more information about this process.
launch
************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* M A D E V E N T *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 3.1.0 2021-03-30 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* *
* Type 'help' for in-line help. *
* *
************************************************************
INFO: load configuration from /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/me5_configuration.txt
INFO: load configuration from /home/b804-03/下载/MG5_aMC_v3_1_0/input/mg5_configuration.txt
INFO: load configuration from /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/me5_configuration.txt
generate_events run_01
The following switches determine which programs are run:
/==============================================================================\
| 1. Choose the shower/hadronization program shower = OFF |
| 2. Choose the detector simulation program detector = OFF |
| 3. Choose an analysis package (plot/convert) analysis = MadAnalysis5 |
| 4. Decay onshell particles madspin = OFF |
| 5. Add weights to events for new hypp. reweight = OFF |
\==============================================================================/
Either type the switch number (1 to 5) to change its setting,
Set any switch explicitly (e.g. type 'shower=Pythia8' at the prompt)
Type 'help' for the list of all valid option
Type '0', 'auto', 'done' or just press enter when you are done.
The following switches determine which programs are run:
/==============================================================================\
| 1. Choose the shower/hadronization program shower = OFF |
| 2. Choose the detector simulation program detector = OFF |
| 3. Choose an analysis package (plot/convert) analysis = MadAnalysis5 |
| 4. Decay onshell particles madspin = OFF |
| 5. Add weights to events for new hypp. reweight = OFF |
\==============================================================================/
Either type the switch number (1 to 5) to change its setting,
Set any switch explicitly (e.g. type 'shower=Pythia8' at the prompt)
Type 'help' for the list of all valid option
Type '0', 'auto', 'done' or just press enter when you are done.
The following switches determine which programs are run:
/==============================================================================\
| 1. Choose the shower/hadronization program shower = OFF |
| 2. Choose the detector simulation program detector = OFF |
| 3. Choose an analysis package (plot/convert) analysis = MadAnalysis5 |
| 4. Decay onshell particles madspin = OFF |
| 5. Add weights to events for new hypp. reweight = OFF |
\==============================================================================/
Either type the switch number (1 to 5) to change its setting,
Set any switch explicitly (e.g. type 'shower=Pythia8' at the prompt)
Type 'help' for the list of all valid option
Type '0', 'auto', 'done' or just press enter when you are done.
set CWtil = 0.25
INFO: modify param_card information BLOCK alppars with id (2,) set to 0.25
set Ma = 100
INFO: modify param_card information BLOCK mass with id (9000005,) set to 100.0
set WALP = Auto
INFO: modify param_card information BLOCK decay with id (9000005,) set to Auto
set lpp1 0
INFO: modify parameter lpp1 of the run_card.dat to 0
set lpp2 1
INFO: modify parameter lpp2 of the run_card.dat to 1
set ebeam1 60
INFO: modify parameter ebeam1 of the run_card.dat to 60.0
set ebeam2 7000
INFO: modify parameter ebeam2 of the run_card.dat to 7000.0
set nevents 200000
INFO: modify parameter nevents of the run_card.dat to 200000
INFO: copy /home/b804-03/下载/MG5_aMC_v3_1_0/Delphes/cards/delphes_card_LHeC.tcl as delphes_card.dat
Do you want to edit a card (press enter to bypass editing)?
/------------------------------------------------------------\
| 1. param : param_card.dat |
| 2. run : run_card.dat |
| 3. pythia8 : pythia8_card.dat |
| 4. delphes : delphes_card.dat |
\------------------------------------------------------------/
 you can also
   - enter the path to a valid card or banner.
   - use the 'set' command to modify a parameter directly.
     The set option works only for param_card and run_card.
     Type 'help set' for more information on this command.
   - call an external program (ASperGE/MadWidth/...).
     Type 'help' for the list of available command
 [0, done, 1, param, 2, run, 3, pythia8, 4, enter path, ... ]
INFO: Change particles name to pass to MG5 convention
************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 3.1.0 2021-03-30 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* and *
* http://amcatnlo.web.cern.ch/amcatnlo/ *
* *
* Type 'help' for in-line help. *
* Type 'tutorial' to learn how MG5 works *
* Type 'tutorial aMCatNLO' to learn how aMC@NLO works *
* Type 'tutorial MadLoop' to learn how MadLoop works *
* *
************************************************************
load MG5 configuration from ../input/mg5_configuration.txt
fastjet-config does not seem to correspond to a valid fastjet-config executable (v3+). We will use fjcore instead.
 Please set the 'fastjet'variable to the full (absolute) /PATH/TO/fastjet-config (including fastjet-config).
 MG5_aMC> set fastjet /PATH/TO/fastjet-config

lhapdf-config does not seem to correspond to a valid lhapdf-config executable.
Please set the 'lhapdf' variable to the (absolute) /PATH/TO/lhapdf-config (including lhapdf-config).
Note that you can still compile and run aMC@NLO with the built-in PDFs
 MG5_aMC> set lhapdf /PATH/TO/lhapdf-config

/home/b804-03/下载/MG5_aMC_v3_1_0/HEPTools/lhapdf6_py3/bin/lhapdf-config does not seem to correspond to a valid lhapdf-config executable.
Please set the 'lhapdf' variable to the (absolute) /PATH/TO/lhapdf-config (including lhapdf-config).
Note that you can still compile and run aMC@NLO with the built-in PDFs
 MG5_aMC> set lhapdf /PATH/TO/lhapdf-config

set automatic_html_opening False --no_save
compute_widths 9000005 --output=/home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/param_card.dat --path=/home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/param_card.dat --body_decay=4.0025 --precision_channel=0.01
Please note that the automatic computation of the width is
    only valid in narrow-width approximation and at tree-level.
INFO: Get two body decay from FeynRules formula
Results written to /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/param_card.dat
INFO: get decay diagram for ax
Vertexlist of this model has not been searched.Automatically run the model.find_vertexlist()
Found 3 stable particles
No decay is found
No need for N body-decay (N>2). Results are in /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/Cards/param_card.dat
INFO: Update the dependent parameter of the param_card.dat
Generating 200000 events with run name run_01
survey run_01
INFO: compile directory
compile Source Directory
Using random number seed offset = 21
INFO: Running Survey
Creating Jobs
Working on SubProcesses
INFO: Compiling for process 1/8.
INFO: P1_emu_vlaad
INFO: Compiling for process 2/8.
INFO: P1_emu_vlaas
INFO: Compiling for process 3/8.
INFO: P1_emc_vlaad
INFO: Compiling for process 4/8.
INFO: P1_emc_vlaas
INFO: Compiling for process 5/8.
INFO: P1_emdx_vlaaux
INFO: Compiling for process 6/8.
INFO: P1_emdx_vlaacx
INFO: Compiling for process 7/8.
INFO: P1_emsx_vlaaux
INFO: Compiling for process 8/8.
INFO: P1_emsx_vlaacx
INFO: P1_emu_vlaad
INFO: P1_emu_vlaas
INFO: P1_emc_vlaad
INFO: P1_emc_vlaas
INFO: P1_emdx_vlaaux
INFO: P1_emdx_vlaacx
INFO: P1_emsx_vlaaux
INFO: P1_emsx_vlaacx
INFO: Idle: 1, Running: 1, Completed: 6 [ current time: 13h58 ]
INFO: Idle: 0, Running: 2, Completed: 6 [ current time: 13h58 ]
INFO: Idle: 0, Running: 0, Completed: 8 [ 0.26s ]
INFO: End survey
refine 200000
Creating Jobs
INFO: Refine results to 200000
INFO: Generating 200000.0 unweighted events.
sum of cpu time of last step: 4 seconds
INFO: Effective Luminosity 88049619.48256321 pb^-1
INFO: need to improve 5 channels
- Current estimate of cross-section: 0.0027257358 +- 9.080150006633226e-05
    P1_emu_vlaad
    P1_emu_vlaas
    P1_emc_vlaad
    P1_emc_vlaas
    P1_emdx_vlaaux
    P1_emdx_vlaacx
    P1_emsx_vlaaux
    P1_emsx_vlaacx
INFO: Idle: 131, Running: 8, Completed: 25 [ current time: 13h58 ]
INFO: Idle: 130, Running: 8, Completed: 26 [ current time: 13h58 ]
INFO: Idle: 111, Running: 8, Completed: 45 [ 3.1s ]
INFO: Idle: 96, Running: 8, Completed: 60 [ 6.1s ]
INFO: Idle: 78, Running: 8, Completed: 78 [ 9.4s ]
INFO: Idle: 64, Running: 8, Completed: 92 [ 12.5s ]
INFO: Idle: 48, Running: 8, Completed: 108 [ 15.7s ]
INFO: Idle: 33, Running: 8, Completed: 123 [ 19s ]
INFO: Idle: 5, Running: 8, Completed: 151 [ 22.1s ]
INFO: Idle: 0, Running: 0, Completed: 164 [ 23.5s ]
INFO: Combining runs
sum of cpu time of last step: 4m25s
INFO: finish refine
refine 200000 --treshold=0.9
No need for second refine due to stability of cross-section
INFO: Combining Events
  === Results Summary for run: run_01 tag: tag_1 ===

     Cross-section : 0.00274 +- 2.495e-06 pb
     Nb of events : 200000

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: Running Pythia8 [arXiv:1410.3012]
Splitting .lhe event file for PY8 parallelization...
Submitting Pythia8 jobs...
Pythia8 shower jobs: 1 Idle, 7 Running, 0 Done [50 seconds]
Pythia8 shower jobs: 0 Idle, 7 Running, 1 Done [1m47s]
Pythia8 shower jobs: 0 Idle, 6 Running, 2 Done [1m48s]
Pythia8 shower jobs: 0 Idle, 5 Running, 3 Done [1m48s]
Pythia8 shower jobs: 0 Idle, 4 Running, 4 Done [1m48s]
Pythia8 shower jobs: 0 Idle, 3 Running, 5 Done [1m48s]
Pythia8 shower jobs: 0 Idle, 2 Running, 6 Done [1m49s]
Pythia8 shower jobs: 0 Idle, 1 Running, 7 Done [1m49s]
Pythia8 shower jobs: 0 Idle, 0 Running, 8 Done [1m50s]
Merging results from the split PY8 runs...
INFO: Pythia8 shower finished after 2m30s.
INFO: prepare delphes run
INFO: Running Delphes
INFO: If you are interested in lhco output. please run root2lhco converter.
INFO: or edit bin/internal/run_delphes3 to run the converter automatically.
INFO: delphes done
  === Results Summary for run: run_01 tag: tag_1 ===

     Cross-section : 0.00274 +- 2.495e-06 pb
     Nb of events : 200000

INFO: storing files of previous run
INFO: Storing Pythia8 files of previous run
INFO: Done
quit
INFO:
more information in /home/b804-03/下载/MG5_aMC_v3_1_0/bin/LHeC_ma100/index.html
quit

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

I would use the method described in the FAQ to
1) speed up your code (at generation time)
2) change the input mass for pythia which might help to solve the problem (or not I do have no clue of what pythia is doing)
FAQ #2312: “FR Model much slower than build-in MG model. Why and how to fix?”.

Revision history for this message
wanghan (wangwanghan) said :
#4

Thanks!

Can you help with this problem?

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

To post a message you must log in.