ATLAS Offline Software
Generators
PowhegControl
python
processes
external
external_madspin.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3
import
os
4
from
AthenaCommon
import
Logging
5
from
.external_base
import
ExternalBase
6
7
8
logger = Logging.logging.getLogger(
"PowhegControl"
)
9
10
11
class
ExternalMadSpin
(
ExternalBase
):
12
"""! Class for running external MadSpin process.
13
14
@author James Robinson <james.robinson@cern.ch>
15
"""
16
17
def
__init__
(self, process):
18
"""! Constructor.
19
20
@param process MadSpin process description string.
21
"""
22
super(ExternalMadSpin, self).
__init__
(
"MadSpin"
, os.environ[
"MADPATH"
],
"MadSpin"
,
"madspin"
)
23
24
# Add parameters used by MadSpin
25
self.
add_keyword
(
"alphaem_inv"
)
26
self.
add_keyword
(
"alphaqcd"
)
27
self.
add_keyword
(
"BR_t_to_Wb"
)
28
self.
add_keyword
(
"BR_t_to_Wd"
)
29
self.
add_keyword
(
"BR_t_to_Ws"
)
30
self.
add_keyword
(
"BR_W_to_hadrons"
)
31
self.
add_keyword
(
"BR_W_to_leptons"
)
32
self.
add_keyword
(
"bwcutoff"
)
33
self.
add_keyword
(
"ebeam1"
)
34
self.
add_keyword
(
"G_F"
)
35
self.
add_keyword
(
"MadSpin_decays"
)
36
self.
add_keyword
(
"MadSpin_enabled"
)
37
self.
add_keyword
(
"MadSpin_model"
)
38
self.
add_keyword
(
"MadSpin_mode"
)
39
self.
add_keyword
(
"MadSpin_nFlavours"
)
40
self.
add_keyword
(
"MadSpin_process"
, process)
41
self.
add_keyword
(
"MadSpin_taus_are_leptons"
)
42
self.
add_keyword
(
"MadSpin_max_weight_ps_point"
)
43
self.
add_keyword
(
"MadSpin_Nevents_for_max_weight"
)
44
self.
add_keyword
(
"MadSpin_paramcard"
)
45
self.
add_keyword
(
"mass_b"
)
46
self.
add_keyword
(
"mass_H"
)
47
self.
add_keyword
(
"mass_t"
)
48
self.
add_keyword
(
"mass_tau"
)
49
self.
add_keyword
(
"mass_W"
)
50
self.
add_keyword
(
"mass_Z"
)
51
self.
add_keyword
(
"powheg_top_decays_enabled"
)
52
self.
add_keyword
(
"width_H"
)
53
self.
add_keyword
(
"width_t"
)
54
self.
add_keyword
(
"width_W"
)
55
self.
add_keyword
(
"width_Z"
)
56
self.
add_keyword
(
"Wolfenstein_lambda"
)
# for madspin decays with ckm-changing models
57
self.
add_keyword
(
"Wolfenstein_A"
)
# for madspin decays with ckm-changing models
58
self.
add_keyword
(
"Wolfenstein_rho"
)
# for madspin decays with ckm-changing models
59
self.
add_keyword
(
"Wolfenstein_eta"
)
# for madspin decays with ckm-changing models
60
61
def
needs_scheduling
(self, process):
62
"""! Report whether the MadSpin process should be scheduled.
63
64
@param process PowhegBox process.
65
"""
66
# Check that MadSpin is not disabled
67
self.
expose
()
68
if
not
self.MadSpin_enabled:
69
logger.warning(
"MadSpin not enabled"
)
70
return
False
71
# Check that tops have not already been decayed
72
if
self.powheg_top_decays_enabled:
73
logger.info(
"Powheg top quark decays are enabled. MadSpin will not be used for decays."
)
74
return
False
75
# Check that decays are in correct format
76
if
not
isinstance(self.MadSpin_decays, list):
77
logger.warning(
"Could not interpret 'MadSpin_decays' argument as a list of allowed decays!"
)
78
return
False
79
# Check that decay list has at least one entry otherwise add defaults
80
if
len(self.MadSpin_decays) == 0:
81
logger.warning(
"No MadSpin decays specified, so defaults will be used."
)
82
for
decay
in
(
"t > w+ b, w+ > l+ vl"
,
"t~ > w- b~, w- > l- vl~"
,
"t > w+ b, w+ > j j"
,
"t~ > w- b~, w- > j j"
):
83
logger.info(
"... adding MadSpin decay: 'decay {0}'"
.
format
(decay))
84
list
(self.
parameters_by_name
(
"MadSpin_decays"
))[0].value.append(
"decay {0}"
.
format
(decay))
85
return
True
python.processes.configurable.Configurable.expose
def expose(self)
Add all names to the interface of this object.
Definition:
configurable.py:46
vtune_athena.format
format
Definition:
vtune_athena.py:14
python.processes.configurable.Configurable.parameters_by_name
def parameters_by_name(self, name)
Retrieve all parameters that use a given name.
Definition:
configurable.py:64
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_base.ExternalBase
Base class for external processes.
Definition:
external_base.py:11
python.processes.external.external_madspin.ExternalMadSpin
Class for running external MadSpin process.
Definition:
external_madspin.py:11
python.processes.external.external_madspin.ExternalMadSpin.__init__
def __init__(self, process)
Constructor.
Definition:
external_madspin.py:17
histSizes.list
def list(name, path='/')
Definition:
histSizes.py:38
python.processes.external.external_madspin.ExternalMadSpin.needs_scheduling
def needs_scheduling(self, process)
Report whether the MadSpin process should be scheduled.
Definition:
external_madspin.py:61
Generated on Fri Jan 10 2025 21:10:15 for ATLAS Offline Software by
1.8.18