ATLAS Offline Software
Powheg_tt_mtop_common.py
Go to the documentation of this file.
1 #---------------------------------------------------------------------------------------------------
2 # Common generator script for b-filtered non-standard top mass samples
3 #---------------------------------------------------------------------------------------------------
4 def parseargs(runArgs):
5  # function for parsing the Generate_tf.py arguments
6  options = {}
7  if not hasattr(runArgs,'runNumber'):
8  raise RuntimeError('no runNumber supplied as argument')
9  else:
10  options['runNumber'] = runArgs.runNumber
11 
12  if hasattr(runArgs,'ecmEnergy'):
13  options['beamEnergy'] = runArgs.ecmEnergy / 2.
14  else:
15  raise RuntimeError('No center of mass energy found.')
16 
17  if hasattr(runArgs,'maxEvents') and runArgs.maxEvents > 0:
18  options['nevents']=runArgs.maxEvents
19  else:
20  raise RuntimeError('No maxEvents provided.')
21 
22  if hasattr(runArgs,'randomSeed'):
23  options['randomSeed'] = runArgs.randomSeed
24  else:
25  raise RuntimeError('No random seed provided.')
26 
27  if hasattr(runArgs,'inputGeneratorFile'):
28  options['lheFile'] = runArgs.inputGeneratorFile
29  else:
30  options['lheFile'] = ''
31  return options
32 
33 # get arguments
34 options = parseargs(runArgs=runArgs)
35 
36 # get showering algorithm based on DSID
37 herwigDSIDs = range(411125,411143)
38 isHerwig = options['runNumber'] in herwigDSIDs
39 pythiaDSIDs = range(411143,411162)
40 isPythia = options['runNumber'] in pythiaDSIDs
41 if not isHerwig and not isPythia:
42  raise RuntimeError('runNumber {0:d} not recognised in these jobOptions.'.format(options['runNumber']))
43 
44 # get top mass and width based on DSID
45 dsidModEighteen = (options['runNumber']-411125) % 18
46 
47 if dsidModEighteen==0 or dsidModEighteen==1:
48  mtop = 169.0
49  widthtop = 1.228
50 elif dsidModEighteen==2 or dsidModEighteen==3:
51  mtop = 171.0
52  widthtop = 1.280
53 elif dsidModEighteen==4 or dsidModEighteen==5:
54  mtop = 172.0
55  widthtop = 1.306
56 elif dsidModEighteen==6 or dsidModEighteen==7:
57  mtop = 172.25
58  widthtop = 1.313
59 elif dsidModEighteen==8 or dsidModEighteen==9:
60  mtop = 172.5
61  widthtop = 1.320
62 elif dsidModEighteen==10 or dsidModEighteen==11:
63  mtop = 172.75
64  widthtop = 1.326
65 elif dsidModEighteen==12 or dsidModEighteen==13:
66  mtop = 173.0
67  widthtop = 1.333
68 elif dsidModEighteen==14 or dsidModEighteen==15:
69  mtop = 174.0
70  widthtop = 1.360
71 elif dsidModEighteen==16 or dsidModEighteen==17:
72  mtop = 176.0
73  widthtop = 1.415
74 
75 # get b or anti-b based on DSID
76 if options['runNumber'] % 2 == 0:
77  isbottom = True
78 else:
79  isbottom = False
80 
81 #--------------------------------------------------------------
82 # EVGEN configuration
83 #--------------------------------------------------------------
84 evgenConfig.keywords = [ 'SM', 'top', 'ttbar', 'lepton', 'Jpsi' ]
85 evgenConfig.contact = [ 'derue@lpnhe.in2p3.fr', 'burton@utexas.edu' ]
86 evgenConfig.generators += [ 'Powheg', 'EvtGen' ]
87 evgenConfig.minevents = 2000
88 if isPythia:
89  evgenConfig.generators += ['Pythia8']
90  evgenConfig.description = 'POWHEG+Pythia8 ttbar production with Powheg hdamp equal 1.5*top mass, \
91  A14 tune, A14 NNPDF23 LO, ME NNPDF30 NLO, at least one lepton, \
92  Jpsi->mumu filter.'
93 if isHerwig:
94  evgenConfig.generators += ['Herwig7']
95  evgenConfig.tune = "MMHT2014"
96  evgenConfig.description = 'POWHEG+Herwig704 ttbar production with Powheg hdamp equal 1.5*top mass, \
97  H7UE tune, single lepton filter, ME NNPDF30 NLO, H7UE MMHT2014 LO at \
98  least one lepton, Jpsi->mumu filter.'
99 
100 #--------------------------------------------------------------
101 # Powheg matrix element
102 #--------------------------------------------------------------
103 if options['lheFile'] is '':
104  include('PowhegControl/PowhegControl_tt_Common.py')
105  # Initial settings
106  PowhegConfig.decay_mode = "t t~ > all" # inclusive decay
107  PowhegConfig.mass_t = mtop
108  PowhegConfig.width_t = widthtop
109  PowhegConfig.hdamp = 1.5*mtop
110  PowhegConfig.PDF = 260000 # NNPDF30
111  PowhegConfig.nEvents *= 10. # compensate filter efficiency
112  PowhegConfig.generate()
113 
114 #--------------------------------------------------------------
115 # Showering
116 #--------------------------------------------------------------
117 if isPythia: # Pythia8 (A14) showering
118  include('Pythia8_i/Pythia8_A14_NNPDF23LO_EvtGen_Common.py')
119  include("Pythia8_i/Pythia8_Powheg_Main31.py")
120  genSeq.Pythia8.Commands += [ 'Powheg:pTHard = 0' ]
121  genSeq.Pythia8.Commands += [ 'Powheg:NFinal = 2' ]
122  genSeq.Pythia8.Commands += [ 'Powheg:pTdef = 2' ]
123  genSeq.Pythia8.Commands += [ 'Powheg:veto = 1' ]
124  genSeq.Pythia8.Commands += [ 'Powheg:vetoCount = 3' ]
125  genSeq.Pythia8.Commands += [ 'Powheg:pTemt = 0' ]
126  genSeq.Pythia8.Commands += [ 'Powheg:emitted = 0' ]
127  genSeq.Pythia8.Commands += [ 'Powheg:MPIveto = 0' ]
128 
129 elif isHerwig: # Herwig7 (H7UE) showering
130  include("Herwig7_i/Herwig7_LHEF.py")
131  include('Herwig7_i/Herwig7_EvtGen.py')
132  Herwig7Config.me_pdf_commands(order="NLO", name="NNPDF30_nlo_as_0118")
133  Herwig7Config.tune_commands()
134  Herwig7Config.lhef_powhegbox_commands(lhe_filename=runArgs.inputGeneratorFile, me_pdf_order="NLO")
135  Herwig7Config.add_commands("""
136 set /Herwig/Shower/LtoLGammaSudakov:pTmin 0.000001
137 set /Herwig/Shower/QtoGammaQSudakov:Alpha /Herwig/Shower/AlphaQED""")
138  Herwig7Config.run()
139 
140 #--------------------------------------------------------------
141 # Special decay of anti-B->Jpsi->mumu
142 #--------------------------------------------------------------
143 from EvtGen_i.EvtGen_iConf import EvtInclusiveDecay
144 if isbottom:
145  evgenConfig.auxfiles += ['B2Jpsimumu.DEC']
146  genSeq.EvtInclusiveDecay.userDecayFile = 'B2Jpsimumu.DEC'
147 else:
148  evgenConfig.auxfiles += ['AntiB2Jpsimumu.DEC']
149  genSeq.EvtInclusiveDecay.userDecayFile = 'AntiB2Jpsimumu.DEC'
150 
151 #--------------------------------------------------------------
152 # Event filters
153 #--------------------------------------------------------------
154 # apply a non all-hadronic decay filter
155 include('GeneratorFilters/TTbarWToLeptonFilter.py')
156 filtSeq.TTbarWToLeptonFilter.NumLeptons = -1
157 filtSeq.TTbarWToLeptonFilter.Ptcut = 0.
158 
159 # apply a J/psi to muons filter
160 include('GeneratorFilters/TTbarWithJpsimumuFilter.py')
161 filtSeq.TTbarWithJpsimumuFilter.JpsipTMinCut = 5000.
vtune_athena.format
format
Definition: vtune_athena.py:14
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.Include.include
include
Definition: Include.py:319
Powheg_tt_mtop_common.parseargs
def parseargs(runArgs)
Definition: Powheg_tt_mtop_common.py:4