ATLAS Offline Software
gg4l.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 import os
4 from AthenaCommon import Logging
5 from ..powheg_RES import PowhegRES
6 
7 
8 logger = Logging.logging.getLogger("PowhegControl")
9 
10 class gg4l(PowhegRES):
11  """! Default Powheg configuration for
12  NLO QCD corrections to 4 lepton production in gluon fusion,
13  including the Higgs-mediated contribution, the diboson background and their interference.
14 
15  Create a configurable object with all applicable Powheg options.
16 
17  @author Andrej Saibel <Andrej.Saibel@cern.ch>
18  """
19 
20  def __init__(self, base_directory, **kwargs):
21  """! Constructor: all process options are set here.
22 
23  @param base_directory: path to PowhegBox code.
24  @param kwargs dictionary of arguments from Generate_tf.
25  """
26  super(gg4l, self).__init__(base_directory, "gg4l", **kwargs)
27  # defining gg4l environment variable to bypass file path issues in QCDLoop-*/ff/ffinit.f
28  os.environ['gg4lPATH'] = os.path.dirname(self.executable)
29  logger.info("gg4lPATH defined as = {0}".format(os.getenv('gg4lPATH')))
30 
31  # This is a hacky fix that's needed at the moment...
33 
34  # Adding external libraries to LD_LIBRARY_PATH for gg4l
35  self.link_external_powheg_libraries("/External/cln*/cln_lib/lib")
36  self.link_external_powheg_libraries("/External/ginac*/ginac_lib/lib/")
37  self.link_external_powheg_libraries("/External/chaplin*/lib")
38  self.link_external_powheg_libraries("/POWHEG-BOX-RES/gg4l/amplitudes/obj-gnu/")
39  self.link_external_powheg_libraries("/POWHEG-BOX-RES/gg4l/ggvvamp*/obj-gnu")
40  self.link_external_powheg_libraries("/POWHEG-BOX-RES/gg4l/QCDLoop*/ff/obj-gnu/")
41 
42  # Add parameter validation functions
43  self.validation_functions.append("validate_process_contrib")
44 
45 
46  self.allowed_process_modes = ["\'WW\'", "\'ZZ\'"]
47  self.allowed_contrib_modes = ["\'full\'", "\'only_h\'", "\'no_h\'", "\'interf_h\'"]
48 
49  # Add all keywords for this process, overriding defaults if required
50  self.add_keyword("allrad", 1)
51  self.add_keyword("alpha")
52  self.add_keyword("bmass")
53  self.add_keyword("bornktmin")
54  self.add_keyword("bornonly")
55  self.add_keyword("bornsuppfact")
56  self.add_keyword("bornzerodamp")
57  self.add_keyword("bottommass")
58  self.add_keyword("bottomthr")
59  self.add_keyword("bottomthrpdf")
60  self.add_keyword("btildeborn")
61  self.add_keyword("btildecoll")
62  self.add_keyword("btildereal")
63  self.add_keyword("btildevirt")
64  self.add_keyword("btlscalect")
65  self.add_keyword("btlscalereal")
66  self.add_keyword("charmthr")
67  self.add_keyword("charmthrpdf")
68  self.add_keyword("check_bad_st1")
69  self.add_keyword("check_bad_st2")
70  self.add_keyword("chklimseed")
71  self.add_keyword("clobberlhe")
72  self.add_keyword("colltest")
73  self.add_keyword("complexGFermi")
74  self.add_keyword("compress_lhe")
75  self.add_keyword("compress_upb")
76  self.add_keyword("compute_rwgt")
77  self.add_keyword("contr", "\'full\'") # 'full', 'only_h', 'no_h' or 'interf_h'
78  self.add_keyword("dorwgt", 1)
79  self.add_keyword("doublefsr")
80  self.add_keyword("enhancereg")
81  self.add_keyword("evenmaxrat")
82  self.add_keyword("ewscheme")
83  self.add_keyword("facscfact", self.default_scales[0])
84  self.add_keyword("fastbtlbound")
85  self.add_keyword("fixedscale")
86  self.add_keyword("flg_debug")
87  self.add_keyword("foldcsi", 2)
88  self.add_keyword("foldphi", 5)
89  self.add_keyword("foldy", 5)
90  self.add_keyword("for_reweighting")
91  self.add_keyword("fullrwgt")
92  self.add_keyword("gamcut", 60)
93  self.add_keyword("hdamp", 172.5)
94  self.add_keyword("hfact")
95  self.add_keyword("hmass")
96  self.add_keyword("hwidth")
97  self.add_keyword("icsimax")
98  self.add_keyword("ih1")
99  self.add_keyword("ih2")
100  self.add_keyword("itmx1")
101  self.add_keyword("itmx1btl")
102  self.add_keyword("itmx1btlbrn")
103  self.add_keyword("itmx1rm")
104  self.add_keyword("itmx2", 6)
105  self.add_keyword("itmx2btl")
106  self.add_keyword("itmx2btlbrn")
107  self.add_keyword("itmx2rm")
108  self.add_keyword("iupperfsr")
109  self.add_keyword("iupperisr")
110  self.add_keyword("iymax")
111  self.add_keyword("lhans1", self.default_PDFs)
112  self.add_keyword("lhans2", self.default_PDFs)
113  self.add_keyword("lhrwgt_descr")
114  self.add_keyword("lhrwgt_group_combine")
115  self.add_keyword("lhrwgt_group_name")
116  self.add_keyword("lhrwgt_id")
117  self.add_keyword("LOevents")
118  self.add_keyword("m4l_sampling", 2) # 0: flat 1: exponential 2:Breit-Wigner
119  self.add_keyword("m4lmax", 100)
120  self.add_keyword("m4lmin", 1)
121  self.add_keyword("m4lwindow", 4)
122  self.add_keyword("manyseeds")
123  self.add_keyword("massiveloops", 0)
124  self.add_keyword("mass_rwg_frac", 0.) # gg4l treatment of heavy-flavour
125  self.add_keyword("max_io_bufsize")
126  self.add_keyword("maxseeds")
127  self.add_keyword("minlo")
128  self.add_keyword("mint_density_map")
129  self.add_keyword("mintupbratlim")
130  self.add_keyword("mllmax", 100) # default 0.1 GeV this is maximum invar mass for Z leptons
131  self.add_keyword("mllmin", 0.) # default 0.1 GeV this is minimum invar mass for Z leptons
132  self.add_keyword("MSbarscheme")
133  self.add_keyword("mt_expansion", 1)
134  self.add_keyword("ncall1", 10000)
135  self.add_keyword("ncall1btl")
136  self.add_keyword("ncall1btlbrn", 50000)
137  self.add_keyword("ncall1rm")
138  self.add_keyword("ncall2", 10000)
139  self.add_keyword("ncall2btl")
140  self.add_keyword("ncall2btlbrn",100000)
141  self.add_keyword("ncall2rm")
142  self.add_keyword("ncallfrominput")
143  self.add_keyword("noevents")
144  self.add_keyword("nores")
145  self.add_keyword("novirtual")
146  self.add_keyword("nubound", 50000)
147  self.add_keyword("ol_nf", 6)
148  self.add_keyword("ol_verbose", 1)
149  self.add_keyword("ol_preset", 3)
150  self.add_keyword("ol_notri", 0)
151  self.add_keyword("ol_stability_kill", 0.01)
152  self.add_keyword("olpreset")
153  self.add_keyword("olverbose")
154  self.add_keyword("openloops-stability")
155  self.add_keyword("openloopsreal")
156  self.add_keyword("openloopsvirtual")
157  self.add_keyword("par_2gsupp")
158  self.add_keyword("par_diexp")
159  self.add_keyword("par_dijexp")
160  self.add_keyword("parallelstage")
161  self.add_keyword("pdfreweight")
162  self.add_keyword("proc","\'WW\'" ) # 'ZZ' or 'WW'
163  self.add_keyword("ptllmin", 0.1) # this is hard-coded for virtual corrections with massive loops
164  self.add_keyword("ptsqmin")
165  self.add_keyword("ptsupp")
166  self.add_keyword("ptVVcut_CT")
167  self.add_keyword("ptVVcut")
168  self.add_keyword("radregion")
169  self.add_keyword("rand1")
170  self.add_keyword("rand2")
171  self.add_keyword("regridfix")
172  self.add_keyword("renscfact", self.default_scales[1])
173  self.add_keyword("rwl_add")
174  self.add_keyword("rwl_file")
175  self.add_keyword("rwl_format_rwgt")
176  self.add_keyword("rwl_group_events")
177  self.add_keyword("select_real", 0) #do gg qg qq channels
178  self.add_keyword("smartsig")
179  self.add_keyword("softmismch")
180  self.add_keyword("softonly")
181  self.add_keyword("softtest")
182  self.add_keyword("stage2init")
183  self.add_keyword("storeinfo_rwgt")
184  self.add_keyword("storemintupb")
185  self.add_keyword("testplots")
186  self.add_keyword("testsuda")
187  self.add_keyword("tmass_phsp")
188  self.add_keyword("tmass")
189  self.add_keyword("twidth",-1)
190  self.add_keyword("twidth_phsp",-1)
191  self.add_keyword("ubexcess_correct")
192  self.add_keyword("ubsigmadetails", -1) # disable cross-section output to avoid Fortran crash
193  self.add_keyword("use-old-grid")
194  self.add_keyword("use-old-ubound")
195  self.add_keyword("useoldphsp", 0) # use the old phase space parametrization from ggZZ
196  self.add_keyword("user_reshists_sep")
197  self.add_keyword("vdecaymodeV1") # decay mode of first vector boson
198  self.add_keyword("vdecaymodeV2") # decay mode of second vector boson
199  self.add_keyword("verytinypars")
200  self.add_keyword("virtonly")
201  self.add_keyword("which_as",2)
202  self.add_keyword("whichpwhgevent")
203  self.add_keyword("withbtilde")
204  self.add_keyword("withdamp", 1)
205  self.add_keyword("withnegweights")
206  self.add_keyword("withremnants")
207  self.add_keyword("withsubtr")
208  self.add_keyword("wmass")
209  self.add_keyword("wwidth")
210  self.add_keyword("xgriditeration")
211  self.add_keyword("xupbound", 2)
212  self.add_keyword("zerowidth")
213  self.add_keyword("zmass")
214  self.add_keyword("zwidth")
215 
216 
218  """! Validate Process and Contribution modes"""
219  self.expose() # convenience call to simplify syntax
220 
221  #adding char qualication to input
222  if "\'" not in self.proc:
223  self.proc = "\'"+self.proc+"\'"
224  if "\'" not in self.contr:
225  self.contr = "\'"+self.contr+"\'"
226 
227  #Modify unsupported decay configuration in ZZ production
228  if (self.proc == "'ZZ'" and ((self.vdecaymodeV1 == self.vdecaymodeV2) or self.vdecaymodeV1 == 15 or self.vdecaymodeV2 == 15)):
229  logger.warning("Powheg/gg4l does support directly 4e, 4mu or tau final states.")
230  if(self.vdecaymodeV1 == 11 and self.vdecaymodeV2 == 11):
231  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have 4e final states - make sure to validate!")
232  self.add_algorithm("mu2e")
233  elif(self.vdecaymodeV1 == 13 and self.vdecaymodeV2 == 13):
234  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have 4mu final states - make sure to validate!")
235  self.add_algorithm("e2mu")
236  elif(self.vdecaymodeV1 == 15 and self.vdecaymodeV2 == 15):
237  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have 4tau final states - make sure to validate!")
238  self.add_algorithm("e2tau")
239  self.add_algorithm("mu2tau")
240  elif(self.vdecaymodeV1 == 11 and self.vdecaymodeV2 == 15) or (self.vdecaymodeV1 == 15 and self.vdecaymodeV2 == 11):
241  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have 2e2tau final states - make sure to validate!")
242  self.add_algorithm("mu2tau")
243  elif(self.vdecaymodeV1 == 13 and self.vdecaymodeV2 == 15) or (self.vdecaymodeV1 == 15 and self.vdecaymodeV2 == 13):
244  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have 2mu2tau final states - make sure to validate!")
245  self.add_algorithm("e2tau")
246  elif(self.vdecaymodeV1 == 'll' and self.vdecaymodeV2 == 'll'):
247  logger.warning("Ask to generate 2e2mu decays and hack the LHE files to have inclusive 4l decays - make sure to validate!")
248  self.add_algorithm("gg4l_emu2all")
249 
250  self.vdecaymodeV1 = 11
251  self.vdecaymodeV2 = 13
252  self.parameters_by_keyword("vdecaymodeV1")[0].value = self.vdecaymodeV1
253  self.parameters_by_keyword("vdecaymodeV2")[0].value = self.vdecaymodeV2
254 
255  #check if the setting is allowed
256  if self.proc not in self.allowed_process_modes:
257  logger.warning("Process mode {} not recognised!".format(self.proc))
258  raise ValueError("Process mode {} not recognised!".format(self.proc))
259 
260  if self.contr not in self.allowed_contrib_modes:
261  logger.warning("Contribution mode {} not recognised!".format(self.contr))
262  raise ValueError("Contribution mode {} not recognised!".format(self.contr))
263 
264  self.parameters_by_keyword("proc")[0].value = self.proc
265  self.parameters_by_keyword("contr")[0].value = self.contr
266 
python.processes.configurable.Configurable.expose
def expose(self)
Add all names to the interface of this object.
Definition: configurable.py:46
python.processes.powheg.gg4l.gg4l.proc
proc
Definition: gg4l.py:223
python.processes.powheg.gg4l.gg4l.contr
contr
Definition: gg4l.py:225
python.processes.powheg_base.PowhegBase.add_algorithm
def add_algorithm(self, alg_or_process)
Add an algorithm or external process to the sequence.
Definition: powheg_base.py:208
python.processes.powheg_base.PowhegBase.manually_set_openloops_gnu_paths
def manually_set_openloops_gnu_paths(self)
Definition: powheg_base.py:76
vtune_athena.format
format
Definition: vtune_athena.py:14
python.processes.powheg_base.PowhegBase.default_scales
def default_scales(self)
Default scale variations for this process.
Definition: powheg_base.py:246
python.processes.powheg.gg4l.gg4l.vdecaymodeV1
vdecaymodeV1
Definition: gg4l.py:228
python.processes.configurable.Configurable.add_keyword
def add_keyword(self, keyword, value=None, name=None, frozen=None, hidden=None, description=None, **kwargs)
Register configurable parameter that is exposed to the user.
Definition: configurable.py:21
python.processes.powheg.gg4l.gg4l.validate_process_contrib
def validate_process_contrib(self)
Validate Process and Contribution modes.
Definition: gg4l.py:217
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.processes.configurable.Configurable.parameters_by_keyword
def parameters_by_keyword(self, keyword)
Retrieve all parameters that use a given keyword.
Definition: configurable.py:57
python.processes.powheg.gg4l.gg4l.vdecaymodeV2
vdecaymodeV2
Definition: gg4l.py:228
python.processes.powheg.gg4l.gg4l.allowed_contrib_modes
allowed_contrib_modes
Definition: gg4l.py:47
python.processes.powheg_base.PowhegBase.validation_functions
validation_functions
List of validation functions to run before preparing runcard.
Definition: powheg_base.py:179
python.processes.powheg_base.PowhegBase.link_external_powheg_libraries
def link_external_powheg_libraries(self, librarypath)
Definition: powheg_base.py:122
python.processes.powheg.gg4l.gg4l.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: gg4l.py:20
python.processes.powheg_base.PowhegBase.default_PDFs
def default_PDFs(self)
Default PDFs for this process.
Definition: powheg_base.py:241
python.processes.powheg.gg4l.gg4l.allowed_process_modes
allowed_process_modes
Definition: gg4l.py:46
python.processes.powheg_base.PowhegBase.executable
executable
Powheg executable that will be used.
Definition: powheg_base.py:154
python.processes.powheg.gg4l.gg4l
Default Powheg configuration for NLO QCD corrections to 4 lepton production in gluon fusion,...
Definition: gg4l.py:10
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
python.processes.powheg_RES.PowhegRES
Base class for PowhegBox RES processes.
Definition: powheg_RES.py:7