|
ATLAS Offline Software
|
Go to the documentation of this file.
7 """! Class to store information about a single Powheg parameter.
9 @author James Robinson <james.robinson@cern.ch>
12 def __init__(self, keyword=None, name=None, value=None, description=None, frozen=False, hidden=False, needs_processing=False):
13 """! Initialise a parameter object.
15 @param keyword Powheg keyword.
16 @param name User-visible name.
17 @param value Current value.
18 @param description Human-readable description string.
19 @param frozen True if this parameter cannot be changed.
20 @param hidden True if this parameter should be hidden from the user.
21 @param needs_processing True if this parameter needs further processing.
33 """! String representation."""
34 current_value = [self.
value,
"'{}'".
format(self.
value)][any(x
in self.
name for x
in (
"lhrwgt",
"rwl_file"))]
39 """! Ensure that default value exists."""
44 """! Return the first element if input is a list, or the input otherwise.
46 @param to_check An iterable or non-iterable parameter
48 if isinstance(to_check, collections.abc.Iterable)
and not isinstance(to_check, str)
and len(to_check) > 0:
53 """! Freeze this parameter so that it cannot be changed."""
58 """! Retrieve the Powheg keyword."""
63 """! Retrieve the user-visible name."""
68 """! Indicator that this parameter needs further processing."""
73 """! Retrieve the current value of this parameter."""
78 """! Retrieve the default value of this parameter (if it exists)."""
85 """! Retrieve the human-readable description string."""
90 """! Boolean indicating whether this parameter can be changed."""
95 """! Boolean indicating whether this parameter is visible to the user."""
100 """! Boolean indicating whether this parameter should be hidden from the user."""
105 """! Set the value of this parameter (if it is not frozen)."""
107 raise AttributeError(
"Parameter {} cannot be changed in jobOptions.".
format(self.
name))
def needs_processing(self)
Indicator that this parameter needs further processing.
def __init__(self, keyword=None, name=None, value=None, description=None, frozen=False, hidden=False, needs_processing=False)
Initialise a parameter object.
def __str__(self)
String representation.
def freeze(self)
Freeze this parameter so that it cannot be changed.
def ensure_default(self)
Ensure that default value exists.
def __single_element(self, to_check)
Return the first element if input is a list, or the input otherwise.
def description(self)
Retrieve the human-readable description string.
def value(self)
Retrieve the current value of this parameter.
def default_value(self)
Retrieve the default value of this parameter (if it exists).
def keyword(self)
Retrieve the Powheg keyword.
Class to store information about a single Powheg parameter.
def is_frozen(self)
Boolean indicating whether this parameter can be changed.
def name(self)
Retrieve the user-visible name.
def is_hidden(self)
Boolean indicating whether this parameter is visible to the user.
def is_visible(self)
Boolean indicating whether this parameter should be hidden from the user.