ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.processes.powheg_base.PowhegBase Class Reference

Base class for PowhegBox processes. More...

Inheritance diagram for python.processes.powheg_base.PowhegBase:
Collaboration diagram for python.processes.powheg_base.PowhegBase:

Public Member Functions

def hoppet_info (self)
 
def hoppet_warning (self)
 
def openloops_error (self)
 
def manually_set_openloops_paths (self)
 
def manually_set_openloops_gnu_paths (self)
 
def link_madloop_libraries (self)
 
def link_external_powheg_libraries (self, librarypath)
 
def __init__ (self, base_directory, version, executable_name, cores, powheg_executable="pwhg_main", is_reweightable=True, warning_output=[], info_output=[], error_output=[], **kwargs)
 Constructor. More...
 
def add_algorithm (self, alg_or_process)
 Add an algorithm or external process to the sequence. More...
 
def files_for_cleanup (self)
 Wildcarded list of files created by this process that can be deleted. More...
 
def integration_file_names (self)
 Wildcarded list of integration files that might be created by this process. More...
 
def mandatory_integration_file_names (self)
 Wildcarded list of integration files that are needed for this process. More...
 
def powheg_version (self)
 Version of PowhegBox process. More...
 
def default_PDFs (self)
 Default PDFs for this process. More...
 
def default_scales (self)
 Default scale variations for this process. More...
 
def prepare_to_parallelise (self, n_cores)
 Scale calculation parameters by n_cores. More...
 
def stage_is_completed (self, stage)
 Set whether the specified POWHEG-BOX generation stage is complete. More...
 
def validate_parameters (self)
 Validate any parameters which need it before preparing runcard. More...
 
def validate_integration_parameters (self)
 Validate integration keywords by forcing to integer values. More...
 
def check_decay_mode (self, decay_mode, allowed_decay_modes=None)
 Check whether a decay mode is allowed an raise an exception if it is not. More...
 
def check_using_integration_files (self)
 
def modify_parameter (self, stage=0)
 
def set_parameter_in_config (self, key, value)
 
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. More...
 
def expose (self)
 Add all names to the interface of this object. More...
 
def has_keyword (self, keyword)
 
def has_parameter (self, parameter)
 
def parameters_by_keyword (self, keyword)
 Retrieve all parameters that use a given keyword. More...
 
def parameters_by_name (self, name)
 Retrieve all parameters that use a given name. More...
 

Public Attributes

 executable
 Powheg executable that will be used. More...
 
 process_revision
 SVN revision of process code. More...
 
 powhegbox_revision
 Log the PowhegBox version and process-code revision for AMI etc. More...
 
 cores
 Number of cores to use. More...
 
 algorithms
 List of additional algorithms to schedule. More...
 
 externals
 List of external processes to schedule. More...
 
 validation_functions
 List of validation functions to run before preparing runcard. More...
 
 is_reweightable
 Switch to determine whether reweighting is allowed. More...
 
 use_XML_reweighting
 Switch to determine whether XML reweighting should be used. More...
 
 remove_oldStyle_rwt_comments
 Switch to determine if the #rwgt and #pdf comments should be kept in lhe files despite using xml reweighting. More...
 
 warning_output
 Special treatment for some log messages. More...
 
 info_output
 
 error_output
 
 parameterStageDict
 Dictionary used to change parameters of the Powheg input. More...
 
 parameters
 List of available parameters. More...
 

Detailed Description

Base class for PowhegBox processes.

All process types inherit from this class.

Author
James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch
Stefan Richter stefa.nosp@m.n.ri.nosp@m.chter.nosp@m.@cer.nosp@m.n.ch

Definition at line 14 of file powheg_base.py.

Constructor & Destructor Documentation

◆ __init__()

def python.processes.powheg_base.PowhegBase.__init__ (   self,
  base_directory,
  version,
  executable_name,
  cores,
  powheg_executable = "pwhg_main",
  is_reweightable = True,
  warning_output = [],
  info_output = [],
  error_output = [],
**  kwargs 
)

Constructor.

Parameters
base_directorypath to PowhegBox code.
versionPowhegBox version.
executable_namefolder containing appropriate PowhegBox executable.
powheg_executablename of the powheg executable.
warning_outputlist of patterns which if found in the output will be treated as warning in the log.
error_outputlist of patterns which if found in the output will be treated as error in the log.
info_outputlist of patterns which if found in the output will be treated as info in the log.

