From 2f17b313ba62e06b9dca6dd97308bdc1b8bfce10 Mon Sep 17 00:00:00 2001 From: Rohin Thampilali Narayan <rnarayan@login05.cm.cluster> Date: Fri, 2 Sep 2022 04:00:22 -0500 Subject: [PATCH 1/5] registering Common top+X EFT samples - ttgamma, t/tH, ttW/j --- .../Common_SMEFTsim_topmW_tHq_reweighted.py | 237 ++++++++++++++++++ 516xxx/516243/log.generate.short | 6 + ...c.MGPy8_tHq_leptons_SMEFTsim_reweighted.py | 14 ++ ...Hq_leptons_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...SMEFTsim_topmW_ttgamma_decay_reweighted.py | 211 ++++++++++++++++ 516xxx/516244/log.generate.short | 7 + ...MGPy8_ttgamma_decay_SMEFTsim_reweighted.py | 18 ++ ...amma_decay_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...sim_topmW_ttgamma_decay_prop_reweighted.py | 211 ++++++++++++++++ 516xxx/516245/log.generate.short | 6 + ..._ttgamma_decay_SMEFTsim_reweighted_prop.py | 18 ++ ...decay_SMEFTsim_reweighted_prop.GRID.tar.gz | 1 + ..._SMEFTsim_topmW_ttgamma_prod_reweighted.py | 211 ++++++++++++++++ 516xxx/516246/log.generate.short | 6 + ....MGPy8_ttgamma_prod_SMEFTsim_reweighted.py | 15 ++ ...gamma_prod_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...Tsim_topmW_ttgamma_prod_prop_reweighted.py | 211 ++++++++++++++++ 516xxx/516247/log.generate.short | 6 + ...8_ttgamma_prod_SMEFTsim_reweighted_prop.py | 15 ++ ..._prod_SMEFTsim_reweighted_prop.GRID.tar.gz | 1 + ...SMEFTsim_topmW_ttH_inclusive_reweighted.py | 237 ++++++++++++++++++ 516xxx/516248/log.generate.short | 6 + ...MGPy8_ttH_inclusive_SMEFTsim_reweighted.py | 14 ++ ..._inclusive_SMEFTsim_reweighted.GRID.tar.gz | 1 + .../Common_SMEFTsim_topmW_ttlv_reweighted.py | 217 ++++++++++++++++ 516xxx/516249/log.generate.short | 6 + .../mc.MGPy8_ttlv_SMEFTsim_reweighted.py | 20 ++ ...MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...mmon_SMEFTsim_topmW_ttwj_ewk_reweighted.py | 229 +++++++++++++++++ 516xxx/516250/log.generate.short | 6 + .../mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py | 16 ++ ...8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz | 1 + 32 files changed, 1951 insertions(+) create mode 100644 516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py create mode 100644 516xxx/516243/log.generate.short create mode 100644 516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py create mode 120000 516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py create mode 100644 516xxx/516244/log.generate.short create mode 100644 516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py create mode 120000 516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py create mode 100644 516xxx/516245/log.generate.short create mode 100644 516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py create mode 120000 516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz create mode 100644 516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py create mode 100644 516xxx/516246/log.generate.short create mode 100644 516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py create mode 120000 516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py create mode 100644 516xxx/516247/log.generate.short create mode 100644 516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py create mode 120000 516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz create mode 100644 516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py create mode 100644 516xxx/516248/log.generate.short create mode 100644 516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py create mode 120000 516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py create mode 100644 516xxx/516249/log.generate.short create mode 100644 516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py create mode 120000 516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py create mode 100644 516xxx/516250/log.generate.short create mode 100644 516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py create mode 120000 516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz diff --git a/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py b/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py new file mode 100644 index 0000000000..861eb66ce3 --- /dev/null +++ b/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py @@ -0,0 +1,237 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-1.,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-0.6,-0.4,-0.3,-0.15,0.1,0.2,0.3,0.4,0.6]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-1,-0.6,-0.3,-0.1,0.1,0.3,0.6,1]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.3,-0.2,0.15,0.3]), + 'cQj38': ('SMEFT', 43, [-0.6,-0.4,0.4,0.6]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-0.5,-0.4,-0.3,-0.2,0.2,0.3,0.4,0.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") +# Higgs decay in Pythia +genSeq.Pythia8.Commands += [ '25:onMode = off', + '25:oneChannel = 1 0.5770 100 5 -5', + '25:addChannel = 1 0.0291 100 4 -4', + '25:addChannel = 1 0.000246 100 3 -3', + '25:addChannel = 1 0.00000 100 6 -6', + '25:addChannel = 1 0.000219 100 13 -13', + '25:addChannel = 1 0.0632 100 15 -15', + '25:addChannel = 1 0.0857 100 21 21', + '25:addChannel = 1 0.00228 100 22 22', + '25:addChannel = 1 0.00154 100 22 23', + '25:addChannel = 1 0.0264 100 23 23', + '25:addChannel = 1 0.2150 100 24 -24' +] diff --git a/516xxx/516243/log.generate.short b/516xxx/516243/log.generate.short new file mode 100644 index 0000000000..f485fa121c --- /dev/null +++ b/516xxx/516243/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.01 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py b/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..6e0b1a05ff --- /dev/null +++ b/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py @@ -0,0 +1,14 @@ +selected_operators = ['cHbox','cHW','ctHRe','ctWRe','cHQ3','cHl311','cll1221','ctWIm','ctHIm'] + +process_definition = 'set group_subprocesses False\n' +process_definition = 'generate p p > t h j QCD=0 QED=3 NP=1 $$ w+ w-, (t > w+ b NP=0, w+ > l+ vl NP=0) @0 NPprop=0 SMHLOOP=0\n' +process_definition+= 'add process p p > t~ h j QCD=0 QED=3 NP=1 $$ w+ w-, (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' + +fixed_scale = 297.5 # ~ m(top)+m(Higgs) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tHq, multilepton, top model, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_tHq_reweighted.py") diff --git a/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..07bdba1c2e --- /dev/null +++ b/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999111/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py b/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516244/log.generate.short b/516xxx/516244/log.generate.short new file mode 100644 index 0000000000..8f56f1fdd0 --- /dev/null +++ b/516xxx/516244/log.generate.short @@ -0,0 +1,7 @@ +- estimated CPU for CI job = 0.09 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 12345 +- EVNT to EVNT = False +- LHEonly = False +- ATHENA_PROC_NUMBER = 0 \ No newline at end of file diff --git a/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py b/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..d88d6ba976 --- /dev/null +++ b/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py @@ -0,0 +1,18 @@ +selected_operators = ['ctGRe','ctWRe','ctBRe','cHQ3','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','ctGIm','ctWIm','ctBIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > ds uc~ b~) @0 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic +, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > ds uc~ b~ a) @1 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic +, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b a), (t~ > l- vl~ b~) @2 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic -, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b), (t~ > l- vl~ b~ a) @3 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic -, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > l- vl~ b~) @4 NPprop=0 SMHLOOP=0 NP=1\n' # di-leptonic, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > l- vl~ b~ a) @5 NPprop=0 SMHLOOP=0 NP=1\n' # di-leptonic, photon in tbar decay + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, decay mode, top model, inclusive, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=5000 + +include("Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py") diff --git a/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..221b7f6137 --- /dev/null +++ b/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999222/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py b/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516245/log.generate.short b/516xxx/516245/log.generate.short new file mode 100644 index 0000000000..9e95762590 --- /dev/null +++ b/516xxx/516245/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.06 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py b/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py new file mode 100644 index 0000000000..df4fd5df22 --- /dev/null +++ b/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py @@ -0,0 +1,18 @@ +selected_operators = ['ctWRe','cHQ3'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > ds uc~ b~) @0 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic +, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > ds uc~ b~ a) @1 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic +, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b a), (t~ > l- vl~ b~) @2 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic -, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b), (t~ > l- vl~ b~ a) @3 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic -, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > l- vl~ b~) @4 NPprop=2 SMHLOOP=0 NP=0\n' # di-leptonic, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > l- vl~ b~ a) @5 NPprop=2 SMHLOOP=0 NP=0\n' # di-leptonic, photon in tbar decay + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, decay mode, top model, inclusive, reweighted, no EFT vertices, propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py") diff --git a/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz b/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz new file mode 120000 index 0000000000..a1f89cc6c2 --- /dev/null +++ b/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999333/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py b/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516246/log.generate.short b/516xxx/516246/log.generate.short new file mode 100644 index 0000000000..8399eacd8d --- /dev/null +++ b/516xxx/516246/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.08 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py b/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..49b8a689a7 --- /dev/null +++ b/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py @@ -0,0 +1,15 @@ +selected_operators = ['ctGRe','ctWRe','ctBRe','cHQ1','cHQ3','cHt','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','ctGIm','ctWIm','ctBIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NPprop=0 SMHLOOP=0\n' # semi-leptonic + +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # semi-leptonic - +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NPprop=0 SMHLOOP=0' # di-leptonic + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, production mode, top model, inclusive, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=5000 + +include("Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py") diff --git a/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..eccdfbc823 --- /dev/null +++ b/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999444/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py b/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516247/log.generate.short b/516xxx/516247/log.generate.short new file mode 100644 index 0000000000..8019419946 --- /dev/null +++ b/516xxx/516247/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.02 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py b/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py new file mode 100644 index 0000000000..6cd6593b24 --- /dev/null +++ b/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py @@ -0,0 +1,15 @@ +selected_operators = ['ctWRe','cHQ3'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NP=0 SMHLOOP=0\n' # semi-leptonic + +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NP=0 SMHLOOP=0\n' # semi-leptonic - +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NP=0 SMHLOOP=0' # di-leptonic + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, production mode, top model, inclusive, reweighted, no EFT vertices, propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py") diff --git a/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz b/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz new file mode 120000 index 0000000000..573e2c636a --- /dev/null +++ b/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999555/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py b/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py new file mode 100644 index 0000000000..78f5d4f887 --- /dev/null +++ b/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py @@ -0,0 +1,237 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "/nfs/users/bravina/ttZ_EFT/CommonTopX/OfficialTTGAMMA/SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2','cluster_type':'condor','cluster_queue':'workday','cluster_nb_retry':'10'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-0.8,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.8,-0.6,0.2,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") +# Higgs decay in Pythia +genSeq.Pythia8.Commands += [ '25:onMode = off', + '25:oneChannel = 1 0.5770 100 5 -5', + '25:addChannel = 1 0.0291 100 4 -4', + '25:addChannel = 1 0.000246 100 3 -3', + '25:addChannel = 1 0.00000 100 6 -6', + '25:addChannel = 1 0.000219 100 13 -13', + '25:addChannel = 1 0.0632 100 15 -15', + '25:addChannel = 1 0.0857 100 21 21', + '25:addChannel = 1 0.00228 100 22 22', + '25:addChannel = 1 0.00154 100 22 23', + '25:addChannel = 1 0.0264 100 23 23', + '25:addChannel = 1 0.2150 100 24 -24' +] diff --git a/516xxx/516248/log.generate.short b/516xxx/516248/log.generate.short new file mode 100644 index 0000000000..67efb3ec16 --- /dev/null +++ b/516xxx/516248/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.04 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py b/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..aefc11c41d --- /dev/null +++ b/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py @@ -0,0 +1,14 @@ +selected_operators = ['cHbox','cHG','ctHRe','ctGRe','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','cHl311','cll1221','ctGIm','ctHIm'] + +process_definition = 'set group_subprocesses False\ndefine wdec = u u~ c c~ d d~ s s~ l- l- vl vl~\n' # define inclusive W decay +process_definition+= 'generate p p > t t~ h / z a h w+ w- QCD=2 QED=3, (t > wdec wdec b NP=0), (t~ > wdec wdec b~ NP=0) @0 NPprop=0 SMHLOOP=0 NP=1\n' +process_definition+= 'add process p p > t t~ h j / z a h w+ w- QCD=3 QED=3, (t > wdec wdec b NP=0), (t~ > wdec wdec b~ NP=0) @1 NPprop=0 SMHLOOP=0 NP=1\n' + +fixed_scale = 470.0 # ~ 2*m(top)+m(Higgs) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+H, inclusive, top model, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=2000 + +include("Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py") diff --git a/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..71403e9ed5 --- /dev/null +++ b/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999666/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py b/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py new file mode 100644 index 0000000000..2156b940c1 --- /dev/null +++ b/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py @@ -0,0 +1,217 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.4,-0.3,-0.2,-0.1,-0.05,0.05,0.1,0.2,0.3,0.4]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.4,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-3,-1.55,1,3]), + 'ctu8': ('SMEFT', 50, [-5,3,3,5]), + 'ctd1': ('SMEFT', 58, [-6,-3,3,6]), + 'ctd8': ('SMEFT', 62, [-14,-10,4,9]), + 'cQu1': ('SMEFT', 67, [-14,-10,4,9]), + 'cQu8': ('SMEFT', 69, [-14,-10,4,9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-1.4,-1,0.4,0.9]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.4,0.9]), + 'cQd1': ('SMEFT', 76, [-14,-10,4,9]), + 'cQd8': ('SMEFT', 77, [-14,-10,4,9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'cleQt1Re11':('SMEFT', 196, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re22':('SMEFT', 197, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re33':('SMEFT', 198, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt3Re11':('SMEFT', 202, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re22':('SMEFT', 203, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re33':('SMEFT', 204, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.6,0.6,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516249/log.generate.short b/516xxx/516249/log.generate.short new file mode 100644 index 0000000000..30a692caf6 --- /dev/null +++ b/516xxx/516249/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.03 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py b/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..e37bbf0fa6 --- /dev/null +++ b/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py @@ -0,0 +1,20 @@ +selected_operators = ['ctGRe','ctWRe','cQj11','cQj18','cQj31','cQj38','ctj1','ctj8','ctGIm','ctWIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ l+ vl / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NPprop=0 SMHLOOP=0\n' # dileptonic ++ +process_definition+= 'add process p p > t t~ l- vl~ / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # dileptonic -- +process_definition+= 'add process p p > t t~ l+ vl / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NPprop=0 SMHLOOP=0\n' # trileptonic + +process_definition+= 'add process p p > t t~ l- vl~ / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @3 NPprop=0 SMHLOOP=0\n' # trileptonic - +process_definition+= 'add process p p > t t~ l+ vl j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @4 NPprop=0 SMHLOOP=0\n' # dileptonic ++ extra jet +process_definition+= 'add process p p > t t~ l- vl~ j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @5 NPprop=0 SMHLOOP=0\n' # dileptonic -- extra jet +process_definition+= 'add process p p > t t~ l+ vl j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @6 NPprop=0 SMHLOOP=0\n' # trileptonic + extra jet +process_definition+= 'add process p p > t t~ l- vl~ j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @7 NPprop=0 SMHLOOP=0\n' # trileptonic - extra jet + +fixed_scale = 425.0 # ~ 2*m(top)+m(W) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+W, top model, multilepton (2LSS/3L), reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttlv_reweighted.py") diff --git a/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..332d4e3296 --- /dev/null +++ b/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999777/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py b/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py new file mode 100644 index 0000000000..e84daa963d --- /dev/null +++ b/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py @@ -0,0 +1,229 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'})#,'cluster_type':'condor','cluster_queue':'workday','cluster_nb_retry':'10'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-0.8,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.4,-0.3,-0.2,-0.1,-0.05,0.05,0.1,0.2,0.3,0.4]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.4,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-3,-1.55,1,3]), + 'ctu8': ('SMEFT', 50, [-5,3,3,5]), + 'ctd1': ('SMEFT', 58, [-6,-3,3,6]), + 'ctd8': ('SMEFT', 62, [-14,-10,4,9]), + 'cQu1': ('SMEFT', 67, [-14,-10,4,9]), + 'cQu8': ('SMEFT', 69, [-14,-10,4,9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-1.4,-1,0.4,0.9]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.4,0.9]), + 'cQd1': ('SMEFT', 76, [-14,-10,4,9]), + 'cQd8': ('SMEFT', 77, [-14,-10,4,9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'cleQt1Re11':('SMEFT', 196, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re22':('SMEFT', 197, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re33':('SMEFT', 198, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt3Re11':('SMEFT', 202, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re22':('SMEFT', 203, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re33':('SMEFT', 204, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.6,0.6,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516250/log.generate.short b/516xxx/516250/log.generate.short new file mode 100644 index 0000000000..bb866bc4c6 --- /dev/null +++ b/516xxx/516250/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.05 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py b/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..e94d9a663d --- /dev/null +++ b/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py @@ -0,0 +1,16 @@ +selected_operators = ['cHbox','cHG','cHW','ctHRe','ctGRe','ctWRe','ctBRe','cHQ1','cHQ3','cHt','cHl311','cll1221','ctGIm','ctWIm','ctBIm','ctHIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ w+ j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0), (w+ > l+ vl NP=0) @0 NPprop=0 SMHLOOP=0\n' # dileptonic ++ +process_definition+= 'add process p p > t t~ w- j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # dileptonic -- +process_definition+= 'add process p p > t t~ w+ j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w+ > l+ vl NP=0) @2 NPprop=0 SMHLOOP=0\n' # trileptonic + +process_definition+= 'add process p p > t t~ w- j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w- > l- vl~ NP=0) @3 NPprop=0 SMHLOOP=0' # trileptonic - + +fixed_scale = 425.0 # ~ 2*m(top)+m(W) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+W EWK, top model, multilepton (2LSS/3L), reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py") diff --git a/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..6e0656382d --- /dev/null +++ b/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999888/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file -- GitLab From 5f0036ed806c3c9ba8de9b7fddf6e7a2a456bfcf Mon Sep 17 00:00:00 2001 From: Rohin Thampilali Narayan <rnarayan@login05.cm.cluster> Date: Fri, 2 Sep 2022 04:00:22 -0500 Subject: [PATCH 2/5] registering Common top+X EFT samples - ttgamma, t/tH, ttW/j --- .../Common_SMEFTsim_topmW_tHq_reweighted.py | 237 ++++++++++++++++++ 516xxx/516243/log.generate.short | 6 + ...c.MGPy8_tHq_leptons_SMEFTsim_reweighted.py | 14 ++ ...Hq_leptons_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...SMEFTsim_topmW_ttgamma_decay_reweighted.py | 211 ++++++++++++++++ 516xxx/516244/log.generate.short | 7 + ...MGPy8_ttgamma_decay_SMEFTsim_reweighted.py | 18 ++ ...amma_decay_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...sim_topmW_ttgamma_decay_prop_reweighted.py | 211 ++++++++++++++++ 516xxx/516245/log.generate.short | 6 + ..._ttgamma_decay_SMEFTsim_reweighted_prop.py | 18 ++ ...decay_SMEFTsim_reweighted_prop.GRID.tar.gz | 1 + ..._SMEFTsim_topmW_ttgamma_prod_reweighted.py | 211 ++++++++++++++++ 516xxx/516246/log.generate.short | 6 + ....MGPy8_ttgamma_prod_SMEFTsim_reweighted.py | 15 ++ ...gamma_prod_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...Tsim_topmW_ttgamma_prod_prop_reweighted.py | 211 ++++++++++++++++ 516xxx/516247/log.generate.short | 6 + ...8_ttgamma_prod_SMEFTsim_reweighted_prop.py | 15 ++ ..._prod_SMEFTsim_reweighted_prop.GRID.tar.gz | 1 + ...SMEFTsim_topmW_ttH_inclusive_reweighted.py | 237 ++++++++++++++++++ 516xxx/516248/log.generate.short | 6 + ...MGPy8_ttH_inclusive_SMEFTsim_reweighted.py | 14 ++ ..._inclusive_SMEFTsim_reweighted.GRID.tar.gz | 1 + .../Common_SMEFTsim_topmW_ttlv_reweighted.py | 217 ++++++++++++++++ 516xxx/516249/log.generate.short | 6 + .../mc.MGPy8_ttlv_SMEFTsim_reweighted.py | 20 ++ ...MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz | 1 + ...mmon_SMEFTsim_topmW_ttwj_ewk_reweighted.py | 229 +++++++++++++++++ 516xxx/516250/log.generate.short | 6 + .../mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py | 16 ++ ...8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz | 1 + 32 files changed, 1951 insertions(+) create mode 100644 516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py create mode 100644 516xxx/516243/log.generate.short create mode 100644 516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py create mode 120000 516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py create mode 100644 516xxx/516244/log.generate.short create mode 100644 516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py create mode 120000 516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py create mode 100644 516xxx/516245/log.generate.short create mode 100644 516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py create mode 120000 516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz create mode 100644 516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py create mode 100644 516xxx/516246/log.generate.short create mode 100644 516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py create mode 120000 516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py create mode 100644 516xxx/516247/log.generate.short create mode 100644 516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py create mode 120000 516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz create mode 100644 516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py create mode 100644 516xxx/516248/log.generate.short create mode 100644 516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py create mode 120000 516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py create mode 100644 516xxx/516249/log.generate.short create mode 100644 516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py create mode 120000 516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz create mode 100644 516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py create mode 100644 516xxx/516250/log.generate.short create mode 100644 516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py create mode 120000 516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz diff --git a/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py b/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py new file mode 100644 index 0000000000..861eb66ce3 --- /dev/null +++ b/516xxx/516243/Common_SMEFTsim_topmW_tHq_reweighted.py @@ -0,0 +1,237 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-1.,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-0.6,-0.4,-0.3,-0.15,0.1,0.2,0.3,0.4,0.6]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-1,-0.6,-0.3,-0.1,0.1,0.3,0.6,1]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.3,-0.2,0.15,0.3]), + 'cQj38': ('SMEFT', 43, [-0.6,-0.4,0.4,0.6]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-0.5,-0.4,-0.3,-0.2,0.2,0.3,0.4,0.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") +# Higgs decay in Pythia +genSeq.Pythia8.Commands += [ '25:onMode = off', + '25:oneChannel = 1 0.5770 100 5 -5', + '25:addChannel = 1 0.0291 100 4 -4', + '25:addChannel = 1 0.000246 100 3 -3', + '25:addChannel = 1 0.00000 100 6 -6', + '25:addChannel = 1 0.000219 100 13 -13', + '25:addChannel = 1 0.0632 100 15 -15', + '25:addChannel = 1 0.0857 100 21 21', + '25:addChannel = 1 0.00228 100 22 22', + '25:addChannel = 1 0.00154 100 22 23', + '25:addChannel = 1 0.0264 100 23 23', + '25:addChannel = 1 0.2150 100 24 -24' +] diff --git a/516xxx/516243/log.generate.short b/516xxx/516243/log.generate.short new file mode 100644 index 0000000000..f485fa121c --- /dev/null +++ b/516xxx/516243/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.01 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py b/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..6e0b1a05ff --- /dev/null +++ b/516xxx/516243/mc.MGPy8_tHq_leptons_SMEFTsim_reweighted.py @@ -0,0 +1,14 @@ +selected_operators = ['cHbox','cHW','ctHRe','ctWRe','cHQ3','cHl311','cll1221','ctWIm','ctHIm'] + +process_definition = 'set group_subprocesses False\n' +process_definition = 'generate p p > t h j QCD=0 QED=3 NP=1 $$ w+ w-, (t > w+ b NP=0, w+ > l+ vl NP=0) @0 NPprop=0 SMHLOOP=0\n' +process_definition+= 'add process p p > t~ h j QCD=0 QED=3 NP=1 $$ w+ w-, (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' + +fixed_scale = 297.5 # ~ m(top)+m(Higgs) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tHq, multilepton, top model, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_tHq_reweighted.py") diff --git a/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..07bdba1c2e --- /dev/null +++ b/516xxx/516243/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999111/mc_13TeV.MGPy8_tHq_leptons_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py b/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516244/Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516244/log.generate.short b/516xxx/516244/log.generate.short new file mode 100644 index 0000000000..8f56f1fdd0 --- /dev/null +++ b/516xxx/516244/log.generate.short @@ -0,0 +1,7 @@ +- estimated CPU for CI job = 0.09 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 12345 +- EVNT to EVNT = False +- LHEonly = False +- ATHENA_PROC_NUMBER = 0 \ No newline at end of file diff --git a/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py b/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..d88d6ba976 --- /dev/null +++ b/516xxx/516244/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted.py @@ -0,0 +1,18 @@ +selected_operators = ['ctGRe','ctWRe','ctBRe','cHQ3','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','ctGIm','ctWIm','ctBIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > ds uc~ b~) @0 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic +, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > ds uc~ b~ a) @1 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic +, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b a), (t~ > l- vl~ b~) @2 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic -, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b), (t~ > l- vl~ b~ a) @3 NPprop=0 SMHLOOP=0 NP=1\n' # semi-leptonic -, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > l- vl~ b~) @4 NPprop=0 SMHLOOP=0 NP=1\n' # di-leptonic, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > l- vl~ b~ a) @5 NPprop=0 SMHLOOP=0 NP=1\n' # di-leptonic, photon in tbar decay + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, decay mode, top model, inclusive, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=5000 + +include("Common_SMEFTsim_topmW_ttgamma_decay_reweighted.py") diff --git a/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..221b7f6137 --- /dev/null +++ b/516xxx/516244/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999222/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py b/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516245/Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516245/log.generate.short b/516xxx/516245/log.generate.short new file mode 100644 index 0000000000..9e95762590 --- /dev/null +++ b/516xxx/516245/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.06 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py b/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py new file mode 100644 index 0000000000..df4fd5df22 --- /dev/null +++ b/516xxx/516245/mc.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.py @@ -0,0 +1,18 @@ +selected_operators = ['ctWRe','cHQ3'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > ds uc~ b~) @0 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic +, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > ds uc~ b~ a) @1 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic +, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b a), (t~ > l- vl~ b~) @2 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic -, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > uc ds~ b), (t~ > l- vl~ b~ a) @3 NPprop=2 SMHLOOP=0 NP=0\n' # semi-leptonic -, photon in tbar decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b a), (t~ > l- vl~ b~) @4 NPprop=2 SMHLOOP=0 NP=0\n' # di-leptonic, photon in top decay +process_definition+= 'add process p p > t t~ QCD=2 QED=2 / w+ w- z h a, (t > l+ vl b), (t~ > l- vl~ b~ a) @5 NPprop=2 SMHLOOP=0 NP=0\n' # di-leptonic, photon in tbar decay + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, decay mode, top model, inclusive, reweighted, no EFT vertices, propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttgamma_decay_prop_reweighted.py") diff --git a/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz b/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz new file mode 120000 index 0000000000..a1f89cc6c2 --- /dev/null +++ b/516xxx/516245/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999333/mc_13TeV.MGPy8_ttgamma_decay_SMEFTsim_reweighted_prop.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py b/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516246/Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516246/log.generate.short b/516xxx/516246/log.generate.short new file mode 100644 index 0000000000..8399eacd8d --- /dev/null +++ b/516xxx/516246/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.08 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py b/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..49b8a689a7 --- /dev/null +++ b/516xxx/516246/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted.py @@ -0,0 +1,15 @@ +selected_operators = ['ctGRe','ctWRe','ctBRe','cHQ1','cHQ3','cHt','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','ctGIm','ctWIm','ctBIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NPprop=0 SMHLOOP=0\n' # semi-leptonic + +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # semi-leptonic - +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NPprop=0 SMHLOOP=0' # di-leptonic + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, production mode, top model, inclusive, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=5000 + +include("Common_SMEFTsim_topmW_ttgamma_prod_reweighted.py") diff --git a/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..eccdfbc823 --- /dev/null +++ b/516xxx/516246/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999444/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py b/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py new file mode 100644 index 0000000000..8d42ac1bf4 --- /dev/null +++ b/516xxx/516247/Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py @@ -0,0 +1,211 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516247/log.generate.short b/516xxx/516247/log.generate.short new file mode 100644 index 0000000000..8019419946 --- /dev/null +++ b/516xxx/516247/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.02 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py b/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py new file mode 100644 index 0000000000..6cd6593b24 --- /dev/null +++ b/516xxx/516247/mc.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.py @@ -0,0 +1,15 @@ +selected_operators = ['ctWRe','cHQ3'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NP=0 SMHLOOP=0\n' # semi-leptonic + +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NP=0 SMHLOOP=0\n' # semi-leptonic - +process_definition+= 'add process p p > t t~ a QCD=2 QED=3 NPprop=2, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NP=0 SMHLOOP=0' # di-leptonic + +fixed_scale = 431.25 # ~ 2.5*m(top) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+photon, production mode, top model, inclusive, reweighted, no EFT vertices, propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttgamma_prod_prop_reweighted.py") diff --git a/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz b/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz new file mode 120000 index 0000000000..573e2c636a --- /dev/null +++ b/516xxx/516247/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999555/mc_13TeV.MGPy8_ttgamma_prod_SMEFTsim_reweighted_prop.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py b/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py new file mode 100644 index 0000000000..78f5d4f887 --- /dev/null +++ b/516xxx/516248/Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py @@ -0,0 +1,237 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "/nfs/users/bravina/ttZ_EFT/CommonTopX/OfficialTTGAMMA/SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2','cluster_type':'condor','cluster_queue':'workday','cluster_nb_retry':'10'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-0.8,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.5,-0.4,0.3,0.5]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.6,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-0.3,-0.15,0.1,0.3]), + 'ctu8': ('SMEFT', 50, [-0.5,-0.3,0.3,0.5]), + 'ctd1': ('SMEFT', 58, [-0.6,-0.3,0.3,0.6]), + 'ctd8': ('SMEFT', 62, [-1.4,-1,0.4,0.9]), + 'cQu1': ('SMEFT', 67, [-1.4,-1,0.4,0.9]), + 'cQu8': ('SMEFT', 69, [-1.4,-1,0.4,0.9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.8,-0.6,0.2,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-2.6,-1.2,1.3,2.4]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.8,1.3]), + 'cQd1': ('SMEFT', 76, [-1.4,-1,0.4,0.9]), + 'cQd8': ('SMEFT', 77, [-1.4,-1,0.4,0.9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.8,0.8,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") +# Higgs decay in Pythia +genSeq.Pythia8.Commands += [ '25:onMode = off', + '25:oneChannel = 1 0.5770 100 5 -5', + '25:addChannel = 1 0.0291 100 4 -4', + '25:addChannel = 1 0.000246 100 3 -3', + '25:addChannel = 1 0.00000 100 6 -6', + '25:addChannel = 1 0.000219 100 13 -13', + '25:addChannel = 1 0.0632 100 15 -15', + '25:addChannel = 1 0.0857 100 21 21', + '25:addChannel = 1 0.00228 100 22 22', + '25:addChannel = 1 0.00154 100 22 23', + '25:addChannel = 1 0.0264 100 23 23', + '25:addChannel = 1 0.2150 100 24 -24' +] diff --git a/516xxx/516248/log.generate.short b/516xxx/516248/log.generate.short new file mode 100644 index 0000000000..67efb3ec16 --- /dev/null +++ b/516xxx/516248/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.04 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py b/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..aefc11c41d --- /dev/null +++ b/516xxx/516248/mc.MGPy8_ttH_inclusive_SMEFTsim_reweighted.py @@ -0,0 +1,14 @@ +selected_operators = ['cHbox','cHG','ctHRe','ctGRe','cQj11','cQj18','cQj31','cQj38','cQQ1','cQQ8','ctu1','ctu8','ctd1','ctd8','cQu1','cQu8','ctj1','ctj8','cQt1','cQt8','cQd1','cQd8','cHl311','cll1221','ctGIm','ctHIm'] + +process_definition = 'set group_subprocesses False\ndefine wdec = u u~ c c~ d d~ s s~ l- l- vl vl~\n' # define inclusive W decay +process_definition+= 'generate p p > t t~ h / z a h w+ w- QCD=2 QED=3, (t > wdec wdec b NP=0), (t~ > wdec wdec b~ NP=0) @0 NPprop=0 SMHLOOP=0 NP=1\n' +process_definition+= 'add process p p > t t~ h j / z a h w+ w- QCD=3 QED=3, (t > wdec wdec b NP=0), (t~ > wdec wdec b~ NP=0) @1 NPprop=0 SMHLOOP=0 NP=1\n' + +fixed_scale = 470.0 # ~ 2*m(top)+m(Higgs) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+H, inclusive, top model, reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=2000 + +include("Common_SMEFTsim_topmW_ttH_inclusive_reweighted.py") diff --git a/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..71403e9ed5 --- /dev/null +++ b/516xxx/516248/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999666/mc_13TeV.MGPy8_ttH_inclusive_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py b/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py new file mode 100644 index 0000000000..2156b940c1 --- /dev/null +++ b/516xxx/516249/Common_SMEFTsim_topmW_ttlv_reweighted.py @@ -0,0 +1,217 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.4,-0.3,-0.2,-0.1,-0.05,0.05,0.1,0.2,0.3,0.4]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.4,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-3,-1.55,1,3]), + 'ctu8': ('SMEFT', 50, [-5,3,3,5]), + 'ctd1': ('SMEFT', 58, [-6,-3,3,6]), + 'ctd8': ('SMEFT', 62, [-14,-10,4,9]), + 'cQu1': ('SMEFT', 67, [-14,-10,4,9]), + 'cQu8': ('SMEFT', 69, [-14,-10,4,9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-1.4,-1,0.4,0.9]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.4,0.9]), + 'cQd1': ('SMEFT', 76, [-14,-10,4,9]), + 'cQd8': ('SMEFT', 77, [-14,-10,4,9]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'cleQt1Re11':('SMEFT', 196, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re22':('SMEFT', 197, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re33':('SMEFT', 198, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt3Re11':('SMEFT', 202, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re22':('SMEFT', 203, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re33':('SMEFT', 204, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.6,0.6,1,1.5]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516249/log.generate.short b/516xxx/516249/log.generate.short new file mode 100644 index 0000000000..30a692caf6 --- /dev/null +++ b/516xxx/516249/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.03 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py b/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..e37bbf0fa6 --- /dev/null +++ b/516xxx/516249/mc.MGPy8_ttlv_SMEFTsim_reweighted.py @@ -0,0 +1,20 @@ +selected_operators = ['ctGRe','ctWRe','cQj11','cQj18','cQj31','cQj38','ctj1','ctj8','ctGIm','ctWIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ l+ vl / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @0 NPprop=0 SMHLOOP=0\n' # dileptonic ++ +process_definition+= 'add process p p > t t~ l- vl~ / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # dileptonic -- +process_definition+= 'add process p p > t t~ l+ vl / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @2 NPprop=0 SMHLOOP=0\n' # trileptonic + +process_definition+= 'add process p p > t t~ l- vl~ / h z a b QCD=2 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @3 NPprop=0 SMHLOOP=0\n' # trileptonic - +process_definition+= 'add process p p > t t~ l+ vl j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0) @4 NPprop=0 SMHLOOP=0\n' # dileptonic ++ extra jet +process_definition+= 'add process p p > t t~ l- vl~ j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @5 NPprop=0 SMHLOOP=0\n' # dileptonic -- extra jet +process_definition+= 'add process p p > t t~ l+ vl j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @6 NPprop=0 SMHLOOP=0\n' # trileptonic + extra jet +process_definition+= 'add process p p > t t~ l- vl~ j / h z a b QCD=3 QED=4 NP=1, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0) @7 NPprop=0 SMHLOOP=0\n' # trileptonic - extra jet + +fixed_scale = 425.0 # ~ 2*m(top)+m(W) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+W, top model, multilepton (2LSS/3L), reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttlv_reweighted.py") diff --git a/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..332d4e3296 --- /dev/null +++ b/516xxx/516249/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999777/mc_13TeV.MGPy8_ttlv_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file diff --git a/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py b/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py new file mode 100644 index 0000000000..e84daa963d --- /dev/null +++ b/516xxx/516250/Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py @@ -0,0 +1,229 @@ +from MadGraphControl.MadGraphUtils import * +from MCJobOptionUtils.JOsupport import get_physics_short + +# TO USE THIS CONTROL FILE: +# - create a separate JO for your process, e.g. mc.MGPy8_ttll_SMEFTsim_reweighted.py +# - declare "selected_operators", a list of SMEFTsim operators that is a subset of the keys of the "eft_dict" below +# - declare "process_definition", a string that will be appended to "process" below and MUST contain at least the relevant MG generate command +# - declare "fixed_scale", a float to fix muR=muF (because MG doesn't run the WCs). Recommended: = sum(masses)_{final state particles} +# - declare "gridpack", a bool indicating whether generation (and possibly reweighting) is to be run from a gridpack +# - declare "evgenConfig.description", a sufficiently descriptive string for the sample metadata, +# e.g. 'SMEFTsim 3.0 tt+ll, top model, inclusive, reweighted, EFT vertices, no propagator correction' +# - include this file, using the appropriate relative path + +# general parameters +nevents = runArgs.maxEvents if runArgs.maxEvents>0 else evgenConfig.nEventsPerJob +nevents *= 1.1 # safety factor +mllcut = 5 +lhe_version = 3 + +# process definition +model = "SMEFTsim_top_MwScheme_UFO-massless_topX" +if "_prop" in get_physics_short(): + model = "SMEFTsim_top_MwScheme_PropCorr_UFO-massless_topX" + +process = ''' +import model ''' + model + ''' +define p = g u c d s b u~ c~ d~ s~ b~ +define j = g u c d s b u~ c~ d~ s~ b~ +define w = w+ w- +define l+ = e+ mu+ ta+ +define l- = e- mu- ta- +define wdec = l+ l- vl vl~ j +''' + process_definition + ''' +output -f +''' +process_dir = new_process(process) + +modify_config_card(process_dir=process_dir,settings={'f2py_compiler':'f2py2','f2py_compiler_py2':'f2py2'})#,'cluster_type':'condor','cluster_queue':'workday','cluster_nb_retry':'10'}) + +# run card settings +settings = { + 'nevents' : nevents, + 'maxjetflavor' : 5, + 'pdlabel' : 'lhapdf', + 'lhaid' : 262000, + 'use_syst' : 'False', + 'ptj' : '20.0', + 'ptl' : '7.0', + 'etaj' : '4.5', + 'etal' : '2.5', + 'drjj' : '0.0', + 'drll' : '0.0', + 'drjl' : '0.0', + 'mmll' : mllcut, + 'dynamical_scale_choice': '0', + 'fixed_ren_scale' : 'True', + 'fixed_fac_scale' : 'True', + 'scale' : fixed_scale, + 'dsqrt_q2fact1' : fixed_scale, + 'dsqrt_q2fact2' : fixed_scale, + 'ickkw' : 0, + 'xqcut' : 0, + 'asrwgtflavor' : 5, + 'draj' : '0.0', + 'dral' : '0.0', + 'ptgmin' : '15.0', + 'R0gamma' : '0.1', + 'xn' : '2', + 'epsgamma' : '0.1', + 'etaa' : '5.0', +} + +modify_run_card(process_dir=process_dir, + runArgs=runArgs, + settings=settings) + +# SM param card settings +params = dict() +params['mass'] = dict() +params['mass']['6'] = '1.725000e+02' +params['mass']['23'] = '9.118760e+01' +params['mass']['24'] = '8.039900e+01' +params['mass']['25'] = '1.250000e+02' +params['yukawa'] = dict() +params['yukawa']['6'] = '1.725000e+02' +params['DECAY'] = dict() +params['DECAY']['23'] = 'DECAY 23 2.495200e+00' +params['DECAY']['24'] = '''DECAY 24 2.085000e+00 + 3.377000e-01 2 -1 2 + 3.377000e-01 2 -3 4 + 1.082000e-01 2 -11 12 + 1.082000e-01 2 -13 14 + 1.082000e-01 2 -15 16''' +params['DECAY']['25'] = 'DECAY 25 6.382339e-03' + +modify_param_card(process_dir=process_dir,params=params) + +# EFT param card settings +params = dict() +params['SMEFTcutoff'] = dict() +params['SMEFTcutoff']['1'] = '1.000000e+03' +modify_param_card(process_dir=process_dir,params=params) + +# build a dictionary of EFT operators: dict[operator name] = (block, id, [values]) +eft_dict = { + 'cHbox': ('SMEFT', 4, [-1.,-0.5,0.5,1]), + 'cHG': ('SMEFT', 6, [-0.8,-0.5,0.5,1]), + 'cHW': ('SMEFT', 7, [-1.,-0.5,0.5,1]), + 'cHB': ('SMEFT', 8, [-1.,-0.5,0.5,1]), + 'ctHRe': ('SMEFT', 11, [-1.,-0.5,0.5,1]), + 'ctGRe': ('SMEFT', 15, [-1.2,-0.8,-0.4,-0.2,0.3,0.5,0.8,1.2]), + 'ctWRe': ('SMEFT', 17, [-1.3,-1,-0.7,-0.3,0.2,0.7,1,1.3]), + 'ctBRe': ('SMEFT', 19, [-1.5,-0.9,-0.3,0.3,0.9,1.5]), + 'cHQ1': ('SMEFT', 27, [-5,-2,-1,1,2,5]), + 'cHQ3': ('SMEFT', 29, [-5,-2,-1,1,2,5]), + 'cHt': ('SMEFT', 31, [-5,-2,-1,1,2,5]), + 'cHtbRe': ('SMEFT', 35, [-1.,-0.5,0.5,1]), + 'cQj11': ('SMEFT', 40, [-0.5,-0.3,0.3,0.5]), + 'cQj18': ('SMEFT', 41, [-1.3,-0.9,0.3,0.7]), + 'cQj31': ('SMEFT', 42, [-0.4,-0.3,-0.2,-0.1,-0.05,0.05,0.1,0.2,0.3,0.4]), + 'cQj38': ('SMEFT', 43, [-0.8,-0.4,0.4,0.8]), + 'cQQ1': ('SMEFT', 44, [-1.4,-1,0.4,0.9]), + 'cQQ8': ('SMEFT', 45, [-1.4,-1,0.4,0.9]), + 'ctu1': ('SMEFT', 49, [-3,-1.55,1,3]), + 'ctu8': ('SMEFT', 50, [-5,3,3,5]), + 'ctd1': ('SMEFT', 58, [-6,-3,3,6]), + 'ctd8': ('SMEFT', 62, [-14,-10,4,9]), + 'cQu1': ('SMEFT', 67, [-14,-10,4,9]), + 'cQu8': ('SMEFT', 69, [-14,-10,4,9]), + 'ctj1': ('SMEFT', 70, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'ctj8': ('SMEFT', 71, [-1.4,-1,-0.1,-0.05,-0.02,0.02,0.05,0.1,0.4,0.9]), + 'cQt1': ('SMEFT', 72, [-1.4,-1,0.4,0.9]), + 'cQt8': ('SMEFT', 73, [-1.4,-1,0.4,0.9]), + 'cQd1': ('SMEFT', 76, [-14,-10,4,9]), + 'cQd8': ('SMEFT', 77, [-14,-10,4,9]), + 'ceHRe33':('SMEFT', 102, [-1.,-0.5,0.5,1]), + 'cHl311': ('SMEFT', 112, [-1.,-0.5,0.5,1]), + 'cll1221':('SMEFT', 124, [-1.,-0.5,0.5,1]), + 'cQl111': ('SMEFT', 133, [-5,-1,1,5]), + 'cQl122': ('SMEFT', 134, [-5,-1,1,5]), + 'cQl133': ('SMEFT', 135, [-5,-3,3,5]), + 'cQl311': ('SMEFT', 136, [-5,-1,1,5]), + 'cQl322': ('SMEFT', 137, [-1.1,-0.6,0.6,1.1]), + 'cQl333': ('SMEFT', 138, [-5,-1,1,3,5]), + 'cte11': ('SMEFT', 148, [-2.4,-1,1,3]), + 'cte22': ('SMEFT', 149, [-3,-1,1,5]), + 'cte33': ('SMEFT', 150, [-5,-1,1,5]), + 'cQe11': ('SMEFT', 160, [-2.4,-1,1,3]), + 'cQe22': ('SMEFT', 161, [-3,-1,1,5]), + 'cQe33': ('SMEFT', 162, [-5,-1,1,5]), + 'ctl11': ('SMEFT', 166, [-2.4,-1,1,3]), + 'ctl22': ('SMEFT', 167, [-3,-1,1,5]), + 'ctl33': ('SMEFT', 168, [-5,-1,1,5]), + 'cleQt1Re11':('SMEFT', 196, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re22':('SMEFT', 197, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt1Re33':('SMEFT', 198, [-4.,-3.,-2.,2.,3.,4.]), + 'cleQt3Re11':('SMEFT', 202, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re22':('SMEFT', 203, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'cleQt3Re33':('SMEFT', 204, [-1.2,-0.8,-0.4,0.4,0.8,1.2]), + 'ctGIm': ('SMEFTcpv', 8, [-1.5,-1,-0.4,-0.3,0.3,0.5,1,1.5]), + 'ctWIm': ('SMEFTcpv', 10, [-1.5,-1.1,-0.8,0.6,1,1.5]), + 'ctBIm': ('SMEFTcpv', 12, [-1.5,-1,-0.6,0.6,1,1.5]), + 'ctHIm': ('SMEFTcpv', 20, [-1.,-0.5,0.5,1]), + 'cHtbIm': ('SMEFTcpv', 24, [-1.,-0.5,0.5,1]), + 'ceHIm33':('SMEFTcpv', 47, [-1.,-0.5,0.5,1]), +} + +# convert operator values to text format +def value_to_string(value): + if value > 0: + string = "p" + else: + string = "m" + string += "{:.1f}".format(abs(value)).replace(".","p") + return string + +# define reweighting points +reweight_commands = "change rwgt_dir rwgt\n" +reweight_commands+= "change keep_ordering True\n" +for operator in selected_operators: + block = eft_dict[operator][0] + idnumber = eft_dict[operator][1] + for value in eft_dict[operator][2]: + reweight_commands += "launch --rwgt_info=" + operator + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block + " " +str(idnumber) + " " + str(value) + "\n" +for i,operator1 in enumerate(selected_operators): + block1 = eft_dict[operator1][0] + idnumber1 = eft_dict[operator1][1] + for operator2 in selected_operators[i+1:]: + block2 = eft_dict[operator][0] + idnumber2 = eft_dict[operator2][1] + # avoid going beyond 1000 weights if possible + if len(selected_operators) <= 30: + for value in [-0.3,0.4]: + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value) + "_" + operator2 + "_" + value_to_string(value) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value) + "\n" + else: + value1 = -0.3 + value2 = 0.4 + reweight_commands += "launch --rwgt_info=" + operator1 + "_" + value_to_string(value1) + "_" + operator2 + "_" + value_to_string(value2) + "\n" + reweight_commands += "set "+ block1 + " " + str(idnumber1) + " " + str(value1) + "\n" + reweight_commands += "set "+ block2 + " " + str(idnumber2) + " " + str(value2) + "\n" + +# write to reweight card +reweight_card = process_dir+'/Cards/reweight_card.dat' +reweight_card_f = open(reweight_card,'w') +reweight_card_f.write(reweight_commands) +reweight_card_f.close() + +print_cards() + +generate(process_dir=process_dir, + grid_pack=gridpack, + gridpack_compile=False, + required_accuracy=0.001, + runArgs=runArgs) + +outputDS = arrange_output(process_dir=process_dir, + runArgs=runArgs, + saveProcDir=True, + lhe_version=lhe_version) + +evgenConfig.contact = ['baptiste.ravina@cern.ch'] +evgenConfig.generators = ['MadGraph','EvtGen','Pythia8'] + +check_reset_proc_number(opts) +include("Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py") +include("Pythia8_i/Pythia8_MadGraph.py") diff --git a/516xxx/516250/log.generate.short b/516xxx/516250/log.generate.short new file mode 100644 index 0000000000..bb866bc4c6 --- /dev/null +++ b/516xxx/516250/log.generate.short @@ -0,0 +1,6 @@ +- estimated CPU for CI job = 0.05 hrs +- using release = AthGeneration-21.6.97 +- ecmEnergy = 13000.0 +- randomSeed = 1 +- EVNT to EVNT = False +- LHEonly = False \ No newline at end of file diff --git a/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py b/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py new file mode 100644 index 0000000000..e94d9a663d --- /dev/null +++ b/516xxx/516250/mc.MGPy8_ttwj_ewk_SMEFTsim_reweighted.py @@ -0,0 +1,16 @@ +selected_operators = ['cHbox','cHG','cHW','ctHRe','ctGRe','ctWRe','ctBRe','cHQ1','cHQ3','cHt','cHl311','cll1221','ctGIm','ctWIm','ctBIm','ctHIm'] + +process_definition = 'set group_subprocesses False\ndefine uc = u c\ndefine uc~ = u~ c~\ndefine ds = d s\ndefine ds~ = d~ s~\n' # define W hadronic decay +process_definition+= 'generate p p > t t~ w+ j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > uc~ ds NP=0), (w+ > l+ vl NP=0) @0 NPprop=0 SMHLOOP=0\n' # dileptonic ++ +process_definition+= 'add process p p > t t~ w- j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > uc ds~ NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w- > l- vl~ NP=0) @1 NPprop=0 SMHLOOP=0\n' # dileptonic -- +process_definition+= 'add process p p > t t~ w+ j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w+ > l+ vl NP=0) @2 NPprop=0 SMHLOOP=0\n' # trileptonic + +process_definition+= 'add process p p > t t~ w- j $$ a z h w+ w- QCD=1 QED=4 NP=1 NPcQj11=0 NPcQj18=0 NPctj1=0 NPctj8=0 NPcQu1=0 NPcQu8=0 NPctu1=0 NPctu8=0 NPcQj31=0 NPcQj38=0 NPctd1=0 NPctd8=0 NPcQd1=0 NPcQd8=0, (t > w+ b NP=0, w+ > l+ vl NP=0), (t~ > w- b~ NP=0, w- > l- vl~ NP=0), (w- > l- vl~ NP=0) @3 NPprop=0 SMHLOOP=0' # trileptonic - + +fixed_scale = 425.0 # ~ 2*m(top)+m(W) + +gridpack = True + +evgenConfig.description = 'SMEFTsim 3.0 tt+W EWK, top model, multilepton (2LSS/3L), reweighted, EFT vertices, no propagator correction' +evgenConfig.nEventsPerJob=10000 + +include("Common_SMEFTsim_topmW_ttwj_ewk_reweighted.py") diff --git a/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz b/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz new file mode 120000 index 0000000000..6e0656382d --- /dev/null +++ b/516xxx/516250/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz @@ -0,0 +1 @@ +/eos/user/n/narayan/topMC/SMEFTsim_CommonTop/999888/mc_13TeV.MGPy8_ttwj_ewk_SMEFTsim_reweighted.GRID.tar.gz \ No newline at end of file -- GitLab From 9f54a2736cda14593f7a3ae98bd0830a9c9da601 Mon Sep 17 00:00:00 2001 From: Rohin Thampilali Narayan <rnarayan@login05.cm.cluster> Date: Thu, 8 Sep 2022 18:26:38 -0500 Subject: [PATCH 3/5] [skip Nfiles] -- GitLab From df29508e63707fced73595894236810d6945cb13 Mon Sep 17 00:00:00 2001 From: Rohin Thampilali Narayan <rnarayan@login05.cm.cluster> Date: Thu, 8 Sep 2022 18:44:51 -0500 Subject: [PATCH 4/5] [skip nfiles] -- GitLab From 6eb728fed5fcfda84fcf888f3b1d8e2b7b0e53ad Mon Sep 17 00:00:00 2001 From: mcgensvc <mcgensvc@cern.ch> Date: Fri, 9 Sep 2022 02:46:52 +0200 Subject: [PATCH 5/5] Pipeline for df29508e succeeded. Removing log.generate files [skip all] --- 516xxx/516243/log.generate.short | 6 ------ 516xxx/516244/log.generate.short | 7 ------- 516xxx/516245/log.generate.short | 6 ------ 516xxx/516246/log.generate.short | 6 ------ 516xxx/516247/log.generate.short | 6 ------ 516xxx/516248/log.generate.short | 6 ------ 516xxx/516249/log.generate.short | 6 ------ 516xxx/516250/log.generate.short | 6 ------ 8 files changed, 49 deletions(-) delete mode 100644 516xxx/516243/log.generate.short delete mode 100644 516xxx/516244/log.generate.short delete mode 100644 516xxx/516245/log.generate.short delete mode 100644 516xxx/516246/log.generate.short delete mode 100644 516xxx/516247/log.generate.short delete mode 100644 516xxx/516248/log.generate.short delete mode 100644 516xxx/516249/log.generate.short delete mode 100644 516xxx/516250/log.generate.short diff --git a/516xxx/516243/log.generate.short b/516xxx/516243/log.generate.short deleted file mode 100644 index f485fa121c..0000000000 --- a/516xxx/516243/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.01 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516244/log.generate.short b/516xxx/516244/log.generate.short deleted file mode 100644 index 8f56f1fdd0..0000000000 --- a/516xxx/516244/log.generate.short +++ /dev/null @@ -1,7 +0,0 @@ -- estimated CPU for CI job = 0.09 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 12345 -- EVNT to EVNT = False -- LHEonly = False -- ATHENA_PROC_NUMBER = 0 \ No newline at end of file diff --git a/516xxx/516245/log.generate.short b/516xxx/516245/log.generate.short deleted file mode 100644 index 9e95762590..0000000000 --- a/516xxx/516245/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.06 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516246/log.generate.short b/516xxx/516246/log.generate.short deleted file mode 100644 index 8399eacd8d..0000000000 --- a/516xxx/516246/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.08 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516247/log.generate.short b/516xxx/516247/log.generate.short deleted file mode 100644 index 8019419946..0000000000 --- a/516xxx/516247/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.02 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516248/log.generate.short b/516xxx/516248/log.generate.short deleted file mode 100644 index 67efb3ec16..0000000000 --- a/516xxx/516248/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.04 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516249/log.generate.short b/516xxx/516249/log.generate.short deleted file mode 100644 index 30a692caf6..0000000000 --- a/516xxx/516249/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.03 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file diff --git a/516xxx/516250/log.generate.short b/516xxx/516250/log.generate.short deleted file mode 100644 index bb866bc4c6..0000000000 --- a/516xxx/516250/log.generate.short +++ /dev/null @@ -1,6 +0,0 @@ -- estimated CPU for CI job = 0.05 hrs -- using release = AthGeneration-21.6.97 -- ecmEnergy = 13000.0 -- randomSeed = 1 -- EVNT to EVNT = False -- LHEonly = False \ No newline at end of file -- GitLab