Negative cross section for tZq NLO

Asked by Qing

I have a problem when running the on the fly MC production. Can you help me to solve it?

I tried to produce NLO tZq signal,
 mgproc="""generate p p > t b~ j z $$ W+ W- [QCD] \n"""
  mgproc +="""add process p p > t~ b j z $$ W+ W- [QCD]"""
but at last I got a negative cross section like this:
 Summary:
12:08:26 Process p p > t b~ j z $$ W+ W- [QCD] ; p p > t~ b j z $$ W+ W- [QCD]
12:08:26 Run at p-p collider (6500.0 + 6500.0 GeV)
12:08:26 Total cross-section: -2.274e-01 +- 8.9e-02 pb
12:08:26 Ren. and fac. scale uncertainty: +-964.0% --2271.2%
12:08:26 PDF uncertainty: +-35.2% --35.2%
12:08:26 Number of events generated: 50000
12:08:26 Parton shower to be used: HERWIG6
12:08:26 Fraction of negative weights: 0.50
12:08:26 Total running time : 28h 13m

I also have my joboption file attched.

Best Regards,

Qing

from MadGraphControl.MadGraphUtils import *
import fileinput
import shutil
import subprocess
import os
import sys
# General settings
#minevents=1000
nevents=50000
#mode=0

# MG merging settings
maxjetflavor=4
ickkw=0

dyn_scale = '0'

### DSID lists (extensions can include systematics samples)
tZ =[410049]

systScalefactUp=[410153]

systScalefactDn=[410154]

if runArgs.runNumber in tZ:
# mgproc="""generate p p > t b~ j Z $$ W+ W-, (t > w+ b, w+ > l+ vl) , Z > l+ l-\n"""
# mgproc +="""add process p p > t~ b j Z $$ W+ W- , (t~ > w- b~, w- > l- vl~) , Z > l+ l-"""
    mgproc="""generate p p > t b~ j z $$ W+ W- [QCD] \n"""
    mgproc +="""add process p p > t~ b j z $$ W+ W- [QCD]"""
    name='tZq'
    #process="pp>tzq"
    keyword=['SM','singleTop','tZ','lepton']
    mode = 1
    #nJobs=10
    cluster_type= 'condor'
    cluster_queue= 'None'
    #elif runArgs.runNumber in ttZllonshell_Np1:
    #mgproc="""generate p p > t t~ z j, z > l+ l-"""
    #name='ttllonshell_Np1'
    #process="pp>tt~z"
    #keyword=['SM','ttZ','2lepton']

else:
    raise RuntimeError("runNumber %i not recognised in these jobOptions."%runArgs.runNumber)

stringy = 'madgraph.'+str(runArgs.runNumber)+'.MadGraph_'+str(name)

fcard = open('proc_card_mg5.dat','w')

fcard.write("""
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+ ta+
define l- = e- mu- ta-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
"""+mgproc+"""
output -f
""")
fcard.close()

beamEnergy=-999
if hasattr(runArgs,'ecmEnergy'):
    beamEnergy = runArgs.ecmEnergy / 2.
else:
    raise RuntimeError("No center of mass energy found.")

# Decay with MadSpin
madspin_card_loc='madspin_card.dat'
mscard = open(madspin_card_loc,'w')
mscard.write("""#************************************************************
#* MadSpin *
#* *
#* P. Artoisenet, R. Frederix, R. Rietkerk, O. Mattelaer *
#* *
#* Part of the MadGraph5_aMC@NLO Framework: *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
set max_weight_ps_point 400 # number of PS to estimate the maximum for each event
#set seed %i
decay t > w+ b, w+ > l+ vl
decay t~ > w- b~, w- > l- vl~
decay z > l+ l-
launch """)
mscard.close()

