4evgenConfig.description =
'POWHEG+Pythia8 ttbar production with Powheg hdamp equal 1.5*top mass, A14 tune, ME NNPDF30 NLO, A14 NNPDF23 LO, FCNC Top decays'
5evgenConfig.keywords = [
'top',
'ttbar',
'Higgs',
'FCNC' ]
6evgenConfig.contact = [
'james.robinson@cern.ch',
'andrea.helen.knue@cern.ch',
'onofrio@liverpool.ac.uk',
'ian.connelly@cern.ch']
8include(
'PowhegControl/PowhegControl_tt_Common.py')
10if hasattr(PowhegConfig,
"topdecaymode"):
12 PowhegConfig.topdecaymode = 22222
15 PowhegConfig.decay_mode =
"t t~ > undecayed"
16 PowhegConfig.MadSpin_enabled =
False
18PowhegConfig.hdamp = 258.75
21 PowhegConfig.mu_F = 1.0
22 PowhegConfig.mu_R = 1.0
23 PowhegConfig.PDF = 260000
25 PowhegConfig.mu_F = [1.0, 2.0, 0.5, 1.0, 1.0, 0.5, 2.0, 0.5, 2.0]
26 PowhegConfig.mu_R = [1.0, 1.0, 1.0, 2.0, 0.5, 0.5, 2.0, 2.0, 0.5]
27 PowhegConfig.PDF = [260000, 25200, 13165, 90900]
28 PowhegConfig.PDF.extend(range(260001, 260101))
29 PowhegConfig.PDF.extend(range(90901 , 90931 ))
32PowhegConfig.nEvents=int(7.0*runArgs.maxEvents)
33PowhegConfig.generate()
66if any(
"HLepF" in JO
for JO
in runArgs.jobConfig):
67 PowhegConfig.nEvents = int(7.0*runArgs.maxEvents)
68 print PowhegConfig.nEvents
70 raise RuntimeError(
"Event filter not recognised for this job option")
73istcH = any(
"Q2cH" in JO
for JO
in runArgs.jobConfig)
or any(
"Q2cbarH" in JO
for JO
in runArgs.jobConfig)
76thisDSID = runArgs.runNumber
80if thisDSID < 411229
or thisDSID > 411232 :
82 thisDSID = thisDSID - 64
84 thisDSID = thisDSID - 48
86model =
'TopFCNC-onlyh'
87madspin_card_rep =
'madspin_card.dat'
88madspin_in =
'import run.lhe'
89madspin_rep =
'set ms_dir MadSpin'
90madspin_seed = runArgs.randomSeed
92mscard = open(madspin_card_rep,
'w')
94set Nevents_for_max_weigth 250 # number of events for the estimate of the max. weight (default: 75)
95set max_weight_ps_point 1000 # number of PS to estimate the maximum for each event (default: 400)
101define All = l+ l- vl vl~ j
103"""%(madspin_seed,madspin_in,madspin_rep))
108if not thisDSID >= 411229
and thisDSID <= 411232 :
110 wstr =
', w- > l- vl~'
112 wstr =
', w+ > l+ vl'
118elif thisDSID >= 411229
and thisDSID <= 411232 :
119 if wtyp == 0
or wtyp == 2:
120 wstr =
', w- > All All'
121 if wtyp == 1
or wtyp == 3:
122 wstr =
', w+ > All All'
124 raise RuntimeError(
"No W decays are generated please check the job option")
128 t2str =
'decay t~ > w- b~'
130 t2str =
'decay t > w+ b'
134if ( (thisDSID >= 410700
and thisDSID <= 410779)
or (thisDSID >= 410588
and thisDSID <= 410595)
or (thisDSID >= 411229
and thisDSID <= 411232 ) ):
139 if not thisDSID >= 411229
and thisDSID <= 411232 :
140 if thisDSID >= 410592
and thisDSID <= 410595 :
141 theDIDS = thisDSID - 410700 + 104
142 elif thisDSID >= 410588
and thisDSID <= 410591:
143 theDIDS = thisDSID - 410700 + 108
145 theDIDS = thisDSID - 410700
148 if thisDSID >= 411229
and thisDSID <= 411232 :
149 theDIDS = thisDSID - 411233
153 if theDIDS == -2
or theDIDS == -1 :
155 elif theDIDS == -3
or theDIDS == -4 :
158 elif theDIDS >= 0
and theDIDS < 20:
170 qtyp = (theDIDS-40)/20
173 if theDIDS == -2
or theDIDS == -1 :
175 elif theDIDS == -4
or theDIDS == -3 :
178 if ttyp%2 == 0
and qtyp == 0:
179 t1str =
'decay t > c h'
180 elif ttyp%2 == 1
and qtyp == 0:
181 t1str =
'decay t~ > c~ h'
182 elif ttyp%2 == 0
and qtyp == 1:
183 t1str =
'decay t > u h'
184 elif ttyp%2 == 1
and qtyp == 1:
185 t1str =
'decay t~ > u~ h'
187 mscard.write(
"""%s\n%s%s\nlaunch"""%(t1str,t2str,wstr))
189 raise RuntimeError(
"No good runNumber")
215import shutil,os,subprocess
217paramFileName =
'MadGraph_param_card_ttFCNC_NLO_FixedFCNCBR.dat'
218paramFileNameN =
'param_card.dat'
219paramFile = subprocess.Popen([
'get_files',
'-data',paramFileName]).communicate()
220if not os.access(paramFileName, os.R_OK):
221 print 'ERROR: Could not get param card'
222 raise RuntimeError(
"parameter card '%s' missing!"%paramFileName)
225build_param_card(param_card_old=paramFileName,param_card_new=paramFileNameN,
226 params={
'dim6':coup})
230fin = open(
'PowhegOTF._1.events',
'r')
231fout = open(
'run.lhe',
'w')
233while line !=
"-->\n":
235 line = fin.readline()
239fout.write(
'<MG5ProcCard>\n')
240fout.write(
'import model /cvmfs/atlas.cern.ch/repo/sw/Generators/madgraph/models/latest/%s\n'%(model))
241fout.write(
'generate p p > t t~ [QCD] \n')
242fout.write(
'</MG5ProcCard>\n')
245eline = str(PowhegConfig.nEvents)+
' = nevents\n'
246fout.write(
'<MGRunCard>\n')
247fout.write(
'#0.01 = req_acc_FO\n')
249fout.write(
'50.0 = bwcutoff\n')
250fout.write(
'</MGRunCard>\n')
253fout.write(
'<slha>\n')
254shutil.copyfileobj(open(paramFileNameN,
'r'), fout)
255fout.write(
'</slha>\n')
256fout.write(
'<montecarlomasses>\n')
257fout.write(
' 1 0.330000E+00\n')
258fout.write(
' 2 0.330000E+00\n')
259fout.write(
' 3 0.500000E+00\n')
260fout.write(
' 4 0.150000E+01\n')
261fout.write(
' 5 0.480000E+01\n')
262fout.write(
' 11 0.510999E-03\n')
263fout.write(
' 13 0.105658E+00\n')
264fout.write(
' 15 0.177682E+01\n')
265fout.write(
' 21 0.000000E+00\n')
266fout.write(
'</montecarlomasses>\n')
270while 'LesHouchesEvents' not in line:
272 line = fin.readline()
279os.system(
'$MADPATH/MadSpin/madspin < madspin_card.dat')
282unzip = subprocess.Popen([
'gunzip',
'run_decayed.lhe.gz'])
284os.system(
'cp run_decayed.lhe PowhegOTF._1.events')
288with open(
'PowhegOTF._1.events',
'r+')
as f:
290 to_delete = [
'<![CDATA[',
']]>' ]
292 for line
in t.split(
'\n'):
293 if line
not in to_delete:
300include(
'Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py')
301include(
"Pythia8_i/Pythia8_Powheg_Main31.py")
304if any(
"HLepF" in JO
for JO
in runArgs.jobConfig):
305 if not hasattr(filtSeq,
"LeptonFilter"):
306 from GeneratorFilters.GeneratorFiltersConf
import LeptonFilter
308 filtSeq.LeptonFilter.Ptcut = 15000.0
310genSeq.Pythia8.Commands += [
'POWHEG:pThard = 0' ]
311genSeq.Pythia8.Commands += [
'POWHEG:nFinal = 2' ]
312genSeq.Pythia8.Commands += [
'POWHEG:pTdef = 2' ]
313genSeq.Pythia8.Commands += [
'POWHEG:vetoCount = 3' ]
314genSeq.Pythia8.Commands += [
'POWHEG:pTemt = 0' ]
315genSeq.Pythia8.Commands += [
'POWHEG:emitted = 0' ]
316genSeq.Pythia8.Commands += [
'POWHEG:MPIveto = 0' ]
Filter events based on presence of charged leptons.