Definition at line 138 of file powheg_base.py.

138  def __init__(self, base_directory, version, executable_name, cores, powheg_executable="pwhg_main", is_reweightable=True, warning_output = [], info_output = [], error_output = [], **kwargs):
139  """! Constructor.
140 
141  @param base_directory path to PowhegBox code.
142  @param version PowhegBox version.
143  @param executable_name folder containing appropriate PowhegBox executable.
144  @param powheg_executable name of the powheg executable.
145  @param warning_output list of patterns which if found in the output will be treated as warning in the log.
146  @param error_output list of patterns which if found in the output will be treated as error in the log.
147  @param info_output list of patterns which if found in the output will be treated as info in the log.
148  """
149  super(PowhegBase, self).__init__()
150 
151 
152  self.executable = os.path.join(base_directory, version, executable_name, powheg_executable)
153 
154 
155  self.process_revision = check_svn_revision(os.path.dirname(self.executable))
156 
157 
159  one_character_version = self.powheg_version.replace('V', '')[0]
160  POWHEGVER = '{v}_r{rev}'.format(v=one_character_version, rev=self.process_revision)
161  logger.info('MetaData: POWHEGVER = {0}'.format(POWHEGVER))
162  os.environ["POWHEGVER"] = POWHEGVER # does not export to parent shell, but might be sufficient inside job?
163 
164 
165  self.powhegbox_revision = check_svn_revision(os.path.dirname(os.path.dirname(self.executable)))
166 
167 
168  self.cores = cores
169 
170 
171  self.algorithms = []
172 
173 
174  self.externals = {}
175 
176 
177  self.validation_functions = []
178 
179  # Universal keywords that are set from the run arguments
180  self.add_keyword("ebeam1", kwargs.get("beam_energy", None))
181  self.add_keyword("ebeam2", kwargs.get("beam_energy", None))
182  self.add_keyword("iseed", int(kwargs.get("random_seed", None)))
183  self.add_keyword("numevts", kwargs.get("nEvents", None))
184 
185  # Add parameter validation functions
186  self.validation_functions.append("validate_integration_parameters")
187 
188 
189  self.is_reweightable = is_reweightable
190 
191 
192  self.use_XML_reweighting = None
193 
194 
195  self.remove_oldStyle_rwt_comments = None
196 
197 
198  self.warning_output = warning_output
199  self.info_output = info_output
200  self.error_output = error_output
201 
202 
204  self.parameterStageDict = {}
205 

Member Function Documentation

◆ add_algorithm()

def python.processes.powheg_base.PowhegBase.add_algorithm (   self,
  alg_or_process 
)

Add an algorithm or external process to the sequence.

Parameters
processAlgorithm or external process to add.

Definition at line 206 of file powheg_base.py.

206  def add_algorithm(self, alg_or_process):
207  """! Add an algorithm or external process to the sequence.
208 
209  @param process Algorithm or external process to add.
210  """
211  # Either add to the list of algorithms to schedule
212  if isinstance(alg_or_process, str):
213  self.algorithms.append(alg_or_process)
214  # ... or add as an external process
215  else:
216  self.externals[alg_or_process.name] = alg_or_process
217 

◆ add_keyword()

def python.processes.configurable.Configurable.add_keyword (   self,
  keyword,
  value = None,
  name = None,
  frozen = None,
  hidden = None,
  description = None,
**  kwargs 
)
inherited

Register configurable parameter that is exposed to the user.

Parameters
keywordPowheg keyword that gets written to the runcard.
valueValue of the parameter.
nameConfigurable parameter name exposed to the user.
hiddenTrue if this parameter should be hidden from the user.
frozenTrue if this parameter cannot be changed.
descriptionDescription for the run card.
parameterName used in the run card if different.

Definition at line 21 of file configurable.py.