pdflabel="lhapdf"
#lhaid=262000
lhaid=260000
#Fetch default LO run_card.dat and set parameters
extras = { 'lhe_version' : '3.0',
           'cut_decays' : 'F',
           'pdlabel' : "'"+pdflabel+"'",
           'lhaid' : lhaid,
           'maxjetflavor' : maxjetflavor,
           'asrwgtflavor' : maxjetflavor,
           'ickkw' : 0,
           'ptj' : 1,
           'ptb' : 0,
           'mmjj' : 0,
           'drjj' : 0.4,
           'drll' : 0.4,
           'drjl' : 0.4,
           'ptl' : 0,
           'etal' : -1,
           'etab' : -1,
           'etaj' : 5,
           'dynamical_scale_choice' : dyn_scale,

           'reweight_scale': 'True',
           'reweight_PDF': 'True',
           'PDF_set_min': 260001,
           'PDF_set_max':260100

 }

scalefact = 1.0
if runArgs.runNumber in systScalefactUp:
    name=name+'_facsc2_rensc2'
    scalefact = 2.0
elif runArgs.runNumber in systScalefactDn:
    name=name+'_facsc0p5_rensc0p5'
    scalefact = 0.5

process_dir = new_process()

# Cook the setscales file for the user defined dynamical scale
fileN = process_dir+'/SubProcesses/setscales.f'
mark = ' elseif(dynamical_scale_choice.eq.0) then'
rmLines = ['ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
           'cc USER-DEFINED SCALE: ENTER YOUR CODE HERE cc',
           'cc to use this code you must set cc',
           'cc dynamical_scale_choice = 0 cc',
           'cc in the run_card (run_card.dat) cc',
           'write(*,*) "User-defined scale not set"',
           'stop 1',
           'temp_scale_id=\'User-defined dynamical scale\' ! use a meaningful string',
           'tmp = 0',
           'cc USER-DEFINED SCALE: END OF USER CODE cc'
           ]

flag=0
for line in fileinput.input(fileN, inplace=1):
    toKeep = True
    for rmLine in rmLines:
        if line.find(rmLine) >= 0:
           toKeep = False
           break
    if toKeep:
        print line,
    if line.startswith(mark) and flag==0:
        flag +=1
        print """
c Q^2= mb^2 + 0.5*(pt^2+ptbar^2)
c rscale=0d0 !factorization scale**2 for pdf1
c !factorization scale**2 for pdf2
c xmtc=dot(P(0,6),P(0,6))
c rscale = 4d0 * sqrt(pt(P(0,6))**2+xmtc)
          do i=3,nexternal
          xm2=dot(pp(0,i),pp(0,i))
          if ( xmtc < 30 .and. xmtc > 10 ) then
               tmp = 4d0 * sqrt(pt(pp(0,i))**2+xmtc)
c write(*,*) i, pt(P(0,i))**2, xmtc, sqrt(pt(P(0,i))**2+xmtc), rscale
c write(*,*) i, xmtc, pt(P(0,i)), rscale
          endif
          enddo
c it can be 4 or 0.25
c rscale = 1*rscale
             """

build_run_card(run_card_old=get_default_runcard(proc_dir=process_dir),run_card_new='run_card.dat',
               nevts=nevents,rand_seed=runArgs.randomSeed,beamEnergy=beamEnergy,xqcut=0.,
               extras=extras,scalefact=scalefact)

print_cards()

generate(run_card_loc='run_card.dat',
param_card_loc=None,
#madspin_card_loc='madspin_card.dat',
mode=mode,
cluster_type=cluster_type,
cluster_queue=cluster_queue,
proc_dir=process_dir)

arrange_output(proc_dir=process_dir,outputDS=stringy+'._00001.events.tar.gz')

####################To Kill PS
theApp.finalize()
theApp.exit()

## Shower
evgenConfig.description = 'MadGraph_'+str(name)
evgenConfig.keywords+=keyword
evgenConfig.inputfilecheck = stringy
evgenConfig.minevents = minevents
runArgs.inputGeneratorFile=stringy+'._00001.events.tar.gz'

