ATLAS Offline Software
W_EW.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 import os
4 from AthenaCommon import Logging
5 from ..external import ExternalPHOTOS
6 from ..powheg_V2 import PowhegV2
7 
8 
9 logger = Logging.logging.getLogger("PowhegControl")
10 
11 
12 class W_EW(PowhegV2):
13  """! Default Powheg configuration for single W-boson production with electroweak corrections.
14 
15  Create a configurable object with all applicable Powheg options.
16 
17  @author James Robinson <james.robinson@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(W_EW, self).__init__(base_directory, "W_ew-BMNNP", **kwargs)
27 
28  # Add algorithms to the sequence
29  self.add_algorithm(ExternalPHOTOS(os.path.split(self.executable)[0], "main-PHOTOS-lhef"))
30 
31  # Add parameter validation functions
32  self.validation_functions.append("validate_decays")
33 
34 
35  self.allowed_decay_modes = ["w- > e- ve~", "w- > mu- vm~", "w- > tau- vt~", "w+ > e+ ve", "w+ > mu+ vm", "w+ > tau+ vt"]
36 
37  # Add all keywords for this process, overriding defaults if required
38  self.add_keyword("alphaem")
39  self.add_keyword("bmass_lhe")
40  self.add_keyword("bornktmin")
41  self.add_keyword("bornonly")
42  self.add_keyword("bornsuppfact")
43  self.add_keyword("bornzerodamp")
44  self.add_keyword("bottomthr")
45  self.add_keyword("bottomthrpdf")
46  self.add_keyword("btildeborn")
47  self.add_keyword("btildecoll")
48  self.add_keyword("btildereal")
49  self.add_keyword("btildevirt")
50  self.add_keyword("btlscalect")
51  self.add_keyword("btlscalereal")
52  self.add_keyword("charmthr")
53  self.add_keyword("charmthrpdf")
54  self.add_keyword("check_bad_st1")
55  self.add_keyword("check_bad_st2")
56  self.add_keyword("CKM_Vcb")
57  self.add_keyword("CKM_Vcd")
58  self.add_keyword("CKM_Vcs")
59  self.add_keyword("CKM_Vtb")
60  self.add_keyword("CKM_Vtd")
61  self.add_keyword("CKM_Vts")
62  self.add_keyword("CKM_Vub")
63  self.add_keyword("CKM_Vud")
64  self.add_keyword("CKM_Vus")
65  self.add_keyword("clobberlhe")
66  self.add_keyword("cmass_lhe")
67  self.add_keyword("colltest")
68  self.add_keyword("compress_lhe")
69  self.add_keyword("compress_upb")
70  self.add_keyword("compute_rwgt")
71  self.add_keyword("doublefsr")
72  self.add_keyword("emalpharunnning") # this is a typo in PowhegBox -- the parameter exposed to the user is "emalpharunning"
73  self.add_keyword("evenmaxrat")
74  self.add_keyword("ew_ho")
75  self.add_keyword("ew_ho_only")
76  self.add_keyword("facscfact", self.default_scales[0])
77  self.add_keyword("fastbtlbound")
78  self.add_keyword("fixedgrid")
79  self.add_keyword("flg_debug")
80  self.add_keyword("foldcsi", 2)
81  self.add_keyword("foldphi", 2)
82  self.add_keyword("foldy", 2)
83  self.add_keyword("fullrwgt")
84  self.add_keyword("fullrwgtmode")
85  self.add_keyword("gmu")
86  self.add_keyword("hdamp")
87  self.add_keyword("hfact")
88  self.add_keyword("Hmass")
89  self.add_keyword("icsimax")
90  self.add_keyword("idvecbos", hidden=True)
91  self.add_keyword("ih1")
92  self.add_keyword("ih2")
93  self.add_keyword("itmx1", 6)
94  self.add_keyword("itmx1rm")
95  self.add_keyword("itmx2", 6)
96  self.add_keyword("itmx2rm")
97  self.add_keyword("iupperfsr")
98  self.add_keyword("iupperisr")
99  self.add_keyword("iymax")
100  self.add_keyword("kt2minqed")
101  self.add_keyword("lepaslight")
102  self.add_keyword("lhans1", self.default_PDFs)
103  self.add_keyword("lhans2", self.default_PDFs)
104  self.add_keyword("lhapdf6maxsets")
105  self.add_keyword("lhrwgt_descr")
106  self.add_keyword("lhrwgt_group_combine")
107  self.add_keyword("lhrwgt_group_name")
108  self.add_keyword("lhrwgt_id")
109  self.add_keyword("LOevents")
110  self.add_keyword("manyseeds")
111  self.add_keyword("mass_high", 2.0 * list(self.parameters_by_name("beam_energy"))[0].value)
112  self.add_keyword("mass_low", 2.5)
113  self.add_keyword("masswindow_high", 30, description="mass window above W-mass peak in units of width_W.")
114  self.add_keyword("masswindow_low", 30, description="mass window below W-mass peak in units of width_W.")
115  self.add_keyword("max_io_bufsize")
116  self.add_keyword("maxseeds")
117  self.add_keyword("minlo")
118  self.add_keyword("mintupbratlim")
119  self.add_keyword("mintupbxless")
120  self.add_keyword("ncall1", 15000)
121  self.add_keyword("ncall1rm")
122  self.add_keyword("ncall2", 100000)
123  self.add_keyword("ncall2rm")
124  self.add_keyword("ncallfrominput")
125  self.add_keyword("new_damp")
126  self.add_keyword("nnlops")
127  self.add_keyword("no_ew")
128  self.add_keyword("no_strong")
129  self.add_keyword("noevents")
130  self.add_keyword("novirtual")
131  self.add_keyword("nubound", 50000)
132  self.add_keyword("olddij")
133  self.add_keyword("par_2gsupp")
134  self.add_keyword("par_diexp")
135  self.add_keyword("par_dijexp")
136  self.add_keyword("parallelstage")
137  self.add_keyword("pdfreweight", 0)
138  self.add_keyword("phsp_Wm")
139  self.add_keyword("phsp_Ww")
140  self.add_keyword("powhegv2opt")
141  self.add_keyword("ptsqmin")
142  self.add_keyword("ptsupp")
143  self.add_keyword("QED-only")
144  self.add_keyword("quadrupleprec")
145  self.add_keyword("radregion")
146  self.add_keyword("rand1")
147  self.add_keyword("rand2")
148  self.add_keyword("renscfact", self.default_scales[1])
149  self.add_keyword("runningscale")
150  self.add_keyword("rwl_add")
151  self.add_keyword("rwl_file")
152  self.add_keyword("rwl_format_rwgt")
153  self.add_keyword("rwl_group_events")
154  self.add_keyword("scheme")
155  self.add_keyword("SI_inputfile")
156  self.add_keyword("SI_kt2minqed")
157  self.add_keyword("SI_maxshowerevents")
158  self.add_keyword("SI_no_tworadevents")
159  self.add_keyword("skipextratests")
160  self.add_keyword("smartsig")
161  self.add_keyword("softtest")
162  self.add_keyword("stage2init")
163  self.add_keyword("storeinfo_rwgt")
164  self.add_keyword("storemintupb")
165  self.add_keyword("testplots")
166  self.add_keyword("testsuda")
167  self.add_keyword("theta_damp")
168  self.add_keyword("Tmass")
169  self.add_keyword("ubexcess_correct")
170  self.add_keyword("ubsigmadetails")
171  self.add_keyword("use-old-grid")
172  self.add_keyword("use-old-ubound")
173  self.add_keyword("vdecaymode", self.allowed_decay_modes[0], name="decay_mode")
174  self.add_keyword("weak-only")
175  self.add_keyword("withdamp")
176  self.add_keyword("withnegweights")
177  self.add_keyword("withsubtr")
178  self.add_keyword("Wmass")
179  self.add_keyword("Wwidth")
180  self.add_keyword("xgriditeration")
181  self.add_keyword("xupbound", 3)
182  self.add_keyword("Zmass")
183  self.add_keyword("Zwidth")
184 
185  def validate_decays(self):
186  """! Validate idvecbos and vdecaymode keywords and check that 'no_ew' is compatible with 'PHOTOS_enabled'."""
187  # If PHOTOS is disabled but EW effects are on, any subsequent PHOTOS process will have to run in vetoed mode which is not supported
188  if not list(self.externals["PHOTOS"].parameters_by_keyword("PHOTOS_enabled"))[0].value and list(self.parameters_by_keyword("no_ew"))[0].value == 0:
189  logger.error("Attempting to run with native PHOTOS disabled but with EW corrections on.")
190  logger.error("This would require any later PHOTOS generation to run in vetoed mode.")
191  logger.error("Please change 'PHOTOS_enabled' and/or 'no_ew' in your jobOptions.")
192  raise ValueError("Incompatible options. Please change 'PHOTOS_enabled' and/or 'no_ew' in your jobOptions.")
193  # Check that PHOTOS executable exists
194  if not os.path.isfile(self.externals["PHOTOS"].executable):
195  logger.error("Attempting to configure native PHOTOS but executable not found at {0}".format(self.externals["PHOTOS"].executable))
196  logger.error("Please consider changing 'PHOTOS_enabled' in your jobOptions")
197  raise IOError("Could not find PHOTOS executable: {0}".format(self.externals["PHOTOS"].executable))
198  self.expose() # convenience call to simplify syntax
199  self.check_decay_mode(self.decay_mode, self.allowed_decay_modes)
200  # Calculate appropriate decay mode numbers
201  list(self.parameters_by_keyword("idvecbos"))[0].value = 24 * [-1, +1][self.decay_mode.startswith("w+")]
202  __decay_mode_lookup = {"e- ve~": 11, "mu- vm~": 13, "tau- vt~": 15, "e+ ve": -11, "mu+ vm": -13, "tau+ vt": -15}
203  list(self.parameters_by_keyword("vdecaymode"))[0].value = __decay_mode_lookup[self.decay_mode.split("> ")[1]]
python.processes.configurable.Configurable.expose
def expose(self)
Add all names to the interface of this object.
Definition: configurable.py:46
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
vtune_athena.format
format
Definition: vtune_athena.py:14
python.processes.configurable.Configurable.parameters_by_name
def parameters_by_name(self, name)
Retrieve all parameters that use a given name.
Definition: configurable.py:64
python.processes.powheg_base.PowhegBase.default_scales
def default_scales(self)
Default scale variations for this process.
Definition: powheg_base.py:246
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.external.external_photos.ExternalPHOTOS
Class for running external PHOTOS process.
Definition: external_photos.py:10
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.W_EW.W_EW.allowed_decay_modes
allowed_decay_modes
List of allowed decay modes.
Definition: W_EW.py:35
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.check_decay_mode
def check_decay_mode(self, decay_mode, allowed_decay_modes=None)
Check whether a decay mode is allowed an raise an exception if it is not.
Definition: powheg_base.py:283
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.processes.powheg.W_EW.W_EW.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: W_EW.py:20
python.processes.powheg_base.PowhegBase.externals
externals
List of external processes to schedule.
Definition: powheg_base.py:176
python.processes.powheg_base.PowhegBase.default_PDFs
def default_PDFs(self)
Default PDFs for this process.
Definition: powheg_base.py:241
python.processes.powheg_V2.PowhegV2
Base class for PowhegBox V2 processes.
Definition: powheg_V2.py:6
python.processes.powheg_base.PowhegBase.executable
executable
Powheg executable that will be used.
Definition: powheg_base.py:154
python.processes.powheg.W_EW.W_EW
Default Powheg configuration for single W-boson production with electroweak corrections.
Definition: W_EW.py:12
python.processes.powheg.W_EW.W_EW.validate_decays
def validate_decays(self)
Validate idvecbos and vdecaymode keywords and check that 'no_ew' is compatible with 'PHOTOS_enabled'.
Definition: W_EW.py:185
Trk::split
@ split
Definition: LayerMaterialProperties.h:38