3 from AthenaCommon
import Logging
4 from .external_base
import ExternalBase
8 logger = Logging.logging.getLogger(
"PowhegControl")
12 """! Class for running external NNLO reweighting process.
14 @author James Robinson <james.robinson@cern.ch>
20 @param executable_path path to appropriate PowhegBox executable.
22 super(ExternalNNLOReweighter, self).
__init__(
"NNLO reweighter", *executable_path)
29 """! Report whether the NNLO reweighting process should be scheduled.
31 @param process PowhegBox process.
35 if len(self.NNLO_reweighting_inputs) == 0:
38 if not isinstance(self.NNLO_reweighting_inputs, collections.OrderedDict):
39 if isinstance(self.NNLO_reweighting_inputs, dict):
40 self.decorated.logger.warning(
"NNLO_reweighting_inputs has been provided as an old-style unordered dictionary.")
42 self.decorated.logger.fatal(
"NNLO_reweighting_inputs does not appear to be a valid label => file dictionary!")
43 raise ValueError(
"NNLO reweighting cannot be performed")
45 if not isinstance(self.NNLO_output_weights, collections.OrderedDict):
46 if isinstance(self.NNLO_output_weights, dict):
47 self.decorated.logger.warning(
"NNLO_output_weights has been provided as an unordered dictionary! Weight numbering will be arbitrary")
49 self.decorated.logger.fatal(
"NNLO_output_weights does not appear to be a valid ID string => calculation dictionary!")
50 raise ValueError(
"NNLO reweighting cannot be performed")
52 process.add_algorithm(
"reweighting")