ATLAS Offline Software
fourtops.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon import Logging
4 from ...parameters import powheg_atlas_common
5 from ..powheg_V2 import PowhegV2
6 from ..external import ExternalMadSpin
7 
8 
9 logger = Logging.logging.getLogger("PowhegControl")
10 
11 
12 # Dictionary to convert the PowhegControl decay mode names to the appropriate
13 # decay mode numbers understood by Powheg
14 _decay_mode_lookup = {
15  "t t~ t t~ > all [MadSpin]" : "00000", # switch off decays in Powheg and let MadSpin handle them!
16  "t t~ t t~ > all": "44444", # all decays
17  "t t~ t t~ > 4l": "44400", # exactly 4 leptons
18  "t t~ t t~ > 3l4l": "4", # at least 3 leptons
19  "t t~ t t~ > 2lSS": "3", # exactly 2 leptons, same sign
20  "t t~ t t~ > 2lOS": "2", # exactly 2 leptons, opposite sign
21  "t t~ t t~ > 1l": "1", # exactly 1 lepton
22  "t t~ t t~ > allhad": "00044", # fully-hadronic
23  "t t~ t t~ > undecayed": "00000" # undecayed (e.g. to produce a lhe file)
24  }
25 _signature_lookup = [ "4", "3", "2", "1" ] # these values are for the 4tops-specific #decay_signature keyword
26 
28  """! Default Powheg configuration for 4 tops production.
29 
30  Create a configurable object with all applicable Powheg options.
31 
32  @author James Robinson <tpelzer@cern.ch>
33  """
34 
35  def __init__(self, base_directory, **kwargs):
36  """! Constructor: all process options are set here.
37 
38  @param base_directory: path to PowhegBox code.
39  @param kwargs dictionary of arguments from Generate_tf.
40  """
41  super(fourtops, self).__init__(base_directory, "fourtops", **kwargs)
42 
43  import os
44 
45  # hack in place to help powheg executable find all dynamic libraries
46  logger.warning("Applying manual, hard-coded fixes for library paths")
47  OLPath = os.path.dirname(self.executable)+"/obj-gfortran"
48  os.environ['OpenLoopsPath'] = OLPath
49  logger.info("OpenLoopsPath defined as = {0}".format(os.getenv('OpenLoopsPath')))
50 
51  # Add algorithms to the sequence
52  self.add_algorithm(ExternalMadSpin(process="generate p p > t t~ t t~ [QCD]"))
53 
54  # Add parameter validation functions
55  self.validation_functions.append("validate_decays")
56 
57  # List of allowed decay modes
58  # (The sorting of the list is just to increase readability when it's printed)
59  self.allowed_decay_modes = sorted(_decay_mode_lookup.keys())
60 
61  # Add all keywords for this process, overriding defaults if required
62  self.add_keyword("bmass_lhe")
63  self.add_keyword("bornktmin", 5.0)
64  self.add_keyword("bornonly")
65  self.add_keyword("bornsuppfact")
66  self.add_keyword("bornzerodamp")
67  self.add_keyword("bottomthr")
68  self.add_keyword("bottomthrpdf")
69  self.add_keyword("btildeborn")
70  self.add_keyword("btildecoll")
71  self.add_keyword("btildereal")
72  self.add_keyword("btildevirt")
73  self.add_keyword("btlscalect")
74  self.add_keyword("btlscalereal")
75  self.add_keyword("charmthr")
76  self.add_keyword("charmthrpdf")
77  self.add_keyword("check_bad_st1")
78  self.add_keyword("check_bad_st2")
79  self.add_keyword("clobberlhe")
80  self.add_keyword("cmass_lhe")
81  self.add_keyword("colltest")
82  self.add_keyword("compress_lhe")
83  self.add_keyword("compress_upb")
84  self.add_keyword("compute_rwgt")
85  self.add_keyword("correlations", 1)
86  self.add_keyword("dampscfact", 1.0)
87  self.add_keyword("decay_signature", "0")
88  self.add_keyword("doublefsr")
89  self.add_keyword("dynamic_hdamp", 1)
90  self.add_keyword("evenmaxrat")
91  self.add_keyword("ewborn")
92  self.add_keyword("facscfact", self.default_scales[0])
93  self.add_keyword("fastbtlbound")
94  self.add_keyword("fixedgrid")
95  self.add_keyword("fixedscale")
96  self.add_keyword("flg_debug")
97  self.add_keyword("foldcsi")
98  self.add_keyword("foldphi")
99  self.add_keyword("foldy")
100  self.add_keyword("fullrwgt")
101  self.add_keyword("fullrwgtmode")
102  self.add_keyword("hbzd", 5.0)
103  self.add_keyword("hdamp")
104  self.add_keyword("hfact")
105  self.add_keyword("icsimax")
106  self.add_keyword("ih1")
107  self.add_keyword("ih2")
108  self.add_keyword("itmx1")
109  self.add_keyword("itmx1rm")
110  self.add_keyword("itmx2", 8)
111  self.add_keyword("itmx2rm")
112  self.add_keyword("iupperfsr")
113  self.add_keyword("iupperisr")
114  self.add_keyword("iymax")
115  self.add_keyword("lhans1", self.default_PDFs)
116  self.add_keyword("lhans2", self.default_PDFs)
117  self.add_keyword("lhapdf6maxsets")
118  self.add_keyword("lhrwgt_descr")
119  self.add_keyword("lhrwgt_group_combine")
120  self.add_keyword("lhrwgt_group_name")
121  self.add_keyword("lhrwgt_id")
122  self.add_keyword("LOevents")
123  self.add_keyword("manyseeds")
124  self.add_keyword("max_io_bufsize")
125  self.add_keyword("maxseeds")
126  self.add_keyword("minlo")
127  self.add_keyword("mintupbratlim")
128  self.add_keyword("mintupbxless")
129  self.add_keyword("ncall1", 10000)
130  self.add_keyword("ncall1rm")
131  self.add_keyword("ncall2", 50000)
132  self.add_keyword("ncall2rm")
133  self.add_keyword("ncallfrominput")
134  self.add_keyword("noevents")
135  self.add_keyword("novirtual")
136  self.add_keyword("nubound", 800000)
137  self.add_keyword("olddij")
138  self.add_keyword("par_2gsupp")
139  self.add_keyword("par_diexp")
140  self.add_keyword("par_dijexp")
141  self.add_keyword("parallelstage")
142  self.add_keyword("pdfreweight")
143  self.add_keyword("ptsqmin")
144  self.add_keyword("ptsupp")
145  self.add_keyword("tmass", powheg_atlas_common.mass.t, name="mass_t", description="top quark mass in GeV")
146  self.add_keyword("radregion")
147  self.add_keyword("rand1")
148  self.add_keyword("rand2")
149  self.add_keyword("renscfact", self.default_scales[1])
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("scalechoice", 1)
155  self.add_keyword("skipextratests")
156  self.add_keyword("smartsig")
157  self.add_keyword("softtest")
158  self.add_keyword("stage2init")
159  self.add_keyword("storeinfo_rwgt")
160  self.add_keyword("storemintupb")
161  self.add_keyword("tdec/bmass")
162  self.add_keyword("tdec/cmass")
163  self.add_keyword("tdec/dmass")
164  self.add_keyword("tdec/elbranching")
165  self.add_keyword("tdec/emass")
166  self.add_keyword("tdec/mumass")
167  self.add_keyword("tdec/sin2cabibbo")
168  self.add_keyword("tdec/smass")
169  self.add_keyword("tdec/taumass")
170  self.add_keyword("tdec/twidth")
171  self.add_keyword("tdec/umass")
172  self.add_keyword("tdec/wmass")
173  self.add_keyword("tdec/wwidth")
174  self.add_keyword("testplots")
175  self.add_keyword("testsuda")
176  self.add_keyword("topdecaymode", "t t~ > all [MadSpin]", name="decay_mode")
177  self.add_keyword("ubexcess_correct")
178  self.add_keyword("ubsigmadetails")
179  self.add_keyword("use-old-grid")
180  self.add_keyword("use-old-ubound")
181  self.add_keyword("withdamp")
182  self.add_keyword("withnegweights")
183  self.add_keyword("withsubtr")
184  self.add_keyword("xgriditeration")
185  self.add_keyword("xupbound", 10)
186 
187  def validate_decays(self):
188  """
189  Validate semileptonic and topdecaymode keywords and translate them from ATLAS input to Powheg input
190  """
191  self.expose() # convenience call to simplify syntax
192  if self.decay_mode not in self.allowed_decay_modes:
193  error_message = "Decay mode '{given}' not recognised, valid choices are: '{choices}'!".format(given=self.decay_mode, choices="', '".join(self.allowed_decay_modes))
194  logger.warning(error_message)
195  raise ValueError(error_message)
196 
197  # Check if MadSpin decays are requested.
198  # Accordingly, MadSpin will run or not run.
199  if "MadSpin" in self.decay_mode:
200  self.externals["MadSpin"].parameters_by_keyword("powheg_top_decays_enabled")[0].value = False
201  self.externals["MadSpin"].parameters_by_keyword("MadSpin_model")[0].value = "loop_sm-no_b_mass"
202  self.externals["MadSpin"].parameters_by_keyword("MadSpin_nFlavours")[0].value = 5
203 
204  if _decay_mode_lookup[self.decay_mode] in _signature_lookup: # special handling of decays with #decay_signature keyword
205  self.parameters_by_keyword("decay_signature")[0].value = _decay_mode_lookup[self.decay_mode]
206  self.parameters_by_keyword("topdecaymode")[0].value = "44444"
207  else: # usual handling of decays with #topdecaymode keyword
208  self.parameters_by_keyword("decay_signature")[0].value = "0"
209  self.parameters_by_keyword("topdecaymode")[0].value = _decay_mode_lookup[self.decay_mode]
python.processes.powheg.fourtops.fourtops.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: fourtops.py:35
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
python.processes.powheg.fourtops.fourtops.allowed_decay_modes
allowed_decay_modes
Definition: fourtops.py:59
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.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_madspin.ExternalMadSpin
Class for running external MadSpin process.
Definition: external_madspin.py:11
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.fourtops.fourtops
Default Powheg configuration for 4 tops production.
Definition: fourtops.py:27
python.processes.powheg.fourtops.fourtops.validate_decays
def validate_decays(self)
Definition: fourtops.py:187
python.processes.powheg_base.PowhegBase.validation_functions
validation_functions
List of validation functions to run before preparing runcard.
Definition: powheg_base.py:179
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
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