21  def add_keyword(self, keyword, value=None, name=None, frozen=None, hidden=None, description=None, **kwargs):
22  """! Register configurable parameter that is exposed to the user.
23 
24  @param keyword Powheg keyword that gets written to the runcard.
25  @param value Value of the parameter.
26  @param name Configurable parameter name exposed to the user.
27  @param hidden True if this parameter should be hidden from the user.
28  @param frozen True if this parameter cannot be changed.
29  @param description Description for the run card.
30  @param parameter Name used in the run card if different.
31  """
32  # Retrieve default settings from registry overriding if requested
33  defaults = Registry().get_defaults(keyword)
34  if value == defaults["value"] and value is not None and (hidden is not True):
35  if keyword not in ["ebeam1", "ebeam2"]:
36  logger.debug("Unnecessarily setting parameter {} to {} which is its default value!".format(keyword, value))
37  value = [value, defaults["value"]][value is None]
38  name = [name, defaults["name"]][name is None]
39  description = [description, defaults["description"]][description is None]
40  hidden = [hidden, defaults["hidden"]][hidden is None]
41  frozen = [frozen, defaults["frozen"]][frozen is None]
42  if keyword in [p.keyword for p in self.parameters]:
43  raise AttributeError("Keyword '{}' has already been defined for this process".format(keyword))
44  self.parameters.append(Parameter(keyword, name=name, value=value, frozen=frozen, hidden=hidden, description=description, **kwargs))
45 

◆ check_decay_mode()

def python.processes.powheg_base.PowhegBase.check_decay_mode (   self,
  decay_mode,
  allowed_decay_modes = None 
)

Check whether a decay mode is allowed an raise an exception if it is not.

Definition at line 281 of file powheg_base.py.

281  def check_decay_mode(self, decay_mode, allowed_decay_modes=None):
282  """! Check whether a decay mode is allowed an raise an exception if it is not."""
283  if allowed_decay_modes is None:
284  allowed_decay_modes = self.allowed_decay_modes
285  if decay_mode not in allowed_decay_modes:
286  logger.warning("Decay mode {} not recognised!".format(decay_mode))
287  logger.info("Allowed decay modes are:")
288  for allowed_decay_mode in allowed_decay_modes:
289  logger.info("... {}".format(allowed_decay_mode))
290  raise ValueError("Decay mode {} not recognised!".format(decay_mode))
291 

◆ check_using_integration_files()

def python.processes.powheg_base.PowhegBase.check_using_integration_files (   self)

Definition at line 292 of file powheg_base.py.

293 
294  search_strings = [] # list of filename patters to be searched for
295  found_files = [] # list of found files will be printed out for info
296  missing_patterns = [] # list of filename patters which hasn't been found but would be needed for pre-made integration grids
297  try:
298  search_strings = self.mandatory_integration_file_names
299  except AttributeError:
300  logger.fatal("No integration grid file name patterns defined for this process.")
301  raise
302  for s in search_strings:
303  found = glob.glob(s)
304  if found != []:
305  found_files += found
306  else:
307  missing_patterns.append(s)
308  if missing_patterns == []:
309  logger.info("Integration grid files found locally. Event generation shall continue, skipping the integration step.")
310  logger.info("Integration grid files found locally: {}".format(found_files))
311  else:
312  logger.info("Integration grid files needed were not found locally. Event generation shall continue, starting by the integration step.")
313  logger.info("Missing integration grid files with these patterns: {}".format(missing_patterns))
314  logger.info("Integration grid files found locally (if any): {}".format(found_files))
315 
316 

◆ default_PDFs()

def python.processes.powheg_base.PowhegBase.default_PDFs (   self)

Default PDFs for this process.

Reimplemented in python.processes.powheg_RES.PowhegRES, python.processes.powheg_V2.PowhegV2, and python.processes.powheg_V1.PowhegV1.

Definition at line 239 of file powheg_base.py.

239  def default_PDFs(self):
240  """! Default PDFs for this process."""
241  raise AttributeError("Default PDFs are not known for this process!")
242 

◆ default_scales()

def python.processes.powheg_base.PowhegBase.default_scales (   self)

Default scale variations for this process.

Reimplemented in python.processes.powheg_RES.PowhegRES, python.processes.powheg_V2.PowhegV2, and python.processes.powheg_V1.PowhegV1.

Definition at line 244 of file powheg_base.py.

244  def default_scales(self):
245  """! Default scale variations for this process."""
246  raise AttributeError("Default scales are not known for this process!")
247 

◆ expose()

def python.processes.configurable.Configurable.expose (   self)
inherited

Add all names to the interface of this object.

Definition at line 46 of file configurable.py.

46  def expose(self):
47  """! Add all names to the interface of this object."""
48  for parameter in self.parameters:
49  setattr(self, parameter.name, parameter.value)
50 

◆ files_for_cleanup()

def python.processes.powheg_base.PowhegBase.files_for_cleanup (   self)

Wildcarded list of files created by this process that can be deleted.