include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_MadGraph.py")

#--------------------------------------------------------------
# EVGEN configuration
#--------------------------------------------------------------
#evgenConfig.description = 'MG+Pythia6 single top + Z production with Perugia 2012 tune'
#evgenConfig.keywords +=keyword #= [ 'SM','singleTop','tZ','lepton']
#evgenConfig.contact = ['<email address hidden>' ]
#
#evgenConfig.inputfilecheck = stringy
#evgenConfig.minevents = minevents
#runArgs.inputGeneratorFile=stringy+'._00001.events.tar.gz'
#
#--------------------------------------------------------------
# Pythia6 (Perugia2012) showering
#--------------------------------------------------------------
#include('MC15JobOptions/MadGraphPythia_Perugia2012_Common.py')
#include('MC15JobOptions/Pythia_Tauola.py')
#include('MC15JobOptions/Pythia_Photos.py')
#
# Run EvtGen as afterburner
#include ( "MC15JobOptions/Pythia_MadGraph_EvtGen.py" )

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
marco zaro Edit question
Solved by:
marco zaro
Solved:
Last query:
Last reply:
Revision history for this message
marco zaro (marco-zaro) said :
#1

Dear Quing,
are you using a model with a massive b quark?
what cuts are you imposing on the cross section?
It is very strange that you get a negative cross section, because the very same process is listed in the MG5_aMC paper (1405.0301, see table 7, process f6)
Let us know
Best,

Marco

Revision history for this message
Qing (wangqinglhc) said :
#2

Hi Marco,

Yes it has a massive b quark. I do not have cuts on the cross section. Yes the that process in the paper is the same as mine but I am using the fortran code in the scrip to calculate the dynamic scale. Could this be the problem?

Revision history for this message
marco zaro (marco-zaro) said :
#3

can you copy-paste the code for the scale?
Marco

Revision history for this message
Qing (wangqinglhc) said :
#4

do i=3,nexternal
          xm2=dot(pp(0,i),pp(0,i))
          if ( xmtc < 30 .and. xmtc > 10 ) then
               tmp = 4d0 * sqrt(pt(pp(0,i))**2+xmtc)
          endif
enddo

Revision history for this message
Best marco zaro (marco-zaro) said :
#5

where is xm2 used?
and what is xmtc?

What result do you get with the default scale?

Thanks,

Marco
On 01 Dec 2016, at 14:33, Qing <email address hidden> wrote:

> Question #404326 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/404326
>
> Qing posted a new comment:
> do i=3,nexternal
> xm2=dot(pp(0,i),pp(0,i))
> if ( xmtc < 30 .and. xmtc > 10 ) then
> tmp = 4d0 * sqrt(pt(pp(0,i))**2+xmtc)
> endif
> enddo
>
> --
> You received this question notification because you are subscribed to
> the question.

Revision history for this message
Qing (wangqinglhc) said :
#6

Oh that might be the problem. The xmtc should be xm2. I changed that and run again to see whether that has a big influence on the cross section.

Revision history for this message
Qing (wangqinglhc) said :
#7

Hi Marco,

Thank you very much for the help. That xmtc turns out to be the problem. Now I got a reasonable number:

Summary:
12:48:21 Process p p > t b~ j z $$ W+ W- [QCD] ; p p > t~ b j z $$ W+ W- [QCD]
12:48:21 Run at p-p collider (6500.0 + 6500.0 GeV)
12:48:21 Total cross-section: 8.062e-01 +- 8.7e-03 pb
12:48:21 Ren. and fac. scale uncertainty: +7.8% -8.2%
12:48:21 PDF uncertainty: +1.2% -1.2%
12:48:21 Number of events generated: 50000
12:48:21 Parton shower to be used: HERWIG6
12:48:21 Fraction of negative weights: 0.36
12:48:21 Total running time : 3h 33m

Revision history for this message
Qing (wangqinglhc) said :
#8

Thanks marco zaro, that solved my question.