ATLAS Offline Software
Loading...
Searching...
No Matches
external_vbf_nlo.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3from AthenaCommon import Logging
4from .external_base import ExternalBase
5
6
7logger = Logging.logging.getLogger("PowhegControl")
8
9
11 """! Class for running external VBFNLO process.
12
13 @author James Robinson <james.robinson@cern.ch>
14 """
15
16 def __init__(self, vector_boson, allowed_decay_modes):
17 """! Constructor.
18
19 @param process VBFNLO process
20 """
21 super(ExternalVBFNLO, self).__init__("VBFNLO")
22
23
24 self.allowed_decay_modes = allowed_decay_modes
25
26 # Add parameters used by VBFNLO
27 self.add_keyword("alphaem_inv")
28 self.add_keyword("vdecaymode", list(self.allowed_decay_modes)[0], name="decay_mode", description="{} boson decay mode. [{}]".format(vector_boson, allowed_decay_modes))
29 self.add_keyword("G_F")
30 self.add_keyword("mass_b")
31 self.add_keyword("mass_c")
32 self.add_keyword("mass_H")
33 self.add_keyword("mass_t")
34 self.add_keyword("mass_tau")
35 self.add_keyword("mass_W")
36 self.add_keyword("mass_Z")
37 self.add_keyword("sthw2")
38 self.add_keyword("width_H")
39
40 def needs_scheduling(self, process):
41 """! Report whether the VBFNLO process should be scheduled.
42
43 @param process PowhegBox process.
44 """
45 self.expose() # convenience call to simplify syntax
46 if self.decay_mode not in self.allowed_decay_modes:
47 logger.fatal("Decay mode {} not recognised!".format(self.decay_mode))
48 raise ValueError("VBF NLO cannot be correctly configured.")
49 # Convert allowed decay mode into PROC_ID/DECAYMODE
50 __vector_boson_type = self.decay_mode.split(">")[0].strip()
51 __vector_boson_decay = self.decay_mode.split(" ")[2].replace("+", "").replace("-", "")
52 if __vector_boson_type in ["w+", "w-", "z"] and __vector_boson_decay == "tau":
53 logger.warning("Powheg/VBFNLO does support directly tau decays for VBF W, Z production")
54 logger.warning("Ask to generate muon decays and hack the LHE files - make sure to validate!")
55 __vector_boson_decay = "mu"
56 process.add_algorithm("mu2tau")
57 # Add runcard entries
58 VBF_runcard_entries = [("PROC_ID", {"z": 120, "w+": 130, "w-": 140}[__vector_boson_type], "{} boson".format(__vector_boson_type)),
59 ("DECAYMODE", {"e": 11, "mu": 13}[__vector_boson_decay], self.decay_mode),
60 ("HMASS", self.mass_H, list(self.parameters_by_name("mass_H"))[0].description),
61 ("HWIDTH", self.width_H, list(self.parameters_by_name("width_H"))[0].description),
62 ("EWSCHEME", 4, "Explicitly specify all EW parameters"),
63 ("ANOM_CPL", 0, "Disable anomalous couplings as these are not supported by the authors"),
64 ("TOPMASS", self.mass_t, list(self.parameters_by_name("mass_t"))[0].description),
65 ("TAU_MASS", self.mass_tau, list(self.parameters_by_name("mass_tau"))[0].description),
66 ("BOTTOMMASS", self.mass_b, list(self.parameters_by_name("mass_b"))[0].description),
67 ("CHARMMASS", self.mass_c, list(self.parameters_by_name("mass_c"))[0].description),
68 ("FERMI_CONST", self.G_F, list(self.parameters_by_name("G_F"))[0].description),
69 ("INVALFA", self.alphaem_inv, list(self.parameters_by_name("alphaem_inv"))[0].description),
70 ("SIN2W", self.sthw2, list(self.parameters_by_name("sthw2"))[0].description),
71 ("WMASS", self.mass_W, list(self.parameters_by_name("mass_W"))[0].description),
72 ("ZMASS", self.mass_Z, list(self.parameters_by_name("mass_Z"))[0].description)]
73 # Write special VBF runcard
74 with open("vbfnlo.input", "w") as f:
75 for runcard_entry in VBF_runcard_entries:
76 f.write("{:<15} {:<15} ! {}\n".format(*runcard_entry))
77 return True
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_name(self, name)
Retrieve all parameters that use a given name.
Class for running external VBFNLO process.
__init__(self, vector_boson, allowed_decay_modes)
Constructor.
needs_scheduling(self, process)
Report whether the VBFNLO process should be scheduled.
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:310
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177