ATLAS Offline Software
ttj.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_V2 import PowhegV2
5 from ..external import ExternalMadSpin
6 import os
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 #
15 # The PowhegControl decay modes with MadSpin in their name use MadSpin to
16 # generate the top decays, the others use Powheg
17 _decay_mode_lookup = {
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  "t t~ > all [MadSpin]" : "00000", # switch off decays in Powheg and let MadSpin handle them!
25 }
26 
27 
28 class ttj(PowhegV2):
29  """! Default Powheg configuration for top pair production plus one jet.
30 
31  Create a configurable object with all applicable Powheg options.
32 
33  @author James Robinson <james.robinson@cern.ch>
34  """
35 
36  def __init__(self, base_directory, **kwargs):
37  """! Constructor: all process options are set here.
38 
39  @param base_directory: path to PowhegBox code.
40  @param kwargs dictionary of arguments from Generate_tf.
41  """
42  super(ttj, self).__init__(base_directory, "ttbarj", **kwargs)
43 
44  # hack in place to help powheg executable find all dynamic libraries
45  logger.warning("Applying manual, hard-coded fixes for library paths")
46  OLPath = os.path.dirname(self.executable)+"/obj-gnu"
47  os.environ['OpenLoopsPath'] = OLPath
48  logger.info("OpenLoopsPath defined as = {0}".format(os.getenv('OpenLoopsPath')))
49 
50  # Add algorithms to the sequence
51  self.add_algorithm(ExternalMadSpin(process="generate p p > t t~ j [QCD]"))
52 
53  # Add parameter validation functions
54  self.validation_functions.append("validate_decays")
55 
56 
58  self.allowed_decay_modes = sorted(_decay_mode_lookup.keys())
59 
60  # Add all keywords for this process, overriding defaults if required
61  self.add_keyword("alphaem")
62  self.add_keyword("bcut")
63  self.add_keyword("bornktmin", 5.0)
64  self.add_keyword("bornonly")
65  self.add_keyword("bornsuppfact", 100.0)
66  self.add_keyword("bornzerodamp")
67  self.add_keyword("bottomthr")
68  self.add_keyword("bottomthrpdf")
69  self.add_keyword("charmthr")
70  self.add_keyword("charmthrpdf")
71  self.add_keyword("check_bad_st1")
72  self.add_keyword("check_bad_st2")
73  self.add_keyword("CKM_Vcb")
74  self.add_keyword("CKM_Vcd")
75  self.add_keyword("CKM_Vcs")
76  self.add_keyword("CKM_Vtb")
77  self.add_keyword("CKM_Vtd")
78  self.add_keyword("CKM_Vts")
79  self.add_keyword("CKM_Vub")
80  self.add_keyword("CKM_Vud")
81  self.add_keyword("CKM_Vus")
82  self.add_keyword("clobberlhe")
83  self.add_keyword('collremnsamp"')
84  self.add_keyword("colltest")
85  self.add_keyword("compute_rwgt")
86  self.add_keyword("elbranching")
87  self.add_keyword("facscfact", self.default_scales[0])
88  self.add_keyword("fastbtlbound")
89  self.add_keyword("ffltest")
90  self.add_keyword("flg_debug")
91  self.add_keyword("foldcsi", 2)
92  self.add_keyword("foldphi", 2)
93  self.add_keyword("foldy", 2)
94  self.add_keyword("fullrwgt")
95  self.add_keyword("fullrwgtmode")
96  self.add_keyword("ggproc")
97  self.add_keyword("gqbproc")
98  self.add_keyword("hdamp")
99  self.add_keyword("hfact")
100  self.add_keyword("icsimax", 3)
101  self.add_keyword("ih1")
102  self.add_keyword("ih2")
103  self.add_keyword("itmx1")
104  self.add_keyword("itmx2", 4)
105  self.add_keyword("iupperfsr")
106  self.add_keyword("iupperisr")
107  self.add_keyword("iymax", 3)
108  self.add_keyword("jacsing")
109  self.add_keyword("largecorrfact")
110  self.add_keyword("lhans1", self.default_PDFs)
111  self.add_keyword("lhans2", self.default_PDFs)
112  self.add_keyword("lhfm/bmass")
113  self.add_keyword("lhfm/cmass")
114  self.add_keyword("lhfm/emass")
115  self.add_keyword("lhfm/mumass")
116  self.add_keyword("lhfm/taumass")
117  self.add_keyword("manyseeds")
118  self.add_keyword("masswindow_high")
119  self.add_keyword("masswindow_low")
120  self.add_keyword("ncall1", 51000)
121  self.add_keyword("ncall1rm")
122  self.add_keyword("ncall2", 91000)
123  self.add_keyword("ncall2rm")
124  self.add_keyword("nubound", 11000)
125  self.add_keyword("par_2gsupp")
126  self.add_keyword("par_diexp")
127  self.add_keyword("par_dijexp")
128  self.add_keyword("par_fsrtinycsi")
129  self.add_keyword("par_fsrtinyy")
130  self.add_keyword("par_isrtinycsi")
131  self.add_keyword("par_isrtinyy")
132  self.add_keyword("parallelstage")
133  self.add_keyword("pdfreweight")
134  self.add_keyword("psgen")
135  self.add_keyword("ptmin_jet", 20.0)
136  self.add_keyword("ptsqmin")
137  self.add_keyword("ptsupp")
138  self.add_keyword("qgproc")
139  self.add_keyword("qqbproc")
140  self.add_keyword("qqpproc")
141  self.add_keyword("qqproc")
142  self.add_keyword("R_jet")
143  self.add_keyword("radregion")
144  self.add_keyword("rand1")
145  self.add_keyword("rand2")
146  self.add_keyword("renscfact", self.default_scales[1])
147  self.add_keyword("runningscale")
148  self.add_keyword("rwl_add")
149  self.add_keyword("rwl_file")
150  self.add_keyword("rwl_format_rwgt")
151  self.add_keyword("rwl_group_events")
152  self.add_keyword("semileptonic", hidden=True)
153  self.add_keyword("smartsig")
154  self.add_keyword("softtest")
155  self.add_keyword("sthw2")
156  self.add_keyword("storeinfo_rwgt")
157  self.add_keyword("testplots")
158  self.add_keyword("testsuda")
159  self.add_keyword("topdecaymode", "t t~ > all", name="decay_mode")
160  self.add_keyword("topmass")
161  self.add_keyword("topwidth")
162  self.add_keyword("ubsigmadetails")
163  self.add_keyword("use-old-grid")
164  self.add_keyword("use-old-ubound")
165  self.add_keyword("use_OLP_Interface",1)
166  self.add_keyword("withdamp")
167  self.add_keyword("withnegweights")
168  self.add_keyword("withsubtr")
169  self.add_keyword("Wmass")
170  self.add_keyword("Wwidth")
171  self.add_keyword("xupbound", 6)
172  self.add_keyword("zerowidth")
173  self.add_keyword("Zmass")
174  self.add_keyword("Zwidth")
175 
176  def validate_decays(self):
177  """! Validate semileptonic and topdecaymode keywords."""
178  self.expose() # convenience call to simplify syntax
179  if self.decay_mode not in self.allowed_decay_modes:
180  error_message = "Decay mode '{given}' not recognised, valid choices are: '{choices}'!".format(given=self.decay_mode, choices="', '".join(self.allowed_decay_modes))
181  logger.warning(error_message)
182  raise ValueError(error_message)
183 
184  # Check if MadSpin decays are requested.
185  # Accordingly, MadSpin will run or not run.
186  if "MadSpin" in self.decay_mode:
187  self.externals["MadSpin"].parameters_by_keyword("powheg_top_decays_enabled")[0].value = False
188  self.externals["MadSpin"].parameters_by_keyword("MadSpin_model")[0].value = "loop_sm-no_b_mass"
189  self.externals["MadSpin"].parameters_by_keyword("MadSpin_nFlavours")[0].value = 5
190 
191  self.parameters_by_keyword("topdecaymode")[0].value = _decay_mode_lookup[self.decay_mode]
192  if self.decay_mode == "semileptonic":
193  # 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)
194  self.parameters_by_keyword("semileptonic")[0].value = 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.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.powheg.ttj.ttj.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ttj.py:36
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.powheg.ttj.ttj.validate_decays
def validate_decays(self)
Validate semileptonic and topdecaymode keywords.
Definition: ttj.py:176
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.ttj.ttj.allowed_decay_modes
allowed_decay_modes
List of allowed decay modes (The sorting of the list is just to increase readability when it's printe...
Definition: ttj.py:58
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
python.processes.powheg.ttj.ttj.decay_mode
decay_mode
Definition: ttj.py:192
python.processes.powheg.ttj.ttj
Default Powheg configuration for top pair production plus one jet.
Definition: ttj.py:28