ATLAS Offline Software
ttbb.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon import Logging
4 from ..powheg_RES import PowhegRES
5 from ..external import ExternalMadSpin
6 
7 
8 logger = 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 
28 class ttbb(PowhegRES):
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 is a hacky fix that's needed at the moment...
49 
50  # This process' integration needs Athena to be set to run at least two parallel processes
51  # Advise the user about this here:
52  if self.cores < 2:
53  info_message = """
54  Due to an apparent bug in PowhegBox, the *INTEGRATION* for this Powheg process (ttbb)
55  requires running at least two (computer) processes in parallel. Please configure Athena
56  to do so, e.g. by setting the environment variable ATHENA_CORE_NUMBER to 2 or a higher
57  number. In Bash, do e.g.: 'export ATHENA_CORE_NUMBER=4'.
58  """
59  logger.info(info_message)
60 
61  # Add algorithms to the sequence
62  self.add_algorithm(ExternalMadSpin(process="generate p p > t t~ b b~ [QCD]"))
63 
64  # Add parameter validation functions
65  self.validation_functions.append("validate_decays")
66 
67  # List of allowed decay modes
68  # (The sorting of the list is just to increase readability when it's printed)
69  self.allowed_decay_modes = sorted(_decay_mode_lookup.keys())
70 
71  # Add all keywords for this process, overriding defaults if required
72  self.add_keyword("alphas_from_lhapdf", 1)
73  self.add_keyword("bornsuppfact")
74  self.add_keyword("bornzerodamp")
75  self.add_keyword("bornzerodampcut", 5.)
76  self.add_keyword("btlscalect", 1)
77  self.add_keyword("btlscalereal", 1)
78  self.add_keyword("check_bad_st1")
79  self.add_keyword("check_bad_st2")
80  self.add_keyword("clobberlhe")
81  self.add_keyword("compress_lhe", 0)
82  self.add_keyword("compress_upb", 1)
83  self.add_keyword("facscfact", self.default_scales[0])
84  self.add_keyword("fastbtlbound", 1)
85  self.add_keyword("foldcsi", 5)
86  self.add_keyword("foldphi", 1)
87  self.add_keyword("foldy", 5)
88  self.add_keyword("for_reweighting")
89  self.add_keyword("fullrwgt")
90  self.add_keyword("fullrwgtmode")
91  self.add_keyword("icsimax", 1)
92  self.add_keyword("ih1")
93  self.add_keyword("ih2")
94  self.add_keyword("itmx1", 2)
95  self.add_keyword("itmx2", 3)
96  self.add_keyword("iymax", 1)
97  self.add_keyword("lhans1", self.default_PDFs)
98  self.add_keyword("lhans2", self.default_PDFs)
99  self.add_keyword("manyseeds", 1)
100  self.add_keyword("maxseeds", 1000)
101  self.add_keyword("ncall1", 40000)
102  self.add_keyword("ncall2", 40000)
103  self.add_keyword("ncall2rm", 80000)
104  self.add_keyword("nubound", 10000)
105  self.add_keyword("olverbose", 0)
106  self.add_keyword("parallelstage")
107  self.add_keyword("renscfact", self.default_scales[1])
108  self.add_keyword("runningscales", 2)
109  self.add_keyword("rwl_add")
110  self.add_keyword("rwl_file")
111  self.add_keyword("rwl_format_rwgt")
112  self.add_keyword("rwl_group_events")
113  self.add_keyword("semileptonic", hidden=True)
114  self.add_keyword("storemintupb", 1)
115  self.add_keyword("tdec/bmass")
116  self.add_keyword("tdec/cmass")
117  self.add_keyword("tdec/dmass")
118  self.add_keyword("tdec/elbranching")
119  self.add_keyword("elbranching")
120  self.add_keyword("tdec/emass")
121  self.add_keyword("tdec/mumass")
122  self.add_keyword("tdec/sin2cabibbo")
123  self.add_keyword("tdec/smass")
124  self.add_keyword("tdec/taumass")
125  self.add_keyword("tdec/twidth")
126  self.add_keyword("tdec/umass")
127  self.add_keyword("tdec/wmass")
128  self.add_keyword("tdec/wwidth")
129  self.add_keyword("topdecaymode", "t t~ > all [MadSpin]", name="decay_mode")
130  self.add_keyword("use-old-grid", 1)
131  self.add_keyword("use-old-ubound", 1)
132  self.add_keyword("withdamp", 1)
133  self.add_keyword("xgriditeration")
134  self.add_keyword("xupbound", 2)
135  self.add_keyword("hdamp", -1)
136  self.add_keyword("dynhdamp", 1)
137  self.add_keyword("dynhdampPF", 0.5)
138 
139 
140  def validate_decays(self):
141  """
142  Validate semileptonic and topdecaymode keywords and translate them from ATLAS input to Powheg input
143  """
144  self.expose() # convenience call to simplify syntax
145  if self.decay_mode not in self.allowed_decay_modes:
146  error_message = "Decay mode '{given}' not recognised, valid choices are: '{choices}'!".format(given=self.decay_mode, choices="', '".join(self.allowed_decay_modes))
147  logger.warning(error_message)
148  raise ValueError(error_message)
149 
150  # Check if MadSpin decays are requested.
151  # Accordingly, MadSpin will run or not run.
152  if "MadSpin" in self.decay_mode:
153  list(self.externals["MadSpin"].parameters_by_keyword("powheg_top_decays_enabled"))[0].value = False
154 
155  list(self.parameters_by_keyword("topdecaymode"))[0].value = _decay_mode_lookup[self.decay_mode]
156  if "semileptonic" in self.decay_mode:
157  # 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)
158  list(self.parameters_by_keyword("semileptonic"))[0].value = 1
159 
python.processes.configurable.Configurable.expose
def expose(self)
Add all names to the interface of this object.
Definition: configurable.py:46
python.processes.powheg.ttbb.ttbb.validate_decays
def validate_decays(self)
Definition: ttbb.py:140
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.powheg.ttbb.ttbb.allowed_decay_modes
allowed_decay_modes
Definition: ttbb.py:69
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.ttbb.ttbb
Definition: ttbb.py:28
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.ttbb.ttbb.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ttbb.py:39
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
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_base.PowhegBase.cores
cores
Number of cores to use.
Definition: powheg_base.py:170
python.processes.powheg_base.PowhegBase.manually_set_openloops_paths
def manually_set_openloops_paths(self)
Definition: powheg_base.py:58
python.processes.powheg_RES.PowhegRES
Base class for PowhegBox RES processes.
Definition: powheg_RES.py:7