ATLAS Offline Software
Loading...
Searching...
No Matches
ttbb.py
Go to the documentation of this file.
1# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3from AthenaCommon import Logging
4from ..powheg_RES import PowhegRES
5from ..external import ExternalMadSpin
6
7
8logger = Logging.logging.getLogger("PowhegControl")
9
10
11# Dictionary to convert the PowhegControl decay mode names to the appropriate
12# decay mode numbers understood by Powheg
13#
14# The PowhegControl decay modes with MadSpin in their name use MadSpin to
15# generate the top decays, the others use Powheg
16_decay_mode_lookup = {
17 "t t~ > all [MadSpin]" : "00000", # switch off decays in Powheg and let MadSpin handle them!
18 "t t~ > all": "22222",
19 "t t~ > b j j b~ j j": "00022",
20 "t t~ > b l+ vl b~ l- vl~": "22200",
21 "t t~ > b emu+ vemu b~ emu- vemu~": "22000",
22 "t t~ > semileptonic": "11111",
23 "t t~ > undecayed" : "00000",
24}
25
26
27
29 """
30 Powheg interface for top-antitop-bottom-antibottom production.
31 The top quarks may be left undecayed, or their decays (including spin correlations)
32 can be generated by Powheg or using MadSpin.
33
34 Reference for this process: https://arxiv.org/abs/1802.00426
35
36 @author Stefan Richter <stefan.richter@cern.ch>
37 """
38
39 def __init__(self, base_directory, **kwargs):
40 """! Constructor: all process options are set here.
41
42 @param base_directory: path to PowhegBox code.
43 @param kwargs dictionary of arguments from Generate_tf.
44 """
45 super(ttbb, self).__init__(base_directory, "ttbb", **kwargs)
46
47 # This process' integration needs Athena to be set to run at least two parallel processes
48 # Advise the user about this here:
49 if self.cores < 2:
50 info_message = """
51 Due to an apparent bug in PowhegBox, the *INTEGRATION* for this Powheg process (ttbb)
52 requires running at least two (computer) processes in parallel. Please configure Athena
53 to do so, e.g. by setting the environment variable ATHENA_CORE_NUMBER to 2 or a higher
54 number. In Bash, do e.g.: 'export ATHENA_CORE_NUMBER=4'.
55 """
56 logger.info(info_message)
57
58 # Add algorithms to the sequence
59 self.add_algorithm(ExternalMadSpin(process="generate p p > t t~ b b~ [QCD]"))
60
61 # Add parameter validation functions
62 self.validation_functions.append("validate_decays")
63
64 # List of allowed decay modes
65 # (The sorting of the list is just to increase readability when it's printed)
66 self.allowed_decay_modes = sorted(_decay_mode_lookup.keys())
67
68 # Add all keywords for this process, overriding defaults if required
69 self.add_keyword("alphas_from_lhapdf", 1)
70 self.add_keyword("bornsuppfact")
71 self.add_keyword("bornzerodamp")
72 self.add_keyword("bornzerodampcut", 5.)
73 self.add_keyword("btlscalect", 1)
74 self.add_keyword("btlscalereal", 1)
75 self.add_keyword("check_bad_st1")
76 self.add_keyword("check_bad_st2")
77 self.add_keyword("clobberlhe")
78 self.add_keyword("compress_lhe", 0)
79 self.add_keyword("compress_upb", 1)
80 self.add_keyword("facscfact", self.default_scales[0])
81 self.add_keyword("fastbtlbound", 1)
82 self.add_keyword("foldcsi", 5)
83 self.add_keyword("foldphi", 1)
84 self.add_keyword("foldy", 5)
85 self.add_keyword("for_reweighting")
86 self.add_keyword("fullrwgt")
87 self.add_keyword("fullrwgtmode")
88 self.add_keyword("icsimax", 1)
89 self.add_keyword("ih1")
90 self.add_keyword("ih2")
91 self.add_keyword("itmx1", 2)
92 self.add_keyword("itmx2", 3)
93 self.add_keyword("iymax", 1)
94 self.add_keyword("lhans1", self.default_PDFs)
95 self.add_keyword("lhans2", self.default_PDFs)
96 self.add_keyword("manyseeds", 1)
97 self.add_keyword("maxseeds", 1000)
98 self.add_keyword("ncall1", 40000)
99 self.add_keyword("ncall2", 40000)
100 self.add_keyword("ncall2rm", 80000)
101 self.add_keyword("nubound", 10000)
102 self.add_keyword("olverbose", 0)
103 self.add_keyword("parallelstage")
104 self.add_keyword("renscfact", self.default_scales[1])
105 self.add_keyword("runningscales", 2)
106 self.add_keyword("rwl_add")
107 self.add_keyword("rwl_file")
108 self.add_keyword("rwl_format_rwgt")
109 self.add_keyword("rwl_group_events")
110 self.add_keyword("semileptonic", hidden=True)
111 self.add_keyword("storemintupb", 1)
112 self.add_keyword("tdec/bmass")
113 self.add_keyword("tdec/cmass")
114 self.add_keyword("tdec/dmass")
115 self.add_keyword("tdec/elbranching")
116 self.add_keyword("elbranching")
117 self.add_keyword("tdec/emass")
118 self.add_keyword("tdec/mumass")
119 self.add_keyword("tdec/sin2cabibbo")
120 self.add_keyword("tdec/smass")
121 self.add_keyword("tdec/taumass")
122 self.add_keyword("tdec/twidth")
123 self.add_keyword("tdec/umass")
124 self.add_keyword("tdec/wmass")
125 self.add_keyword("tdec/wwidth")
126 self.add_keyword("topdecaymode", "t t~ > all [MadSpin]", name="decay_mode")
127 self.add_keyword("use-old-grid", 1)
128 self.add_keyword("use-old-ubound", 1)
129 self.add_keyword("withdamp", 1)
130 self.add_keyword("xgriditeration")
131 self.add_keyword("xupbound", 2)
132 self.add_keyword("hdamp", -1)
133 self.add_keyword("dynhdamp", 1)
134 self.add_keyword("dynhdampPF", 0.5)
135
136
138 """
139 Validate semileptonic and topdecaymode keywords and translate them from ATLAS input to Powheg input
140 """
141 self.expose() # convenience call to simplify syntax
142 if self.decay_mode not in self.allowed_decay_modes:
143 error_message = "Decay mode '{given}' not recognised, valid choices are: '{choices}'!".format(given=self.decay_mode, choices="', '".join(self.allowed_decay_modes))
144 logger.warning(error_message)
145 raise ValueError(error_message)
146
147 # Check if MadSpin decays are requested.
148 # Accordingly, MadSpin will run or not run.
149 if "MadSpin" in self.decay_mode:
150 list(self.externals["MadSpin"].parameters_by_keyword("powheg_top_decays_enabled"))[0].value = False
151
152 list(self.parameters_by_keyword("topdecaymode"))[0].value = _decay_mode_lookup[self.decay_mode]
153 if "semileptonic" in self.decay_mode:
154 # Parameter semileptonic must be set to 1 to actually get semileptonic decays, because the topdecaymode=11111 also allows fully hadronic decays (with one up and one charm quark)
155 list(self.parameters_by_keyword("semileptonic"))[0].value = 1
156
add_keyword(self, keyword, value=None, name=None, frozen=None, hidden=None, description=None, **kwargs)
Register configurable parameter that is exposed to the user.
expose(self)
Add all names to the interface of this object.
parameters_by_keyword(self, keyword)
Retrieve all parameters that use a given keyword.
Class for running external MadSpin process.
__init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition ttbb.py:39
Base class for PowhegBox RES processes.
Definition powheg_RES.py:7
dict externals
List of external processes to schedule.
list validation_functions
List of validation functions to run before preparing runcard.
add_algorithm(self, alg_or_process)
Add an algorithm or external process to the sequence.
default_scales(self)
Default scale variations for this process.