Reimplemented in python.processes.powheg_RES.PowhegRES, python.processes.powheg_V2.PowhegV2, and python.processes.powheg_V1.PowhegV1.

Definition at line 219 of file powheg_base.py.

219  def files_for_cleanup(self):
220  """! Wildcarded list of files created by this process that can be deleted."""
221  raise AttributeError("Names of unneeded files are not known for this process!")
222 

◆ has_keyword()

def python.processes.configurable.Configurable.has_keyword (   self,
  keyword 
)
inherited

Definition at line 51 of file configurable.py.

51  def has_keyword(self, keyword):
52  return (len(list(self.parameters_by_keyword(keyword))) > 0)
53 

◆ has_parameter()

def python.processes.configurable.Configurable.has_parameter (   self,
  parameter 
)
inherited

Definition at line 54 of file configurable.py.

54  def has_parameter(self, parameter):
55  return (len(list(self.parameters_by_name(parameter))) > 0)
56 

◆ hoppet_info()

def python.processes.powheg_base.PowhegBase.hoppet_info (   self)
Returns a list of strings to be treated as info messages in the log
They otherwise throw an error with HOPPET v. 1.2.0
Cf. AGENE-2016

Definition at line 23 of file powheg_base.py.

23  def hoppet_info(self):
24  '''
25  Returns a list of strings to be treated as info messages in the log
26  They otherwise throw an error with HOPPET v. 1.2.0
27  Cf. AGENE-2016
28  '''
29  return ["-----------------------------------------------------------",
30  "Welcome to HOPPET v. 1.2.0",
31  "Higher Order Perturbative Parton Evolution Toolkit",
32  "Written by Gavin P. Salam (2001-2012)",
33  "with contributions from Juan Rojo",
34  "Frederic Dreyer and Alexander Karlberg",
35  "It is made available under the GNU public license,",
36  "with the additional request that if you use it or any",
37  "derivative of it in scientific work then you should cite:",
38  "G.P. Salam & J. Rojo, CPC 180(2009)120 (arXiv:0804.3755).",
39  "You are also encouraged to cite the original references,",
40  "for LO, NLO and NNLO splitting functions, the QCD",
41  "1, 2 and 3 loop beta functions and the coupling and",
42  "PDF and coupling mass threshold matching functions."]
43 

◆ hoppet_warning()

def python.processes.powheg_base.PowhegBase.hoppet_warning (   self)
Returns a list of strings to be treated as warning messages in the log
They otherwise throw an error

Definition at line 44 of file powheg_base.py.

44  def hoppet_warning(self):
45  '''
46  Returns a list of strings to be treated as warning messages in the log
47  They otherwise throw an error
48  '''
49  return ["WARNING in InitMTMNNLO: using parametrisation (less accuracte) for A2PShg"]
50 

◆ integration_file_names()

def python.processes.powheg_base.PowhegBase.integration_file_names (   self)

Wildcarded list of integration files that might be created by this process.

Reimplemented in python.processes.powheg_RES.PowhegRES, python.processes.powheg_V2.PowhegV2, and python.processes.powheg_V1.PowhegV1.

Definition at line 224 of file powheg_base.py.

224  def integration_file_names(self):
225  """! Wildcarded list of integration files that might be created by this process."""
226  raise AttributeError("Integration file names are not known for this process!")
227 

◆ link_external_powheg_libraries()

def python.processes.powheg_base.PowhegBase.link_external_powheg_libraries (   self,
  librarypath 
)
Manual fix for external libraries path.
This library is expected to be installed in the POWHEGPATH folder.
Needs to be adjusted if the version of the library changes.

Definition at line 123 of file powheg_base.py.

