ATLAS Offline Software
PowhegPy8EG_H2a.py
Go to the documentation of this file.
1 #--------------------------------------------------------------
2 # Use LHE files as input
3 #--------------------------------------------------------------
4 
5 # In 20.7.9.9.6, LHE merging means this is no longer needed
6 #evgenConfig.inputfilecheck = "TXT"
7 
8 #--------------------------------------------------------------
9 # Modify the events.lhe, since Pythia doesn't like to decay the
10 # SM higgs to BSM products: 25 --> 35
11 #--------------------------------------------------------------
12 
13 import os, sys, glob
14 for f in glob.glob("*.events"):
15  infile = f
16  f1 = open( infile )
17  newfile = infile+'.temp'
18  f2 = open(newfile,'w')
19  for line in f1:
20  if line.startswith(' 25 1'):
21  f2.write(line.replace(' 25 1',' 35 1'))
22  else:
23  f2.write(line)
24  f1.close()
25  f2.close()
26  os.system('mv %s %s '%(infile, infile+'.old') )
27  os.system('mv %s %s '%(newfile, infile) )
28 
29 #--------------------------------------------------------------
30 # Defining the function to extract parameters
31 #--------------------------------------------------------------
32 dict_pdgIds = {}
33 dict_pdgIds["b"] = 5
34 dict_pdgIds["mu"] = 13
35 dict_pdgIds["tau"] = 15
36 dict_pdgIds["g"] = 21
37 dict_pdgIds["y"] = 22
38 
40  import re
41 
42  #--- Read parts of the job option
43  jonamelist = str(runArgs.jobConfig[0]).replace(".py", "").split("_")
44 
45  tune=0
46  count=0
47  for substr in jonamelist:
48  if "AZNLO" in substr:
49  tune = count
50  break
51  count += 1
52 
53  print("squirrel",jonamelist,tune)
54  process = jonamelist[tune+1]
55  ma = float(jonamelist[tune+3].split("a")[-1].replace("p", "."))
56  decayChan = str(jonamelist[tune+4])
57  partFilter = None
58  if len(jonamelist)-tune>5:
59  partFilter = str(jonamelist[tune+5])
60 
61  #--- list of decays, e.g. [mu, tau] for 2mu2tau
62  decayProducts = []
63  for part in dict_pdgIds.keys():
64  decay = re.findall("[1-4]%s" % part, decayChan)
65  if len(decay)>0:
66  decayProducts.append(decay[0][1:]) # remove the number in front of the letter
67 
68  return process, ma, decayChan, decayProducts, partFilter
69 
70 # MC15.999999.PowhegPy8EG_ggH_H125_a60a60_2mu2tau_[filtXXX].py
71 process, ma, decayChan, decayProducts, partFilter = getParameters()
72 print "Parameters: "
73 print process, ma, decayChan, decayProducts, partFilter
74 
75 #--------------------------------------------------------------
76 # Pythia8 showering
77 #--------------------------------------------------------------
78 include('Pythia8_i/Pythia8_AZNLO_CTEQ6L1_EvtGen_Common.py')
79 
80 
81 #--------------------------------------------------------------
82 # Pythia8 main31 matching
83 #--------------------------------------------------------------
84 if process=="ggH":
85  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 2']
86 elif process=="VBF":
87  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 3']
88 elif process=="WpH":
89  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 3']
90 elif process=="WmH":
91  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 3']
92 elif process=="ZH":
93  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 3']
94 elif process=="ggZH":
95  genSeq.Pythia8.UserModes += [ 'Main31:NFinal = 2']
96 
97 
98 #--------------------------------------------------------------
99 # Higgs->aa at Pythia8
100 #--------------------------------------------------------------
101 
102 genSeq.Pythia8.Commands += [
103  'Higgs:useBSM = on',
104  '35:m0 = 125',
105  '35:mWidth = 0.00407',
106  '35:doForceWidth = on',
107  '35:onMode = off',
108  '35:onIfMatch = 36 36', # h->aa
109  '36:onMode = off',
110  ]
111 
112 
113 #--------------------------------------------------------------
114 # a->XX at Pythia8
115 #--------------------------------------------------------------
116 
117 if len(decayProducts)==1: # a->4X
118  genSeq.Pythia8.Commands += [
119  '36:onIfAny = %d' % dict_pdgIds[decayProducts[0]], # decay a->XX
120  '36:m0 = %.1f' % ma, #scalar mass
121  '36:mMin = 0',
122  '36:tau0 = 0',
123  ]
124 elif len(decayProducts)==2: # a->2X2Y
125 
126  sign = -1
127  for part in decayProducts:
128  pdgId = dict_pdgIds[part]
129  if pdgId==21 or pdgId==22:
130  sign = 1
131 
132  genSeq.Pythia8.Commands += [
133  '36:oneChannel = 1 0.5 100 %d %d' % (dict_pdgIds[decayProducts[0]], sign*dict_pdgIds[decayProducts[0]]), #a->XX
134  '36:addChannel = 1 0.5 100 %d %d' % (dict_pdgIds[decayProducts[1]], sign*dict_pdgIds[decayProducts[1]]), #a->YY
135  '36:m0 %.1f' % ma, #scalar mass
136  '36:mMin %.1f' % (ma-0.5), #scalar mass
137  '36:mMax %.1f' % (ma+0.5), #scalar mass
138  '36:mWidth 0.01', # narrow width
139  '36:tau0 0', #scalarlife time
140  ]
141 
142 
143 #--------------------------------------------------------------
144 # EVGEN configuration
145 #--------------------------------------------------------------
146 evgenConfig.keywords = [ "BSM", "Higgs", "BSMHiggs", "mH125"]
147 
148 if process=="ggH" and (decayChan=="2b2mu" or decayChan=="2mu2b"):
149  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->bbmumu mh=125 GeV"
150  evgenConfig.process = "ggH H->aa->bbmumu"
151  evgenConfig.contact = [ 'christopher.hayes@cern.ch','ljiljana.morvaj@cern.ch' ]
152 
153 if process=="VBF" and (decayChan=="2b2mu" or decayChan=="2mu2b"):
154  evgenConfig.description = "POWHEG+Pythia8 VBF H production, H->aa->bbmumu mh=125 GeV"
155  evgenConfig.process = "VBF H->aa->bbmumu"
156  evgenConfig.contact = [ 'christopher.hayes@cern.ch','ljiljana.morvaj@cern.ch' ]
157 
158 if process=="ggH" and decayChan=="4tau":
159  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->4tau mh=125 GeV"
160  evgenConfig.process = "ggH H->aa->4tau"
161  evgenConfig.contact = [ 'rachel.smith@cern.ch', 'huacheng.cai@cern.ch', 'roger.caminal.armadans@cern.ch' ]
162 
163 if process=="ggH" and (decayChan=="2mu2tau" or decayChan=="2tau2mu"):
164  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->mumutautau mh=125 GeV"
165  evgenConfig.process = "ggH H->aa->mumutautau"
166  evgenConfig.contact = [ 'josefina.alconada@cern.ch' ]
167 
168 if process=="ggH" and (decayChan=="2b2tau" or decayChan=="2tau2b"):
169  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->bbtautau mh=125 GeV"
170  evgenConfig.process = "ggH H->aa->bbtautau"
171  evgenConfig.contact = [ 'christopher.hayes@cern.ch','ljiljana.morvaj@cern.ch' ]
172 
173 if process=="VBF" and (decayChan=="2b2tau" or decayChan=="2tau2b"):
174  evgenConfig.description = "POWHEG+Pythia8 VBF H production, H->aa->bbtautau mh=125 GeV"
175  evgenConfig.process = "VBF H->aa->bbtautau"
176  evgenConfig.contact = [ 'christopher.hayes@cern.ch','ljiljana.morvaj@cern.ch' ]
177 
178 if process=="ggH" and (decayChan=="2y2g" or decayChan=="2g2y"):
179  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->gamgamgg mh=125 GeV"
180  evgenConfig.process = "ggH H->aa->gamgamgg"
181  evgenConfig.contact = [ 'rubbo@cern.ch' ]
182 
183 if process=="VBF" and (decayChan=="2y2g" or decayChan=="2g2y"):
184  evgenConfig.description = "POWHEG+Pythia8 VBF H production, H->aa->gamgamgg mh=125 GeV"
185  evgenConfig.process = "VBF H->aa->gamgamgg"
186  evgenConfig.contact = [ 'rubbo@cern.ch' ]
187 
188 if process=="ggH" and (decayChan=="4mu"):
189  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->4mu mh=125 GeV"
190  evgenConfig.process = "ggH H->aa->4mu"
191  evgenConfig.contact = [ 'roger.caminal.armadans@cern.ch' ]
192 
193 if process=="WpH" and decayChan=="4b":
194  evgenConfig.description = "POWHEG+MiNLO+Pythia8 H+W+jet->l+vbbbarbbbar production"
195  evgenConfig.process = "WpH, H->aa->4b, W->lv"
196  evgenConfig.contact = [ 'roger.caminal.armadans@cern.ch' ]
197 
198 if process=="WmH" and decayChan=="4b":
199  evgenConfig.description = "POWHEG+MiNLO+Pythia8 H+W-jet->l-vbbbarbbbar production"
200  evgenConfig.process = "WmH, H->aa->4b, W->lv"
201  evgenConfig.contact = [ 'roger.caminal.armadans@cern.ch' ]
202 
203 if process=="ZH" and decayChan=="4b":
204  evgenConfig.description = "POWHEG+MiNLO+Pythia8 H+Z+jet->l+l-bbbarbbbar production"
205  evgenConfig.process = "ZH, H->aa->4b, Z->ll"
206  evgenConfig.contact = [ 'roger.caminal.armadans@cern.ch' ]
207 
208 if process=="ggZH" and decayChan=="4b":
209  evgenConfig.description = "POWHEG+MiNLO+Pythia8 gg->H+Z+jet->l+l-bbbarbbbar production"
210  evgenConfig.process ="ggZH, H->2a->4b, Z->ll"
211  evgenConfig.contact = [ 'roger.caminal.armadans@cern.ch' ]
212 
213 if process=="ZH" and decayChan=="4g":
214  evgenConfig.description = "POWHEG+MiNLO+Pythia8 H+Z+jet->l+l-gggg production"
215  evgenConfig.process = "ZH, H->aa->4g, Z->ll"
216  evgenConfig.contact = [ 'bnachman@cern.ch' ]
217 
218 if process=="ggH" and decayChan=="4y":
219  evgenConfig.description = "POWHEG+Pythia8 H+jet production with NNLOPS and the A14 tune, H->aa->4\gamma mh=125 GeV"
220  evgenConfig.process = "ggH, H->aa->4y"
221  evgenConfig.contact = [ 'bnachman@cern.ch' ]
222 
223 #--------------------------------------------------------------
224 # FILTERS (if needed)
225 #--------------------------------------------------------------
226 if partFilter=="filterXXYY" or partFilter=="filterlh" or partFilter=="filterll":
227  if not hasattr(filtSeq, "XtoVVDecayFilter"):
228  from GeneratorFilters.GeneratorFiltersConf import XtoVVDecayFilter
229  filtSeq += XtoVVDecayFilter()
230  if(partFilter=="filterlh" or partFilter=="filterll"):
231  filtSeq+= XtoVVDecayFilter("tauscalarFilter")
232 # ## Add this filter to the algs required to be successful for streaming
233 # if "XtoVVDecayFilter" not in StreamEVGEN.RequireAlgs:
234 # StreamEVGEN.RequireAlgs += ["XtoVVDecayFilter"]
235  filtSeq.XtoVVDecayFilter.PDGGrandParent = 35
236  filtSeq.XtoVVDecayFilter.PDGParent = 36
237  filtSeq.XtoVVDecayFilter.StatusParent = 22
238  print [dict_pdgIds[decayProducts[0]]], [dict_pdgIds[decayProducts[1]]]
239  filtSeq.XtoVVDecayFilter.PDGChild1 = [dict_pdgIds[decayProducts[0]]]
240  filtSeq.XtoVVDecayFilter.PDGChild2 = [dict_pdgIds[decayProducts[1]]]
241  if(partFilter=="filterlh" or partFilter=="filterll"):
242  filtSeq.tauscalarFilter.PDGGrandParent = 36
243  filtSeq.tauscalarFilter.PDGParent = 15
244  filtSeq.tauscalarFilter.StatusParent = 2
245  filtSeq.tauscalarFilter.PDGChild1 = [11,13]
246  if partFilter=="filterll":
247  filtSeq.tauscalarFilter.PDGChild2 = [11,13]
248  elif partFilter=="filterlh":
249  filtSeq.tauscalarFilter.PDGChild2 = [111,130,211,221,223,310,311,321,323]
250 
251 elif partFilter=="filter2taulep2tauhad":
252  #from GeneratorFilters.GeneratorFiltersConf import FourTauLepLepHadHadFilter
253  #filtSeq += FourTauLepLepHadHadFilter()
254  from GeneratorFilters.GeneratorFiltersConf import TauFilter
255  lfvfilter = TauFilter("lfvfilter")
256  filtSeq += lfvfilter
257  filtSeq.lfvfilter.UseNewOptions = True
258  filtSeq.lfvfilter.Ntaus = 4
259  filtSeq.lfvfilter.Nleptaus = 2
260  filtSeq.lfvfilter.Nhadtaus = 2
261  filtSeq.lfvfilter.EtaMaxlep = 2.7
262  filtSeq.lfvfilter.EtaMaxhad = 2.7
263  filtSeq.lfvfilter.Ptcutlep = 3000.0 #MeV
264  filtSeq.lfvfilter.Ptcutlep_lead = 3000.0 #MeV
265  filtSeq.lfvfilter.Ptcuthad = 12500.0 #MeV
266  filtSeq.lfvfilter.Ptcuthad_lead = 12500.0 #MeV
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.Include.include
include
Definition: Include.py:319
Trk::open
@ open
Definition: BinningType.h:40
PowhegPy8EG_H2a.getParameters
def getParameters()
Definition: PowhegPy8EG_H2a.py:39
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38