Commit 03e54063 authored by Avik Roy's avatar Avik Roy
Browse files

HAHM samples for displaced lepton-jet analysis

parent 416e4acc
Pipeline #3053108 failed with stages
in 1 minute and 19 seconds
from MadGraphControl import MadGraphUtils
from MadGraphControl.MadGraphUtils import *
import subprocess
import os
if hasattr(runArgs,'ecmEnergy'):
beamEnergy = runArgs.ecmEnergy / 2.
if hasattr(runArgs,'maxEvents'):
nEvents = int(runArgs.maxEvents)
else:
beamEnergy = 6500.
nEvents = 10000
# MadGraph info
process = {
2: 'generate g g > h > chi2 chi2, (chi2 > chi1 zp, zp > f- f+), (chi2 > chi1 zp, zp > f- f+)' ,
4: 'generate g g > h > chi2 chi2, (chi2 > chi1 hs, (hs > zp zp, zp > f- f+)), (chi2 > chi1 hs, (hs > zp zp, zp > f- f+))' ,
22: 'generate g g > h > zp zp, (zp > f- f+)'
}
modelcode = 'iDM'
rname = "runDPJ"
MadGraphUtils.MADGRAPH_RUN_NAME = rname
pcard_params = {"HIDDEN" : {"mZDinput" : params["mZDinput"],
"MHSinput" : params["MHSinput"],
"epsilon" : params["epsilon"],
"gXmu" : params["gXmu"],
"gXe" : params["gXe"],
"gXpi" : params["gXpi"] },
"HIGGS" : {"MHinput" : params["mH"]},
"MASS" : { "MChi1" : params["MChi1"],
"MChi2" : params["MChi2"]},
"DECAY" : {"WZp" : params["WZp"],
"WHS" : "DECAY 3000005 1.000000e-08 # WHS"}
}
rcard='MadGraph_run_card_HAHMdisplaced.dat'
runArgs.inputGeneratorFile=rname
runArgs.inputfilecheck=rname
# initialise random number generator/sequence
import random
random.seed(runArgs.randomSeed)
# lifetime function
def lifetime(avgtau = 21):
import math
t = random.random()
return -1.0 * avgtau * math.log(t)
# do not run MadGraph if config only is requested
if not opts.config_only:
proc = ""
if params["decayMode"] == "normal":
proc+=("""
import model --modelname %s
define f- = e- m- tt- d s u~ c~ b
define f+ = e+ m+ tt+ d~ s~ u c b~
%s
output -f
""" % (modelcode, process[params["nGamma"]]))
elif params["decayMode"] == "quarks":
proc += ("""
import model --modelname %s
define f- = d s u~ c~
define f+ = d~ s~ u c
%s
output -f
""" % (modelcode, process[params["nGamma"]]))
elif params["decayMode"] == "electrons":
proc += ("""
import model --modelname %s
define f- = e-
define f+ = e+
%s
output -f
""" % (modelcode, process[params["nGamma"]]))
# generating events in MG
process_dir = new_process(proc)
get_dat_file = subprocess.Popen(['get_files','-jo', rcard])
get_dat_file.wait()
modify_run_card(run_card_input=rcard,process_dir=process_dir,settings={"nevents" : 1.1*nEvents})
modify_param_card(process_dir=process_dir,params=pcard_params)
generate(process_dir=process_dir,runArgs=runArgs)
# hacking LHE file
unzip1 = subprocess.Popen(['gunzip',process_dir+'/Events/'+rname+'/unweighted_events.lhe.gz'])
unzip1.wait()
oldlhe = open(process_dir+'/Events/'+rname+'/unweighted_events.lhe','r')
newlhe = open(process_dir+'/Events/'+rname+'/unweighted_events2.lhe','w')
init = True
for line in oldlhe:
if init==True:
if '30000016' in line:
line = line.replace('30000016','3000016')
elif '30000015' in line:
line = line.replace('30000015','1000022')
newlhe.write(line)
if '</init>' in line:
init = False
else:
newline=line.rstrip('\n')
columns=newline.split()
pdgid=columns[0]
if pdgid == '3000001' and params["avgtau"]>0:
part1 = line[:-22]
part2 = "%.5e" % (lifetime(params["avgtau"]))
part3 = line[-12:]
newlhe.write(part1+part2+part3)
elif (pdgid == '-30000016') :
part1 = ' -3000016'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '30000016') :
part1 = ' 3000016'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '-30000015') :
part1 = ' -1000022'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '30000015') :
part1 = ' 1000022'
part2 = line[10:]
newlhe.write(part1+part2)
else:
newlhe.write(line)
oldlhe.close()
newlhe.close()
# re-zipping hacked LHE
zip1 = subprocess.Popen(['gzip',process_dir+'/Events/'+rname+'/unweighted_events2.lhe'])
zip1.wait()
shutil.move(process_dir+'/Events/'+rname+'/unweighted_events2.lhe.gz',process_dir+'/Events/'+rname+'/unweighted_events.lhe.gz')
os.remove(process_dir+'/Events/'+rname+'/unweighted_events.lhe')
arrange_output(process_dir=process_dir,runArgs=runArgs,lhe_version=3,saveProcDir=True)
if 'ATHENA_PROC_NUMBER' in os.environ:
opts.nprocs = 0
include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("Pythia8_i/Pythia8_MadGraph.py")
genSeq.Pythia8.Commands += ["Main:timesAllowErrors = 60000"]
#relax the cuts on displaced vertices and non G4 particles
testSeq.TestHepMC.MaxTransVtxDisp = 100000000 #in mm
testSeq.TestHepMC.MaxVtxDisp = 100000000 #in mm
testSeq.TestHepMC.MaxNonG4Energy = 100000000 #in MeV
#--------------------------------------------------------------
# Configuration for EvgenJobTransforms
#--------------------------------------------------------------
evgenConfig.description = 'displaced HAHM gg -> H -> %sgamma_d + X, mZd=%s, mH=%s' % (params["nGamma"], params["mZDinput"]*1000., params["mH"])
evgenConfig.contact = ['iacopo.longarini@cern.ch']
evgenConfig.process="LJ_HAHMdisplaced_ggfusion"
evgenConfig.nEventsPerJob = nEvents
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 1.700000e-02
params['MHSinput'] = 2.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 1.200000e-03
params['gXe'] = 1.200000e-03
params['gXpi'] = 1.000000e+00
params['MChi1'] = 2.000000e+00
params['MChi2'] = 5.000000e+00
params['WZp'] = "DECAY 3000001 1.000000e-03 # WZp"
params['mH'] = 125
params['nGamma'] = 22
params['avgtau'] = 1.0
params['decayMode'] = 'electrons'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
../../508xxx/508929/MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py
\ No newline at end of file
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 1.000000e-01
params['MHSinput'] = 2.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 1.200000e-03
params['gXe'] = 1.200000e-03
params['gXpi'] = 1.000000e+00
params['MChi1'] = 2.000000e+00
params['MChi2'] = 5.000000e+00
params['WZp'] = "DECAY 3000001 1.000000e-03 # WZp"
params['mH'] = 125
params['nGamma'] = 22
params['avgtau'] = 8.0
params['decayMode'] = 'electrons'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
../../508xxx/508929/MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py
\ No newline at end of file
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 4.000000e-01
params['MHSinput'] = 2.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 1.220000e-03
params['gXe'] = 1.200000e-03
params['gXpi'] = 9.000000e-01
params['MChi1'] = 2.000000e+00
params['MChi2'] = 5.000000e+00
params['WZp'] = "DECAY 3000001 1.000000e-03 # WZp"
params['mH'] = 125
params['nGamma'] = 22
params['avgtau'] = 25.0
params['decayMode'] = 'normal'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
../../508xxx/508929/MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py
\ No newline at end of file
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 2.000000e+00
params['MHSinput'] = 5.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 6.150000e-04
params['gXe'] = 6.150000e-04
params['gXpi'] = 1.000000e-11
params['MChi1'] = 2.000000e+00
params['MChi2'] = 1.000000e+01
params['WZp'] = "DECAY 3000001 2.033460e-08 # WZp"
params['mH'] = 125
params['nGamma'] = 22
params['avgtau'] = 80.0
params['decayMode'] = 'normal'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_ggfusion.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
from MadGraphControl import MadGraphUtils
from MadGraphControl.MadGraphUtils import *
import subprocess
import os
if hasattr(runArgs,'ecmEnergy'):
beamEnergy = runArgs.ecmEnergy / 2.
if hasattr(runArgs,'maxEvents'):
nEvents = int(runArgs.maxEvents)
else:
beamEnergy = 6500.
nEvents = 10000
# MadGraph info
modelcode = 'iDM'
rname = 'runDPJ'
MadGraphUtils.MADGRAPH_RUN_NAME = rname
pcard_params = {"HIDDEN" : {"mZDinput" : params["mZDinput"],
"MHSinput" : params["MHSinput"],
"epsilon" : params["epsilon"],
"gXmu" : params["gXmu"],
"gXe" : params["gXe"],
"gXpi" : params["gXpi"] },
"HIGGS" : {"MHinput" : params["mH"]},
"MASS" : { "MChi1" : params["MChi1"],
"MChi2" : params["MChi2"]},
"DECAY" : {"WZp" : params["WZp"],
"WHS" : "DECAY 3000005 1.000000e-08 # WHS"}
}
rcard='MadGraph_run_card_HAHMdisplaced.dat'
runArgs.inputGeneratorFile=rname
runArgs.inputfilecheck=rname
# initialise random number generator/sequence
import random
random.seed(runArgs.randomSeed)
# lifetime function
def lifetime(avgtau = 21):
import math
t = random.random()
return -1.0 * avgtau * math.log(t)
# define Zd decay fermions
# defaut is including all leptons and quarks
fminus = 'e- m- tt- d s b u~ c~'
fplus = 'e+ m+ tt+ d~ s~ b~ u c'
if params["decayMode"] == "quarks":
fminus = 'd s b u~ c~'
fplus = 'd~ s~ b~ u c'
elif params["decayMode"] == "electrons":
fminus = 'e-'
fplus = 'e+'
elif params["decayMode"] == "muons":
fminus = 'm-'
fplus = 'm+'
# do not run MadGraph if config only is requested
if not opts.config_only:
proc = ""
proc += ("""
import model --modelname %s
define f- = %s
define f+ = %s
define l+ = e+ m+ tt+
define l- = e- m- tt-
define v = ve vm vt
define v~ = ve~ vm~ vt~
generate p p > w+ h , (w+ > l+ v), ((h > zp zp), (zp > f- f+))
add process p p > w- h , (w- > l- v~), ((h > zp zp), (zp > f- f+))
output -f
""" % (modelcode, fminus, fplus))
# generating events in MG
process_dir = new_process(proc)
get_dat_file = subprocess.Popen(['get_files','-jo', rcard])
get_dat_file.wait()
modify_run_card(run_card_input=rcard,process_dir=process_dir,settings={"nevents" : 1.1*nEvents})
modify_param_card(process_dir=process_dir,params=pcard_params)
generate(process_dir=process_dir,runArgs=runArgs)
# hacking LHE file
unzip1 = subprocess.Popen(['gunzip',process_dir+'/Events/'+rname+'/unweighted_events.lhe.gz'])
unzip1.wait()
oldlhe = open(process_dir+'/Events/'+rname+'/unweighted_events.lhe','r')
newlhe = open(process_dir+'/Events/'+rname+'/unweighted_events2.lhe','w')
init = True
for line in oldlhe:
if init==True:
if '30000016' in line:
line = line.replace('30000016','3000016')
elif '30000015' in line:
line = line.replace('30000015','1000022')
newlhe.write(line)
if '</init>' in line:
init = False
else:
newline=line.rstrip('\n')
columns=newline.split()
pdgid=columns[0]
if pdgid == '3000001' and params["avgtau"]>0:
part1 = line[:-22]
part2 = "%.5e" % (lifetime(params["avgtau"]))
part3 = line[-12:]
newlhe.write(part1+part2+part3)
elif (pdgid == '-30000016') :
part1 = ' -3000016'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '30000016') :
part1 = ' 3000016'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '-30000015') :
part1 = ' -1000022'
part2 = line[10:]
newlhe.write(part1+part2)
elif (pdgid == '30000015') :
part1 = ' 1000022'
part2 = line[10:]
newlhe.write(part1+part2)
else:
newlhe.write(line)
oldlhe.close()
newlhe.close()
# re-zipping hacked LHE
zip1 = subprocess.Popen(['gzip',process_dir+'/Events/'+rname+'/unweighted_events2.lhe'])
zip1.wait()
shutil.move(process_dir+'/Events/'+rname+'/unweighted_events2.lhe.gz',process_dir+'/Events/'+rname+'/unweighted_events.lhe.gz')
os.remove(process_dir+'/Events/'+rname+'/unweighted_events.lhe')
arrange_output(process_dir=process_dir,runArgs=runArgs,lhe_version=3,saveProcDir=True)
if 'ATHENA_PROC_NUMBER' in os.environ:
opts.nprocs = 0
include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("Pythia8_i/Pythia8_MadGraph.py")
genSeq.Pythia8.Commands += ["Main:timesAllowErrors = 60000"]
#relax the cuts on displaced vertices and non G4 particles
testSeq.TestHepMC.MaxTransVtxDisp = 100000000 #in mm
testSeq.TestHepMC.MaxVtxDisp = 100000000 #in mm
testSeq.TestHepMC.MaxNonG4Energy = 100000000 #in MeV
#--------------------------------------------------------------
# Configuration for EvgenJobTransforms
#--------------------------------------------------------------
evgenConfig.description = 'displaced HAHM W + Higgs, W -> lepton, Higgs -> 2 gamma_d, mZd=%s, mH=%s' % (params["mZDinput"]*1000., params["mH"])
evgenConfig.contact = ['cristiano.sebastiani@cern.ch']
evgenConfig.process="LJ_HAHMdisplaced_wh"
evgenConfig.nEventsPerJob = nEvents
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 1.700000e-02
params['MHSinput'] = 2.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 1.200000e-03
params['gXe'] = 1.200000e-03
params['gXpi'] = 1.000000e+00
params['MChi1'] = 2.000000e+00
params['MChi2'] = 5.000000e+00
params['WZp'] = "DECAY 3000001 1.000000e-03 # WZp"
params['mH'] = 125
params['nGamma'] = 2
params['avgtau'] = 1.0
params['decayMode'] = 'electrons'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_wh.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
../../508xxx/508933/MadGraphControl_A14N23LO_HAHMdisplaced_wh.py
\ No newline at end of file
- estimated CPU for CI job = 0.00 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
params={}
params['mZDinput'] = 1.000000e-01
params['MHSinput'] = 2.000000e+00
params['epsilon'] = 1.000000e-03
params['gXmu'] = 1.200000e-03
params['gXe'] = 1.200000e-03
params['gXpi'] = 1.000000e+00
params['MChi1'] = 2.000000e+00
params['MChi2'] = 5.000000e+00
params['WZp'] = "DECAY 3000001 1.000000e-03 # WZp"
params['mH'] = 125
params['nGamma'] = 2
params['avgtau'] = 8.0
params['decayMode'] = 'electrons'
include ("MadGraphControl_A14N23LO_HAHMdisplaced_wh.py")
evgenConfig.keywords = ["exotic", "BSMHiggs", "BSM", "darkPhoton"]
../../508xxx/508933/MadGraphControl_A14N23LO_HAHMdisplaced_wh.py
\ No newline at end of file
- estimated CPU for CI job = 0.01 hrs
- using release = AthGeneration-21.6.79
- ecmEnergy = 13000.0
- randomSeed = 1234
- EVNT to EVNT = False
- LHEonly = False
Markdown is supported
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