Commit 545da1bd authored by mcjo's avatar mcjo
Browse files

add 426321, 410804-43,84-907, 371318-29, 410501-6, update 344800-19


git-svn-id: svn+ssh://svn.cern.ch/reps/atlasoff/Generators/MC15JobOptions/trunk@778586 4525493e-7705-40b1-a816-d608a930855b
parent 0ee0a10d
2016-10-14 Evelina Bouhova-Thacker <e.bouhova@cern.ch>
* tagging MC15JobOptions-00-04-65
* add 426321, 410804-43,84-907, 371318-29, 410501-6, update 344800-19
* add MadGraphControl_LRSM_el.py
2016-10-13 Christian Gutschow <chris.g@cern.ch>
* Adding 364198-364215 Sherpa 2.2.1 low mass Z+jets
* Tagging MC15JobOptions-00-04-64
......
### MadGraphControl for LRSM model
### MadGraph5+Pythia8 for LRSM WR and NR (Keung-Senjanovic process)
### Heavily based on MC12JobOptions/trunk/gencontrol/MadGraphControl_Wprime_tb_hadronic.py and thanks to Mike Hance
from MadGraphControl.MadGraphUtils import *
# Grab proccess card and move it into place
proccard = subprocess.Popen(['get_files','-data','MadGraph_proc_card_LRSM_el.dat'])
proccard.wait()
if not os.access('MadGraph_proc_card_LRSM_el.dat',os.R_OK):
print 'ERROR: Could not get process card'
else:
oldcard = open('MadGraph_proc_card_LRSM_el.dat','r')
newcard = open('proc_card_mg5.dat','w')
for line in oldcard:
newcard.write(line)
oldcard.close()
newcard.close()
process_dir = new_process()
# Grab the run card and move it into place
runcard = subprocess.Popen(['get_files','-data','MadGraph_run_card_LRSM.dat'])
runcard.wait()
if not os.access('MadGraph_run_card_LRSM.dat',os.R_OK):
print 'ERROR: Could not get run card'
elif os.access('run_card.dat',os.R_OK):
print 'ERROR: Old run card in the current directory. Dont want to clobber it. Please move it first.'
else:
oldcard = open('MadGraph_run_card_LRSM.dat','r')
newcard = open('run_card.dat','w')
for line in oldcard:
if ' nevents ' in line:
newcard.write(' %i = nevents ! Number of unweighted events requested \n'%(1.05*runArgs.maxEvents))
elif ' iseed ' in line:
newcard.write(' %i = iseed ! rnd seed (0=assigned automatically=default)) \n'%(runArgs.randomSeed))
elif ' ebeam1 ' in line:
newcard.write(' %i = ebeam1 ! beam 1 energy in GeV \n'%(runArgs.ecmEnergy/2))
elif ' ebeam2 ' in line:
newcard.write(' %i = ebeam2 ! beam 2 energy in GeV \n'%(runArgs.ecmEnergy/2))
else:
newcard.write(line)
oldcard.close()
newcard.close()
# Setting mass points from jobConfig
MW2 = float(runArgs.jobConfig[0].split('.')[2].split('_')[3][2:])
MN = float(runArgs.jobConfig[0].split('.')[2].split('_')[4][2:])
runNumber = int(runArgs.jobConfig[0].split('.')[1])
pdfset = str(runArgs.jobConfig[0].split('.')[2].split('_')[1])
# Grab parameter card and move it into place
# Widths are Auto in base param_card
paramcard = subprocess.Popen(['get_files','-data','MadGraph_param_card_LRSM.dat'])
paramcard.wait()
if not os.access('MadGraph_param_card_LRSM.dat',os.R_OK):
print 'ERROR: Could not get param card'
else:
oldcard = open('MadGraph_param_card_LRSM.dat','r')
newcard = open('param_card.dat','w')
for line in oldcard:
if ' MW2' in line:
newcard.write(' 34 %e # MW2 \n'%(MW2))
elif ' MN1' in line:
newcard.write(' 9900012 %e # MN1 \n'%(MN))
elif ' MN2' in line:
newcard.write(' 9900014 %e # MN2 \n'%(MN))
elif ' MN3' in line:
newcard.write(' 9900016 %e # MN3 \n'%(MN))
else:
newcard.write(line)
oldcard.close()
newcard.close()
# Triggering generation
generate(run_card_loc='run_card.dat',param_card_loc='param_card.dat',mode=0,njobs=1,run_name='Test',proc_dir=process_dir)
stringy = 'madgraph.'+str(runNumber)+'.MadGraphPythia8EvtGen_'+pdfset+'_LRSM_WR'+str(int(MW2))+'_NR'+str(int(MN))
arrange_output(run_name='Test',proc_dir=process_dir,outputDS=stringy+'._00001.events.tar.gz')
# PYTHIA 8
runArgs.inputGeneratorFile=stringy+'._00001.events.tar.gz'
evgenConfig.description = "MadGraph5+Pythia8 for LRSM WR and NR (Keung-Senjanovic process)"
evgenConfig.keywords = ["exotic","Wprime","BSM"]
evgenConfig.inputfilecheck = "LRSM"
evgenConfig.contact = ["Xanthe Hoad <xanthe.hoad@cern.ch>"]
evgenConfig.process = "pp > WR > l NR, NR > l WR, WR > j j"
# Finally, run the parton shower and configure MadGraph+Pythia
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_MadGraph.py")
include ( 'MC15JobOptions/MadGraphControl_SimplifiedModelPreInclude.py' )
#Setting the masses
#the squarks
for q in squarks: masses[q] = float(runArgs.jobConfig[0].split('_')[6])
#chargino 1 and neutralino 2
masses['1000024'] = float(runArgs.jobConfig[0].split('_')[7])
masses['1000023'] = float(runArgs.jobConfig[0].split('_')[7])
#sleptons
masses['1000011'] = float(runArgs.jobConfig[0].split('_')[8])
masses['1000012'] = float(runArgs.jobConfig[0].split('_')[8])
masses['1000013'] = float(runArgs.jobConfig[0].split('_')[8])
masses['1000014'] = float(runArgs.jobConfig[0].split('_')[8])
masses['1000015'] = float(runArgs.jobConfig[0].split('_')[8])
masses['1000016'] = float(runArgs.jobConfig[0].split('_')[8])
masses['2000011'] = float(runArgs.jobConfig[0].split('_')[8])
masses['2000013'] = float(runArgs.jobConfig[0].split('_')[8])
masses['2000015'] = float(runArgs.jobConfig[0].split('_')[8])
#neutralino 1
masses['1000022'] = float(runArgs.jobConfig[0].split('_')[9].split('.')[0])
if masses['1000022']<0.5: masses['1000022']=0.5
genSeq.Pythia8.Commands += ["25:mMin = 0.2"]
genSeq.Pythia8.Commands += ["24:mMin = 0.2"]
genSeq.Pythia8.Commands += ["23:mMin = 0.2"]
gentype = str(runArgs.jobConfig[0].split('_')[3])
decaytype = str(runArgs.jobConfig[0].split('_')[4]+"_"+runArgs.jobConfig[0].split('_')[5])
process = '''
generate p p > susylq susylq~ $ go susyweak @1
add process p p > susylq susylq~ j $ go susyweak @2
add process p p > susylq susylq~ j j $ go susyweak @3
'''
njets = 2
evt_multiplier = 100
evgenLog.info('Registered generation of squark grid '+str(runArgs.runNumber))
evgenConfig.contact = [ "federico.meloni@cern.ch" ]
evgenConfig.keywords += ['simplifiedModel', 'squark']
evgenConfig.description = 'squark production in simplified model, two-step decays through chargino or neutralino2 followed by sleptons, m_sq = %s GeV, m_C1 = m_N2 = %s GeV, m_N1 = %s GeV'%(masses[squarks[0]],masses['1000024'],masses['1000022'])
evgenConfig.inputconfcheck = "SS_direct_"+runArgs.jobConfig[0].split("_")[4]+"_"+runArgs.jobConfig[0].split('_')[5]
include ( 'MC15JobOptions/MadGraphControl_SimplifiedModelPostInclude.py' )
if njets>0:
genSeq.Pythia8.Commands += ["Merging:Process = pp>{ul,1000002}{ul~,-1000002}{dl,1000001}{dl~,-1000001}{sl,1000003}{sl~,-1000003}{cl,1000004}{cl~,-1000004}"]
# This control file is an update to the original FCNC script which used LO NP model
# The processes are defined using the DSIDs and the numbering.
# To simplify things, the script will be largely unchanged and an offset will be applied to get the same syntax
# Starting DSID: 410700 -> 410804 (changed to) : offset is -104
# runArgs.runNumber -> thisDSID for numerical comparisons
from MadGraphControl.MadGraphUtils import *
import fileinput
from AthenaCommon import Logging
JOlog = Logging.logging.getLogger('FCNCJobOption')
nevents=int(1.1*runArgs.maxEvents)
mode=0
gridpack_dir = 'madevent/'
gridpack_mode = False
### DSID lists
allDIDS = range(410700,410892)
NLO = True
if NLO:
proc = 'generate p p > t t~ [QCD]'
else:
# this is just for quick checks
proc = 'generate p p > t t~'
fcard = open('proc_card_mg5.dat','w')
model = 'TopFCNC-onlyh'
runName = 'mcttqHWb'+str(runArgs.runNumber)+'NLO5FS'
### Nevent adjustment for event filters
if any("Htautau" in JO for JO in runArgs.jobConfig):
nevents = int(2.5*nevents)
JOlog.info(runArgs.jobConfig)
# Get the DSID
thisDSID = runArgs.runNumber
# Apply the offset
thisDSID = thisDSID - 104
### JO logging
JOlog.info(" --- DSID shifting for NLO model --- ")
JOlog.info(" DSID : "+str(runArgs.runNumber)+" -> Shifting to : "+str(thisDSID))
JOlog.info(" Generating : "+str(nevents)+" events")
if thisDSID >= 410780 and thisDSID <= 410875:
model = 'TopFCNC'
runName = 'mcttqZWb'+str(runArgs.runNumber)+'NLO5FS'
elif thisDSID >= 410876 and thisDSID <= 410892:
model = 'TopFCNC-onlyGam'
runName = 'mcttqgamWb'+str(runArgs.runNumber)+'NLO5FS'
if thisDSID in allDIDS:
# fcard.write("""import model MadGraphModels/models/%s\n%s\noutput -f"""%(model,proc))
fcard.write("""import model %s\n%s\noutput -f"""%(model,proc))
else:
raise RuntimeError("runNumber %i not recognised in these jobOptions."%runArgs.runNumber)
fcard.close()
beamEnergy=-999
if hasattr(runArgs,'ecmEnergy'):
beamEnergy = runArgs.ecmEnergy / 2.
else:
raise RuntimeError("No center of mass energy found.")
##Fetch default NLO run_card.dat and set parameters
##nnpdf3.0 nlo as 0.118 5fs
lhaid=260000
pdfmin=260001
pdfmax=260100
reweight_scale = '.true.'
reweight_PDF = '.true.'
pdflabel='lhapdf'
maxjetflavor = 5
parton_shower = 'PYTHIA8'
muR_over_ref = 1.0
muF1_over_ref = 1.0
muF2_over_ref = 1.0
dyn_scale = 10
lhe_version = 3
extras = { 'lhaid' : lhaid,
'pdlabel' : "'"+pdflabel+"'",
'parton_shower' : parton_shower,
'maxjetflavor' : maxjetflavor,
'reweight_scale': reweight_scale,
'reweight_PDF' : reweight_PDF,
'PDF_set_min' : pdfmin,
'PDF_set_max' : pdfmax,
'muR_over_ref' : muR_over_ref,
'muF1_over_ref' : muF1_over_ref,
'muF2_over_ref' : muF2_over_ref,
'dynamical_scale_choice' : dyn_scale
}
# The couplings. Only real part.
# The tqH relevant couplings (c,u) x (LH,RH) (scalar of course)
RCtphi = 0.
RCuphi = 0.
RCtcphi = 0.
RCctphi = 0.
# The tqZ,tqg relevant couplings (c,u) x (Vector,Tensor) x (LH,RH)
# vector for tqZ
RC1utR = 0.
RC1utL = 0.
RC3utL = 0.
RC1ctR = 0.
RC1ctL = 0.
RC3ctL = 0.
# tensor for tqZ and tqgamma
RCtW = 0.
RCtB = 0.
RCuW = 0.
RCuB = 0.
RCtcW = 0.
RCtcB = 0.
RCctW = 0.
RCctB = 0.
## For MadSpin
madspin_card_loc = 'madspin_card.dat'
madspin_card_rep = madspin_card_loc
madspin_in = 'import Events/'+runName+'/events.lhe'
madspin_rep = 'set ms_dir MadSpin'
madspin_seed = runArgs.randomSeed
if hasattr(runArgs, 'inputGenConfFile'):
madspin_card_rep = gridpack_dir+'Cards/'+madspin_card_loc
madspin_in = 'import '+gridpack_dir+'Events/'+runName+'/events.lhe'
madspin_rep = 'set ms_dir '+gridpack_dir+'MadSpin'
madspin_seed = 10000000+int(runArgs.randomSeed)
mscard = open(madspin_card_rep,'w')
mscard.write("""
set Nevents_for_max_weigth 250 # number of events for the estimate of the max. weight (default: 75)
set max_weight_ps_point 1000 # number of PS to estimate the maximum for each event (default: 400)
set seed %i
%s
%s
define l+ = l+ ta+
define l- = l- ta-
\n
"""%(madspin_seed,madspin_in,madspin_rep))
## The W decay
wtyp = thisDSID%4
if wtyp == 0:
wstr = ', w- > l- vl~'
elif wtyp == 1:
wstr = ', w+ > l+ vl'
elif wtyp == 2:
wstr = ', w- > j j'
elif wtyp == 3:
wstr = ', w+ > j j'
## The SM top
ttyp = thisDSID%2
if ttyp == 0:
t2str = 'decay t~ > w- b~'
else:
t2str = 'decay t > w+ b'
# the tqH part
if thisDSID >= 410700 and thisDSID <= 410779:
keyName = 'Higgs'
theDIDS = thisDSID - 410700
if theDIDS < 20:
RCtcphi = 12.
elif theDIDS < 40:
RCtphi = 12.
elif theDIDS < 60:
RCctphi = 12.
else:
RCuphi = 12.
qtyp = theDIDS/20
if theDIDS >= 40:
qtyp = (theDIDS-40)/20
if ttyp%2 == 0 and qtyp == 0:
t1str = 'decay t > c h'
elif ttyp%2 == 1 and qtyp == 0:
t1str = 'decay t~ > c~ h'
elif ttyp%2 == 0 and qtyp == 1:
t1str = 'decay t > u h'
elif ttyp%2 == 1 and qtyp == 1:
t1str = 'decay t~ > u~ h'
mscard.write("""%s\n%s%s\nlaunch"""%(t1str,t2str,wstr))
# the tqZ part
elif thisDSID >= 410780 and thisDSID <= 410875:
keyName = 'Z'
theDIDS = thisDSID - 410780
if theDIDS < 12:
RC1ctL = 7.0
elif theDIDS < 24:
RC1utL = 7.0
elif theDIDS < 36:
RCctW = 0.05
elif theDIDS < 48:
RCtW = 0.05
elif theDIDS < 60:
RC1ctR = 7.0
elif theDIDS < 72:
RC1utR = 7.0
elif theDIDS < 84:
RCtcW = 0.05
elif theDIDS < 96:
RCuW = 0.05
ztyp = (theDIDS/4)%3
if ztyp == 0:
zstr = ', z > l- l+'
elif ztyp == 1:
zstr = ', z > vl vl~'
else:
zstr = ', z > j j'
qtyp = theDIDS/12
if (24 <= theDIDS < 48):
qtyp = (theDIDS-24)/12
elif (48 <= theDIDS < 72):
qtyp = (theDIDS-48)/12
elif (72 <= theDIDS < 96):
qtyp = (theDIDS-72)/12
if ttyp%2 == 0 and qtyp == 0:
t1str = 'decay t > c z'
elif ttyp%2 == 1 and qtyp == 0:
t1str = 'decay t~ > c~ z'
elif ttyp%2 == 0 and qtyp == 1:
t1str = 'decay t > u z'
elif ttyp%2 == 1 and qtyp == 1:
t1str = 'decay t~ > u~ z'
mscard.write("""%s%s\n%s%s\nlaunch"""%(t1str,zstr,t2str,wstr))
# the tqgam part
elif thisDSID >= 410876 and thisDSID <= 410891:
keyName = 'photon'
theDIDS = thisDSID - 410876
if theDIDS < 4:
RCtcB = 12.0
elif theDIDS < 8:
RCtB = 12.0
elif theDIDS < 12:
RCctB = 12.0
else:
RCuB = 12.0
qtyp = theDIDS/4
if theDIDS >= 8:
qtyp = (theDIDS-8)/4
if ttyp%2 == 0 and qtyp == 0:
t1str = 'decay t > c a'
elif ttyp%2 == 1 and qtyp == 0:
t1str = 'decay t~ > c~ a'
elif ttyp%2 == 0 and qtyp == 1:
t1str = 'decay t > u a'
elif ttyp%2 == 1 and qtyp == 1:
t1str = 'decay t~ > u~ a'
mscard.write("""%s\n%s%s\nlaunch"""%(t1str,t2str,wstr))
else:
raise RuntimeError("No good runNumber")
mscard.close()
coup = {
'RCtphi' : RCtphi ,
'RCuphi' : RCuphi ,
'RCtcphi' : RCtcphi,
'RCctphi' : RCctphi,
'RC1utR' : RC1utR,
'RC1utL' : RC1utL,
'RC3utL' : RC3utL,
'RC1ctR' : RC1ctR,
'RC1ctL' : RC1ctL,
'RC3ctL' : RC3ctL,
'RCtW' : RCtW,
'RCtB' : RCtB,
'RCuW' : RCuW,
'RCuB' : RCuB,
'RCtcW' : RCtcW,
'RCtcB' : RCtcB,
'RCctW' : RCctW,
'RCctB' : RCctB
}
process_dir = new_process(grid_pack=gridpack_dir)
paramFileName = 'MadGraph_param_card_ttFCNC_NLO.dat'
#paramFileNameN = 'param_cardDecay.dat'
paramFileNameN = 'param_card.dat'
paramFile = subprocess.Popen(['get_files','-data',paramFileName]).communicate()
if not os.access(paramFileName, os.R_OK):
print 'ERROR: Could not get param card'
raise RuntimeError("parameter card '%s' missing!"%paramFileName)
build_param_card(param_card_old=paramFileName,param_card_new=paramFileNameN,
params={'dim6':coup}
)
shutil.copyfile(paramFileNameN,process_dir+'/Cards/'+paramFileNameN)
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,extras=extras)
print_cards()
#
# Cook the setscales file for the user defined dynamical scale
fileN = process_dir+'/SubProcesses/setscales.f'
mark = ' elseif(dynamical_scale_choice.eq.10) 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 = 10 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'
]
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):
print """
tmp=0d0
do i=3,nexternal
if (pp(0,i)*pp(0,i)-pp(3,i)*pp(3,i)-pp(2,i)*pp(2,i)-pp(1,i)*pp(1,i).ge.10.) then
tmp=tmp+max(0d0,(pp(0,i)+pp(3,i))*(pp(0,i)-pp(3,i)))
endif
enddo
tmp=dsqrt(tmp/2d0)
temp_scale_id='sqrt(sum_i mT(i)**2/2), i=top quarks'
"""
#### End of setscales cooking
generate(run_card_loc='run_card.dat',param_card_loc=None,
madspin_card_loc=madspin_card_loc,
mode=mode,njobs=1,
proc_dir=process_dir,run_name=runName,
grid_pack=gridpack_mode,gridpack_dir=gridpack_dir,nevents=nevents,random_seed=runArgs.randomSeed)
arrange_output(run_name=runName,proc_dir=process_dir,outputDS=runName+'._00001.events.tar.gz',lhe_version=lhe_version)
#### Shower
evgenConfig.description = 'aMcAtNlo+Pythia8+EvtGen ttbar production for FCNC NLO model'
evgenConfig.keywords += ['top', 'ttbar', 'FCNC', keyName]
evgenConfig.inputfilecheck = runName
#evgenConfig.inputconfcheck = ''
runArgs.inputGeneratorFile = runName+'._00001.events.tar.gz'
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_aMcAtNlo.py")
### Additional filter(s)
### Tau filter
if any("Htautau" in JO for JO in runArgs.jobConfig):
if not hasattr(filtSeq,"TauFilter"):
from GeneratorFilters.GeneratorFiltersConf import TauFilter
filtSeq += TauFilter()
filtSeq.TauFilter.Ntaus = 2
filtSeq.TauFilter.Ptcute = 13000.0 # MeV
filtSeq.TauFilter.Ptcutmu = 8000.0 # MeV
filtSeq.TauFilter.Ptcuthad = 20000.0 # MeV
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####
######################################################################
## ##
## Width set on Auto will be computed following the information ##
## present in the decay.py files of the model. ##
## See arXiv:1402.1178 for more details. ##
## ##
######################################################################
###################################
## INFORMATION FOR LOOP
###################################
Block loop
1 9.118800e+01 # MU_R
###################################
## INFORMATION FOR MASS
###################################
Block mass
6 1.725000e+02 # MT
15 1.776820e+00 # MTA
23 9.118760e+01 # MZ
25 1.250000e+02 # MH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
1 0.000000 # d : 0.0
2 0.000000 # u : 0.0
3 0.000000 # s : 0.0
4 0.000000 # c : 0.0
5 0.000000 # b : 0.0
11 0.000000 # e- : 0.0
12 0.000000 # ve : 0.0
13 0.000000 # mu- : 0.0