Commit 0c3b20bf authored by Cyril Pascal Becot's avatar Cyril Pascal Becot
Browse files

ATLMCPROD-7456

parent 0fd67efb
......@@ -2,52 +2,27 @@ from MadGraphControl.MadGraphUtils import *
# for details about the HC model, please check here: http://feynrules.irmp.ucl.ac.be/attachment/wiki/HiggsCharacterisation/README
######
## number of events to generate + safety margin
nevents=1.1*runArgs.maxEvents
# General settings
nevents=5500
gridpack_dir=None
gridpack_mode=False
cluster_type='condor'
cluster_queue='tomorrow'
mode=0
njobs=1
runName='run_01'
###generate events
#gridpack_dir=None
#gridpack_mode=False
#cluster_type='condor'
#cluster_queue='tomorrow'
#mode=0
#njobs=1
###gridpack production
gridpack_dir='madevent/'
gridpack_mode=True
mode=2 #mode=0 for single-core run, mode=1 if access to acluster, mode=2 for multicore production
njobs=132
cluster_type='lsf'
cluster_queue='8nh'
#mode=1#NO
#njobs=20#NO
#cluster_type='lsf'#NO
#cluster_queue='1nd'#NO
######
## map DSID to process settings
tHjb_4fl = [ 346188, 346414, 346229, 346230, 346231, 346232, 346233, 346234, 346535, 346536, 346537, 346538, 346539, 346540, 346541, 346542, 346543, 346544, 346533, 346534, 346535]
tHjb_5fl = [ 346221, 346415 ]
# these DSIDs have modified param cards (BSM couplings)
tHjb_4fl_CPalpha_15 = [ 346539 ]
tHjb_4fl_CPalpha_30 = [ 346540 ]
tHjb_4fl_CPalpha_45 = [ 346541 ]
tHjb_4fl_CPalpha_60 = [ 346542 ]
tHjb_4fl_CPalpha_75 = [ 346543 ]
tHjb_4fl_CPalpha_90 = [ 346544 ]
tHjb_4fl_yt_minus1 = [ 346231, 346232 ] # top yukawa -1*SM value
tHjb_4fl_yt_plus2 = [ 346233, 346234 ] # top yukawa +2*SM value
tHjb_4fl_modparam = tHjb_4fl_yt_minus1+tHjb_4fl_yt_plus2+tHjb_4fl_CPalpha_15+tHjb_4fl_CPalpha_30+tHjb_4fl_CPalpha_45+tHjb_4fl_CPalpha_60+tHjb_4fl_CPalpha_75+tHjb_4fl_CPalpha_90
if runArgs.runNumber in tHjb_4fl:
tx0jb_4fl = [346533, 346534, 346535, 346536, 346537, 346538, 346539, 346540, 346541, 346542, 346543, 346544]
tx0jb_4fl_CPalpha_0 = []
tx0jb_4fl_CPalpha_15 = [346533, 346539]
tx0jb_4fl_CPalpha_30 = [346534, 346540]
tx0jb_4fl_CPalpha_45 = [346535, 346541]
tx0jb_4fl_CPalpha_60 = [346536, 346542]
tx0jb_4fl_CPalpha_75 = [346537, 346543]
tx0jb_4fl_CPalpha_90 = [346538, 346544]
if runArgs.runNumber in tx0jb_4fl:
mgproc="generate p p > x0 t1 b1 j $$ w+ w- [QCD]"
name='tx0jb_4fl'
......@@ -82,17 +57,6 @@ else:
raise RuntimeError("runNumber %i not recognised in these jobOptions."%runArgs.runNumber)
parameters_cosa_1={
'frblock':{
'Lambda':'1.000000e+03',
'cosa': '1.000000e+00',
'kSM': '1.000000e+00',
'kHtt': '1.000000e+00',
'kAtt': '0.000000e+00'}
}
parameters = parameters_cosa_1
runName = 'madgraph.'+str(runArgs.runNumber)+'.MadGraph_'+str(name)
beamEnergy=-999
......@@ -103,79 +67,56 @@ else:
process_dir = new_process(grid_pack=gridpack_dir)
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)
######
## write madspin card
madspin_dir = 'my_madspin'
madspin_card_loc='madspin_card.dat'
if not hasattr(runArgs, 'inputGenConfFile'):
fMadSpinCard = open('madspin_card.dat','w')
fMadSpinCard.write('import Events/'+runName+'/events.lhe.gz\n')
fMadSpinCard.write('set ms_dir '+madspin_dir+'\n')
fMadSpinCard.write('#set use_old_dir True\n')
fMadSpinCard.write('set ms_dir MadSpin\n')
else:
os.unlink(gridpack_dir+'Cards/madspin_card.dat')
fMadSpinCard = open(gridpack_dir+'Cards/madspin_card.dat','w')
fMadSpinCard.write('import '+gridpack_dir+'Events/'+runName+'/events.lhe.gz\n')
fMadSpinCard.write('set ms_dir '+gridpack_dir+'MadSpin\n')
fMadSpinCard.write('set ms_dir '+madspin_dir+'\n')
fMadSpinCard.write('set seed '+str(10000000+int(runArgs.randomSeed))+'\n')
# for these numbers I get negligible(<1) amount of events above weights / 10k decayed events
fMadSpinCard.write('''set Nevents_for_max_weigth 2000 # number of events for the estimate of the max. weight (default: 75)
set max_weight_ps_point 500 # number of PS to estimate the maximum for each event (default: 400)
'''+topdecay+'''
launch''')
fMadSpinCard.close()
######
## select param card; default/None = SM
build_param_card(param_card_old=process_dir+'/Cards/param_card.dat',param_card_new='param_card_new.dat',params=parameters)
# run with nominal param card
if runArgs.runNumber not in tHjb_4fl_modparam:
generate(run_card_loc='run_card.dat',param_card_loc='param_card_new.dat',mode=mode,njobs=njobs,proc_dir=process_dir,run_name=runName,madspin_card_loc=madspin_card_loc,grid_pack=gridpack_mode,gridpack_dir=gridpack_dir,nevents=nevents,random_seed=runArgs.randomSeed,required_accuracy=0.001,cluster_type=cluster_type,cluster_queue=cluster_queue)
# run with modified param card
else:
# BSM case: run with modified param card
mod_paramcard_name = ''
if runArgs.runNumber in tHjb_4fl_yt_minus1:
mod_paramcard_name = 'param_card_yt_minus1.dat'
elif runArgs.runNumber in tHjb_4fl_yt_plus2:
mod_paramcard_name = 'param_card_yt_plus2.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_15:
mod_paramcard_name = 'param_card_CPalpha_15.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_30:
mod_paramcard_name = 'param_card_CPalpha_30.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_45:
mod_paramcard_name = 'param_card_CPalpha_45.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_60:
mod_paramcard_name = 'param_card_CPalpha_60.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_75:
mod_paramcard_name = 'param_card_CPalpha_75.dat'
elif runArgs.runNumber in tHjb_4fl_CPalpha_90:
mod_paramcard_name = 'param_card_CPalpha_90.dat'
else:
raise RuntimeError("No modified param card instuction found for %i ."%runArgs.runNumber)
mod_paramcard = subprocess.Popen(['get_files','-data',mod_paramcard_name]).communicate()
if not os.access(mod_paramcard_name, os.R_OK):
print 'ERROR: Could not get param card'
raise RuntimeError("parameter card '%s' missing!"%mod_paramcard_name)
generate(run_card_loc='run_card.dat',param_card_loc=mod_paramcard_name,mode=mode,njobs=njobs,proc_dir=process_dir,run_name=runName,madspin_card_loc=madspin_card_loc,
grid_pack=gridpack_mode,gridpack_dir=gridpack_dir,nevents=nevents,random_seed=runArgs.randomSeed,required_accuracy=0.001,cluster_type=cluster_type,cluster_queue=cluster_queue)
######
# do not set default, otherwise will not see an error if a DSID is not defined
mod_paramcard_name = ''
## the generate call differs for the cases of using a nominal(SM) or modified(BSM) param card
if runArgs.runNumber in tx0jb_4fl_CPalpha_0:
mod_paramcard_name = 'param_card_CPalpha_0.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_15:
mod_paramcard_name = 'param_card_CPalpha_15.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_30:
mod_paramcard_name = 'param_card_CPalpha_30.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_45:
mod_paramcard_name = 'param_card_CPalpha_45.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_60:
mod_paramcard_name = 'param_card_CPalpha_60.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_75:
mod_paramcard_name = 'param_card_CPalpha_75.dat'
if runArgs.runNumber in tx0jb_4fl_CPalpha_90:
mod_paramcard_name = 'param_card_CPalpha_90.dat'
generate(run_card_loc='run_card.dat',param_card_loc=mod_paramcard_name,mode=mode,njobs=njobs,proc_dir=process_dir,run_name=runName,madspin_card_loc=madspin_card_loc,
grid_pack=gridpack_mode,gridpack_dir=gridpack_dir,nevents=nevents,random_seed=runArgs.randomSeed,required_accuracy=0.001,cluster_type=cluster_type,cluster_queue=cluster_queue)
### common to all jobs
outputDS=arrange_output(run_name=runName,proc_dir=process_dir,lhe_version=3,saveProcDir=True)
if 'ATHENA_PROC_NUMBER' in os.environ:
print 'Noticed that you have run with an athena MP-like whole-node setup. Will re-configure now to make sure that the remainder of the job runs serially.'
njobs = os.environ.pop('ATHENA_PROC_NUMBER')
......@@ -184,22 +125,13 @@ if 'ATHENA_PROC_NUMBER' in os.environ:
else: opts.nprocs = 0
print opts
######
evgenConfig.description = 'aMcAtNlo tHjb'
evgenConfig.description = 'aMcAtNlo tx0jb'
evgenConfig.keywords+=['Higgs', 'tHiggs']
evgenConfig.contact = ['maria.moreno.llacer@cern.ch']
evgenConfig.inputfilecheck = outputDS
evgenConfig.contact = ['maria.moreno.llacer@cern.ch', 'aknue@cern.ch' ]
runArgs.inputGeneratorFile=outputDS
######
## shower settings: if you change these to another shower eg Hw++,
## make sure you update subtraction term ('parton_shower' :'PYTHIA8')
include("MC15JobOptions/Pythia8_A14_NNPDF23LO_EvtGen_Common.py")
include("MC15JobOptions/Pythia8_aMcAtNlo.py")
include("MC15JobOptions/Pythia8_SMHiggs125_inc.py")
## don't include shower weights, see ATLMCPROD-6135
#include("MC15JobOptions/Pythia8_ShowerWeights.py")
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include('MC15JobOptions/MadGraphControl_tHjb_CP_NLO.py')
evgenConfig.inputconfcheck = "tHjb"
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
include( 'MC15JobOptions/MadGraphControl_SimplifiedModel_C1N2_Wh.py' )
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