123  def link_external_powheg_libraries(self, librarypath):
124  '''
125  Manual fix for external libraries path.
126  This library is expected to be installed in the POWHEGPATH folder.
127  Needs to be adjusted if the version of the library changes.
128  '''
129  logger.warning("Applying manual fixes for library paths:" + librarypath)
130  logger.debug("LD_LIBRARY_PATH (before) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
131  ldpath = os.getenv('LD_LIBRARY_PATH')
132  powhegpath = os.getenv('POWHEGPATH')
133  librarypath = glob.glob(powhegpath+librarypath)
134  ldpath_new = ldpath+ ":" + librarypath[0]
135  os.environ['LD_LIBRARY_PATH'] = ldpath_new
136  logger.debug("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
137 

◆ link_madloop_libraries()

def python.processes.powheg_base.PowhegBase.link_madloop_libraries (   self)
Manual fix for MadLoop libraries, avoiding issues when /afs not available
This is NOT a viable long-term solution and should be made obsolete after the migration
The trick consists in making a symbolic link of some directory in the installation
which contains some files needed by MadLoop

Definition at line 95 of file powheg_base.py.

95  def link_madloop_libraries(self):
96  '''
97  Manual fix for MadLoop libraries, avoiding issues when /afs not available
98  This is NOT a viable long-term solution and should be made obsolete after the migration
99  The trick consists in making a symbolic link of some directory in the installation
100  which contains some files needed by MadLoop
101  '''
102  import os
103  logger.warning("Applying manual, hard-coded fixes for MadLoop library paths")
104  MadLoop_virtual = os.path.dirname(self.executable)+"/virtual"
105  logger.info("Trying to link directory {} locally".format(MadLoop_virtual))
106  if not os.access(MadLoop_virtual,os.R_OK):
107  logger.fatal("Impossible to access directory {} needed for this process which uses MadLoop".format(MadLoop_virtual))
108  if os.access("virtual",os.R_OK):# checking if link already exists
109  logger.info("Found \"virtual\" probably from previous run - deleting it to recreate it with correct path")
110  try:
111  os.remove("virtual")
112  except Exception:
113  logger.fatal("Impossible to remove \"virtual\" symbolic link - exiting...")
114  raise
115  os.symlink(MadLoop_virtual, "virtual")
116  link = os.readlink("virtual")
117  if link != MadLoop_virtual:
118  logger.fatal("Symbolic link \"virtual\" points to {0} while it should point to {1} - linking probably didn't work. Exiting...".format(link,MadLoop_virtual))
119  raise
120  else:
121  logger.info("Local directory \"virtual\" now points to {}".format(MadLoop_virtual))
122 

◆ mandatory_integration_file_names()

def python.processes.powheg_base.PowhegBase.mandatory_integration_file_names (   self)

Wildcarded list of integration files that are needed for this process.

Reimplemented in python.processes.powheg_V2.PowhegV2, python.processes.powheg_RES.PowhegRES, and python.processes.powheg_V1.PowhegV1.

Definition at line 229 of file powheg_base.py.

230  """! Wildcarded list of integration files that are needed for this process."""
231  raise AttributeError("Integration file names are not known for this process!")
232 

◆ manually_set_openloops_gnu_paths()

def python.processes.powheg_base.PowhegBase.manually_set_openloops_gnu_paths (   self)
Manual fix for OpenLoops libraries path, avoiding issues when /afs not available
This is NOT a viable long-term solution and should be made obsolete after the migration
away from AFS is more advanced.

Definition at line 76 of file powheg_base.py.

77  '''
78  Manual fix for OpenLoops libraries path, avoiding issues when /afs not available
79  This is NOT a viable long-term solution and should be made obsolete after the migration
80  away from AFS is more advanced.
81  '''
82  import os
83  logger.warning("Applying manual, hard-coded fixes for OpenLoops library paths")
84  logger.info("OpenLoopsPath (before) = {0}".format(os.getenv('OpenLoopsPath')))
85  logger.debug("LD_LIBRARY_PATH (before) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
86  OLPath = os.path.dirname(self.executable)+"/obj-gnu"
87  os.environ['OpenLoopsPath'] = OLPath
88  ldpath = os.getenv('LD_LIBRARY_PATH')
89  ldpath_new = OLPath+ ":" + OLPath + "/proclib:" + ldpath
90  os.environ['LD_LIBRARY_PATH'] = ldpath_new
91  logger.info("OpenLoopsPath (after) = {0}".format(os.getenv('OpenLoopsPath')))
92  logger.debug("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
93 
94 

◆ manually_set_openloops_paths()

def python.processes.powheg_base.PowhegBase.manually_set_openloops_paths (   self)
Manual fix for OpenLoops libraries path, avoiding issues when /afs not available
This is NOT a viable long-term solution and should be made obsolete after the migration
away from AFS is more advanced.

Definition at line 58 of file powheg_base.py.

59  '''
60  Manual fix for OpenLoops libraries path, avoiding issues when /afs not available
61  This is NOT a viable long-term solution and should be made obsolete after the migration
62  away from AFS is more advanced.
63  '''
64  import os
65  logger.warning("Applying manual, hard-coded fixes for OpenLoops library paths")
66  logger.info("OpenLoopsPath (before) = {0}".format(os.getenv('OpenLoopsPath')))
67  logger.debug("LD_LIBRARY_PATH (before) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
68  OLPath = os.path.dirname(self.executable)+"/obj-gfortran"
69  os.environ['OpenLoopsPath'] = OLPath
70  ldpath = os.getenv('LD_LIBRARY_PATH')
71  ldpath_new = OLPath+ ":" + OLPath + "/proclib:" + ldpath
72  os.environ['LD_LIBRARY_PATH'] = ldpath_new
73  logger.info("OpenLoopsPath (after) = {0}".format(os.getenv('OpenLoopsPath')))
74  logger.debug("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
75 

◆ modify_parameter()

def python.processes.powheg_base.PowhegBase.modify_parameter (   self,
  stage = 0 
)

Definition at line 317 of file powheg_base.py.

317  def modify_parameter(self, stage = 0):
318 
319  #skip modifying if dict is empty
320  if not bool(self.parameterStageDict):
321  return
322 
323  logger.info("Modifying parameters for the stages : {0}".format(self.parameterStageDict))
324 
325 
326  for key in self.parameterStageDict:
327  settingsList = self.parameterStageDict[key]
328  if abs(settingsList[2] - stage) <=1e-09:
329  self.set_parameter_in_config(key,settingsList[1])
330  else:
331  self.set_parameter_in_config(key,settingsList[0])
332 

◆ openloops_error()

def python.processes.powheg_base.PowhegBase.openloops_error (   self)
Returns a list of strings to be treated as error messages in the log
They otherwise do not throw an error

Definition at line 51 of file powheg_base.py.

51  def openloops_error(self):
52  '''
53  Returns a list of strings to be treated as error messages in the log
54  They otherwise do not throw an error
55  '''
56  return ["[POWHEG-BOX+OpenLoops] Process not found!"]
57 

◆ parameters_by_keyword()

def python.processes.configurable.Configurable.parameters_by_keyword (   self,
  keyword 
)
inherited

Retrieve all parameters that use a given keyword.

Parameters
keywordPowheg keyword that gets written to the runcard.

Definition at line 57 of file configurable.py.

57  def parameters_by_keyword(self, keyword):
58  """! Retrieve all parameters that use a given keyword.
59 
60  @param keyword Powheg keyword that gets written to the runcard.
61  """
62  return [p for p in self.parameters if p.keyword == keyword]
63 

◆ parameters_by_name()

def python.processes.configurable.Configurable.parameters_by_name (   self,
  name 
)
inherited

Retrieve all parameters that use a given name.

Parameters
nameConfigurable parameter name exposed to the user.

Definition at line 64 of file configurable.py.

64  def parameters_by_name(self, name):
65  """! Retrieve all parameters that use a given name.
66 
67  @param name Configurable parameter name exposed to the user.
68  """
69  return [p for p in self.parameters if p.name == name]

◆ powheg_version()

def python.processes.powheg_base.PowhegBase.powheg_version (   self)

Version of PowhegBox process.

Reimplemented in python.processes.powheg_V2.PowhegV2, python.processes.powheg_RES.PowhegRES, and python.processes.powheg_V1.PowhegV1.

Definition at line 234 of file powheg_base.py.

234  def powheg_version(self):
235  """! Version of PowhegBox process."""
236  raise AttributeError("Powheg version is not known!")
237 

◆ prepare_to_parallelise()

def python.processes.powheg_base.PowhegBase.prepare_to_parallelise (   self,
  n_cores 
)

Scale calculation parameters by n_cores.

Definition at line 248 of file powheg_base.py.

248  def prepare_to_parallelise(self, n_cores):
249  """! Scale calculation parameters by n_cores."""
250  __nEvents_unscaled = self.parameters_by_keyword("numevts")[0].value
251  for keyword in ["ncall1", "ncall1rm", "ncall2", "ncall2rm", "nubound", "numevts"]:
252  for parameter in self.parameters_by_keyword(keyword):
253  if int(parameter.value) > 0:
254  parameter.value = int(math.ceil(float(parameter.value) / n_cores))
255  __nEvents_scaled = self.parameters_by_keyword("numevts")[0].value
256  logger.info("Scaling number of events per job from {} down to {}".format(__nEvents_unscaled, __nEvents_scaled))
257  # Freeze parallelstage parameters before printing list for user
258  [parameter.freeze() for parameter in self.parameters_by_name("parallelstage")]
259 

◆ set_parameter_in_config()

def python.processes.powheg_base.PowhegBase.set_parameter_in_config (   self,
  key,
  value 
)

Definition at line 333 of file powheg_base.py.

333  def set_parameter_in_config(self, key, value):
334  FileParser("powheg.input").text_replace(key+".*", key+" {}".format(value))

◆ stage_is_completed()

def python.processes.powheg_base.PowhegBase.stage_is_completed (   self,
  stage 
)

Set whether the specified POWHEG-BOX generation stage is complete.

Reimplemented in python.processes.powheg_V2.PowhegV2, and python.processes.powheg_RES.PowhegRES.

Definition at line 260 of file powheg_base.py.

260  def stage_is_completed(self, stage):
261  """! Set whether the specified POWHEG-BOX generation stage is complete."""
262  # Perform manual check to allow re-use of grids in multicore mode
263  return False
264 

◆ validate_integration_parameters()

def python.processes.powheg_base.PowhegBase.validate_integration_parameters (   self)

Validate integration keywords by forcing to integer values.

Definition at line 270 of file powheg_base.py.

271  """! Validate integration keywords by forcing to integer values."""
272  self.expose() # convenience call to simplify syntax
273  for name in ("foldcsi", "foldphi", "foldy", "itmx1", "itmx2", "ncall1", "ncall2", "nEvents"):
274  for parameter in self.parameters_by_name(name):
275  try:
276  parameter.value = int(parameter.value)
277  except TypeError:
278  logger.fatal("Failed to validate {} with value {}".format(name, parameter.value))
279  raise
280 

◆ validate_parameters()

def python.processes.powheg_base.PowhegBase.validate_parameters (   self)

Validate any parameters which need it before preparing runcard.

Definition at line 265 of file powheg_base.py.

265  def validate_parameters(self):
266  """! Validate any parameters which need it before preparing runcard."""
267  for function_name in self.validation_functions:
268  getattr(self, function_name)()
269 

Member Data Documentation

◆ algorithms

python.processes.powheg_base.PowhegBase.algorithms

List of additional algorithms to schedule.

Definition at line 171 of file powheg_base.py.

◆ cores

python.processes.powheg_base.PowhegBase.cores

Number of cores to use.

Definition at line 168 of file powheg_base.py.

◆ error_output

python.processes.powheg_base.PowhegBase.error_output

Definition at line 200 of file powheg_base.py.

◆ executable

python.processes.powheg_base.PowhegBase.executable

Powheg executable that will be used.

Definition at line 152 of file powheg_base.py.

◆ externals

python.processes.powheg_base.PowhegBase.externals

List of external processes to schedule.

Definition at line 174 of file powheg_base.py.

◆ info_output

python.processes.powheg_base.PowhegBase.info_output

Definition at line 199 of file powheg_base.py.

◆ is_reweightable

python.processes.powheg_base.PowhegBase.is_reweightable

Switch to determine whether reweighting is allowed.

Definition at line 189 of file powheg_base.py.

◆ parameters

python.processes.configurable.Configurable.parameters
inherited

List of available parameters.

Definition at line 19 of file configurable.py.

◆ parameterStageDict

python.processes.powheg_base.PowhegBase.parameterStageDict

Dictionary used to change parameters of the Powheg input.

The structure is: {"parameter" : [default_value, changed_value, parallelstage_to_changed_value]}

Definition at line 204 of file powheg_base.py.

◆ powhegbox_revision

python.processes.powheg_base.PowhegBase.powhegbox_revision

Log the PowhegBox version and process-code revision for AMI etc.

Also set environment variable POWHEGVER to this contain this information SVN revision of PowhegBox code

Definition at line 165 of file powheg_base.py.

◆ process_revision

python.processes.powheg_base.PowhegBase.process_revision

SVN revision of process code.

Definition at line 155 of file powheg_base.py.

◆ remove_oldStyle_rwt_comments

python.processes.powheg_base.PowhegBase.remove_oldStyle_rwt_comments

Switch to determine if the #rwgt and #pdf comments should be kept in lhe files despite using xml reweighting.

Definition at line 195 of file powheg_base.py.

◆ use_XML_reweighting

python.processes.powheg_base.PowhegBase.use_XML_reweighting

Switch to determine whether XML reweighting should be used.

Definition at line 192 of file powheg_base.py.

◆ validation_functions

python.processes.powheg_base.PowhegBase.validation_functions

List of validation functions to run before preparing runcard.

Definition at line 177 of file powheg_base.py.

◆ warning_output

python.processes.powheg_base.PowhegBase.warning_output

Special treatment for some log messages.

Definition at line 198 of file powheg_base.py.


The documentation for this class was generated from the following file:
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
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.hoppet_info
def hoppet_info(self)
Definition: powheg_base.py:23
python.processes.powheg_base.PowhegBase.validate_parameters
def validate_parameters(self)
Validate any parameters which need it before preparing runcard.
Definition: powheg_base.py:265
python.utility.revision_checking.check_svn_revision
def check_svn_revision(path)
Definition: revision_checking.py:6
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:206
python.processes.powheg_base.PowhegBase.hoppet_warning
def hoppet_warning(self)
Definition: powheg_base.py:44
python.processes.powheg_base.PowhegBase.manually_set_openloops_gnu_paths
def manually_set_openloops_gnu_paths(self)
Definition: powheg_base.py:76
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.processes.powheg_base.PowhegBase.check_using_integration_files
def check_using_integration_files(self)
Definition: powheg_base.py:292
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_V2.PowhegV2.files_for_cleanup
def files_for_cleanup(self)
Wildcarded list of files created by this process that can be deleted.
Definition: powheg_V2.py:47
python.processes.configurable.Configurable.has_parameter
def has_parameter(self, parameter)
Definition: configurable.py:54
python.processes.powheg_base.PowhegBase.prepare_to_parallelise
def prepare_to_parallelise(self, n_cores)
Scale calculation parameters by n_cores.
Definition: powheg_base.py:248
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.processes.powheg_base.PowhegBase.openloops_error
def openloops_error(self)
Definition: powheg_base.py:51
python.processes.powheg_base.PowhegBase.set_parameter_in_config
def set_parameter_in_config(self, key, value)
Definition: powheg_base.py:333
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_V2.PowhegV2.powheg_version
def powheg_version(self)
Version of PowhegBox process.
Definition: powheg_V2.py:92
python.processes.powheg_base.PowhegBase.check_decay_mode
def check_decay_mode(self, decay_mode, allowed_decay_modes=None)
Check whether a decay mode is allowed an raise an exception if it is not.
Definition: powheg_base.py:281
python.processes.powheg_base.PowhegBase.validate_integration_parameters
def validate_integration_parameters(self)
Validate integration keywords by forcing to integer values.
Definition: powheg_base.py:270
python.processes.powheg_V2.PowhegV2.default_scales
def default_scales(self)
Default scale variations for this process.
Definition: powheg_V2.py:41
python.processes.powheg_base.PowhegBase.link_external_powheg_libraries
def link_external_powheg_libraries(self, librarypath)
Definition: powheg_base.py:123
python.processes.powheg_base.PowhegBase.link_madloop_libraries
def link_madloop_libraries(self)
Definition: powheg_base.py:95
python.processes.powheg_V2.PowhegV2.mandatory_integration_file_names
def mandatory_integration_file_names(self)
Wildcarded list of integration files that are needed for this process.
Definition: powheg_V2.py:80
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.processes.powheg_base.PowhegBase.modify_parameter
def modify_parameter(self, stage=0)
Definition: powheg_base.py:317
python.KeyStore.list
def list(self, key=None)
Definition: KeyStore.py:318
python.processes.powheg_V2.PowhegV2.integration_file_names
def integration_file_names(self)
Wildcarded list of integration files that might be created by this process.
Definition: powheg_V2.py:67
python.processes.powheg_V2.PowhegV2.default_PDFs
def default_PDFs(self)
Default PDFs for this process.
Definition: powheg_V2.py:27
python.processes.configurable.Configurable.has_keyword
def has_keyword(self, keyword)
Definition: configurable.py:51
python.processes.powheg_base.PowhegBase.manually_set_openloops_paths
def manually_set_openloops_paths(self)
Definition: powheg_base.py:58
python.processes.powheg_V2.PowhegV2.stage_is_completed
def stage_is_completed(self, stage)
Set whether the specified POWHEG-BOX generation stage is complete.
Definition: powheg_V2.py:96
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
readCCLHist.float
float
Definition: readCCLHist.py:83