Commit ac9f8b4c authored by Cyril Pascal Becot's avatar Cyril Pascal Becot
Browse files

See ChangeLog


git-svn-id: svn+ssh://svn.cern.ch/reps/atlasoff/Generators/MC15JobOptions/trunk@813123 4525493e-7705-40b1-a816-d608a930855b
parent 551a234b
2018-02-23 Cyril Becot <cyril.becot@cern.ch>
* add common/MadGraph/MadGraphControl_MonotopDMF_nonres_Wlv.py
* add 309724-309730
* add 345921-345926
* add 406148-406192
* tag MC15JobOptions-00-09-21
2018-02-22 Cyril Becot <cyril.becot@cern.ch>
* add common/MadGraph/MadGraphControl_MGPy8EG_DM_dijetjet_flavfilt.py
* add 345876-345878 345917-345918
......
from MadGraphControl.MadGraphUtils import *
job_option_name = runArgs.jobConfig[0]
config_names = runArgs.jobConfig[0].split('.')[2].split('_')
mMed = int(config_names[4][4:])
mDM = int(config_names[5][2:])
coupling_ar = float(0.5)
coupling_gg = float(1.0)
print "=================== running MonotopDMF nonresonant model ================"
print "Mediator mass: ", mMed
print "DM mass: ", mDM
print "coupling_ar: ", coupling_ar
print "coupling_gg: ", coupling_gg
print "========================================================================="
with open('proc_card_mg5.dat','w') as f:
f.write("""
import model /cvmfs/atlas.cern.ch/repo/sw/Generators/madgraph/models/latest/MonotopDMF_UFO -modelname
define j = g u c d s b u~ c~ d~ s~ b~
define l+ = e+ mu+ ta+
define l- = e- mu- ta-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate p p > t psi psibar, (t > b W+, W+ > l+ vl)
add process p p > t~ psi psibar, (t~ > b~ W-, W- > l- vl~)
output -f
""")
f.close()
process_dir = new_process()
##configure run_card
runcardname = 'MadGraph_run_card_MonotopDMF.dat'
runcard = subprocess.Popen(['get_files','-data', runcardname]).communicate()
### this will be added when uploading to svn
if not os.access(runcardname,os.R_OK):
print 'ERROR: Could not get run card'
raise RuntimeError("run card '%s' is missing!"%runcardname)
else:
oldcard = open(runcardname,'r')
newcard = open('run_card.dat','w')
for line in oldcard:
if ' iseed ' in line:
newcard.write(' %i = iseed ! rnd seed (0=assigned automatically=default)) \n'%(runArgs.randomSeed))
elif ' nevents ' in line:
newcard.write(' %i = nevents ! Number of unweighted events requested) \n'%(runArgs.maxEvents*2))
elif ' ebeam1 ' in line:
newcard.write(' %i = ebeam1 ! beam 1 total energy in GeV \n'%(runArgs.ecmEnergy/2))
elif ' ebeam2 ' in line:
newcard.write(' %i = ebeam2 ! beam 2 total energy in GeV \n'%(runArgs.ecmEnergy/2))
elif ' lhe_version' in line:
newcard.write('1.0 = lhe_version ! Change the way clustering information pass to shower.\n')
else:
newcard.write(line)
oldcard.close()
newcard.close()
#config parameter card
paramcardname = 'MadGraph_param_card_MonotopDMF.dat'
paramcard = subprocess.Popen(['get_files','-data',paramcardname]).communicate()
if not os.access(paramcardname, os.R_OK):
print 'ERROR: Could not get param card'
raise RuntimeError("parameter card '%s' missing!"%paramcardname)
else:
oldcard = open(paramcardname)
newcard = open('param_card.dat','w')
for line in oldcard:
if '# Mpsi' in line:
newcard.write(' 1000023 %e # Mpsi \n'%(mDM))
elif '# MV' in line:
newcard.write(' 32 %e # MV \n'%(mMed))
elif '# ar' in line:
newcard.write(' 1 %e # ar \n'%(coupling_ar))
elif '# gg' in line:
newcard.write(' 10 %e # gg \n'%(coupling_gg))
else:
newcard.write(line)
oldcard.close()
newcard.close()
run_name = "run_01"
generate(run_card_loc='run_card.dat', param_card_loc='param_card.dat', mode=0,
run_name=run_name, proc_dir=process_dir)
stringy = 'Madgraph.'+str(runArgs.runNumber)+'.MonotopDMFnonresWlv.mDM'+str(mDM)+'.mMed'+str(mMed)
out_lhe_name = stringy+'._00001.events.tar.gz'
arrange_output(run_name=run_name, proc_dir=process_dir, outputDS=out_lhe_name)
#------------------------------
#hack into LHE, change DM pdgID to 1000022
#------------------------------
if hasattr(runArgs, 'outputTXTFile'):
lhe_name = runArgs.outputTXTFile
else:
lhe_name = "tmp_"+out_lhe_name
subprocess.call(['rm','-f', lhe_name])
out_lhe = lhe_name.split('.tar.gz')[0] + ".events"
pp1 = subprocess.Popen(['cat',out_lhe],stdout=subprocess.PIPE)
############
pp2 = subprocess.Popen(['sed','s/-1000023/1000022/g'],stdin=pp1.stdout,
stdout=subprocess.PIPE)
############
pp3 = subprocess.Popen(['sed','s/1000023/1000022/g'],stdin=pp2.stdout,
stdout=subprocess.PIPE)
pp1.stdout.close()
pp2.stdout.close()
new_lhe_output = pp3.communicate()[0]
with open(out_lhe,'w') as f:
f.write(new_lhe_output)
subprocess.call(['tar','czvf',lhe_name, out_lhe])
#--------------------------------------------------------------
# Pythia8 showering with the A14 NNPDF2.3 tune
#--------------------------------------------------------------
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_MadGraph.py")
runArgs.inputGeneratorFile = out_lhe_name
evgenConfig.inputfilecheck = stringy
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=1 GeV and mMed = 1000 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=1 GeV and mMed = 1500 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=1 GeV and mMed = 2000 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=1 GeV and mMed = 2500 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=1 GeV and mMed = 3000 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=100 GeV and mMed = 1000 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
evgenConfig.description = "MadGraph5+Pythia8+EvtGen monoptop non-resonant model (W->lv) with mDM=100 GeV and mMed = 3000 GeV"
evgenConfig.keywords = ["exotic", "monotop", "nonResonant", "leptonic"]
evgenConfig.contact = ["renjie.wang@cern.ch", "daniele.madaffari@cern.ch", "cescobar@cern.ch"]
evgenConfig.minevents = 1000
include("MC15JobOptions/MadGraphControl_MonotopDMF_nonres_Wlv.py")
from MadGraphControl.MadGraphUtils import *
from os import path
safefactor=1.1
mode=0
### DSID lists (extensions can include systematics samples)
test=[345921]
fcard = open('proc_card_mg5.dat','w')
if runArgs.runNumber in test:
fcard.write("""
import model 2HDM
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
generate g g > t t~ h1, (h1 > ta+ ta-)
output -f""")
fcard.close()
else:
raise RuntimeError("runNumber %i not recognised in these jobOptions."%runArgs.runNumber)
beamEnergy=-999
if hasattr(runArgs,'ecmEnergy'):
beamEnergy = runArgs.ecmEnergy / 2.
else:
raise RuntimeError("No center of mass energy found.")
#Fetch default LO run_card.dat and set parameters
extras = { 'lhe_version':'2.0',
'cut_decays':'F',
'pdlabel':"'nn23lo1'",
'use_syst':"False"}
XMass = { '25':'60',
'35':'1.2500e+02',
'36':'1.2500e+10',
'37':'1.2500e+10',
} #MA0
runName='run_01'
process_dir = new_process()
build_run_card(run_card_old=get_default_runcard(proc_dir=process_dir),run_card_new='run_card.dat',
nevts=runArgs.maxEvents/0.53*safefactor,rand_seed=runArgs.randomSeed,beamEnergy=beamEnergy,extras=extras)
#build_param_card(param_card_old='2HDM_param_card.dat',param_card_new='param_card.dat',masses=XMass,)
build_param_card(param_card_old=path.join(process_dir,'Cards/param_card.dat'),param_card_new='param_card_new.dat',masses=XMass,)
print_cards()
#generate(run_card_loc='run_card.dat',param_card_loc='param_card.dat',mode=mode,proc_dir=process_dir,run_name=runName)
generate(run_card_loc='run_card.dat',param_card_loc='param_card_new.dat',mode=mode,proc_dir=process_dir,run_name=runName)
arrange_output(run_name=runName,proc_dir=process_dir,outputDS=runName+'._00001.events.tar.gz',lhe_version=3,saveProcDir=True)
#### Shower
evgenConfig.description = 'MG5 ttbarX to tautau, mH = 60 GeV'
evgenConfig.keywords+=['ttbar','jets','tau']
evgenConfig.inputfilecheck = runName
runArgs.inputGeneratorFile=runName+'._00001.events.tar.gz'
evgenConfig.contact = ['Zirui Wang <zirui.wang@cern.ch>']
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_MadGraph.py")
include("MC15JobOptions/TTbarWToLeptonFilter.py")
filtSeq.TTbarWToLeptonFilter.NumLeptons = -1 #(-1: non-all had, 0: all had, 1: l+jets, 2: dilepton)
filtSeq.TTbarWToLeptonFilter.Ptcut = 0.0
from MadGraphControl.MadGraphUtils import *
from os import path
safefactor=1.1
mode=0
### DSID lists (extensions can include systematics samples)
test=[345926]
fcard = open('proc_card_mg5.dat','w')
if runArgs.runNumber in test:
fcard.write("""
import model 2HDM
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
generate g g > t t~ h1, (h1 > b b~)
output -f""")
fcard.close()
else:
raise RuntimeError("runNumber %i not recognised in these jobOptions."%runArgs.runNumber)
beamEnergy=-999
if hasattr(runArgs,'ecmEnergy'):
beamEnergy = runArgs.ecmEnergy / 2.
else:
raise RuntimeError("No center of mass energy found.")
#Fetch default LO run_card.dat and set parameters
extras = { 'lhe_version':'2.0',
'cut_decays':'F',
'pdlabel':"'nn23lo1'",
'use_syst':"False"}
XMass = { '25':'60',
'35':'1.2500e+02',
'36':'1.2500e+10',
'37':'1.2500e+10',
} #MA0
runName='run_01'
process_dir = new_process()
build_run_card(run_card_old=get_default_runcard(proc_dir=process_dir),run_card_new='run_card.dat',
nevts=runArgs.maxEvents/0.53*safefactor,rand_seed=runArgs.randomSeed,beamEnergy=beamEnergy,extras=extras)
#build_param_card(param_card_old='2HDM_param_card.dat',param_card_new='param_card.dat',masses=XMass,)
build_param_card(param_card_old=path.join(process_dir,'Cards/param_card.dat'),param_card_new='param_card_new.dat',masses=XMass,)
print_cards()
#generate(run_card_loc='run_card.dat',param_card_loc='param_card.dat',mode=mode,proc_dir=process_dir,run_name=runName)
generate(run_card_loc='run_card.dat',param_card_loc='param_card_new.dat',mode=mode,proc_dir=process_dir,run_name=runName)
arrange_output(run_name=runName,proc_dir=process_dir,outputDS=runName+'._00001.events.tar.gz',lhe_version=3,saveProcDir=True)
#### Shower
evgenConfig.description = 'MG5 ttbarX to b b~, mH = 60 GeV'
evgenConfig.keywords+=['ttbar','jets','bbbar']
evgenConfig.inputfilecheck = runName
runArgs.inputGeneratorFile=runName+'._00001.events.tar.gz'
evgenConfig.contact = ['Zirui Wang <zirui.wang@cern.ch>']
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_MadGraph.py")
include("MC15JobOptions/TTbarWToLeptonFilter.py")
filtSeq.TTbarWToLeptonFilter.NumLeptons = -1 #(-1: non-all had, 0: all had, 1: l+jets, 2: dilepton)
filtSeq.TTbarWToLeptonFilter.Ptcut = 0.0
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_TT_directTT.py' )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment