ATLAS Offline Software
powheg_V2.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from .powheg_base import PowhegBase
4 import glob
5 
7  """! Base class for PowhegBox V2 processes.
8 
9  All V2 processes inherit from this class.
10 
11  @author James Robinson <james.robinson@cern.ch>
12  """
13 
14  def __init__(self, base_directory, executable_name, warning_output = [], info_output = [], error_output = [], **kwargs):
15  """! Constructor.
16 
17  @param base_directory path to PowhegBox code.
18  @param executable_name folder containing appropriate PowhegBox executable.
19  @param is_LO True if this is a leading-order process.
20  @param warning_output list of patterns which if found in the output will be treated as warning in the log.
21  @param error_output list of patterns which if found in the output will be treated as error in the log.
22  @param info_output list of patterns which if found in the output will be treated as info in the log.
23  """
24  super(PowhegV2, self).__init__(base_directory, "POWHEG-BOX-V2", executable_name=executable_name, warning_output=warning_output, info_output=info_output, error_output=error_output, **kwargs)
25 
26  @property
27  def default_PDFs(self):
28  """! Default PDFs for this process."""
29  __PDF_list = list(range(260000, 260101)) # NNPDF30_nlo_as_0118 central with eigensets
30  __PDF_list += [266000, 265000] # NNPDF30_nlo_as_0119 and NNPDF30_nlo_as_0117
31  __PDF_list += [303200] # NNPDF30_nnlo_as_0118_hessian
32  __PDF_list += [27400, 27100] # MSHT20nnlo_as118, MSHT20nlo_as118
33  __PDF_list += [14000, 14400] # CT18NNLO, CT18NLO
34  __PDF_list += [304400, 304200] # NNPDF31_nnlo_as_0118_hessian, NNPDF31_nlo_as_0118_hessian
35  __PDF_list += [331500, 331100] # NNPDF40_nnlo_as_01180_hessian, NNPDF40_nlo_as_01180
36  __PDF_list += [14200, 14300, 14100] # CT18ANNLO, CT18XNNLO and CT18ZNNLO
37  __PDF_list += list(range(93300, 93343)) # PDF4LHC21_40_pdfas with eigensets
38  __PDF_list += [338500, 338520, 338540] # NNPDF40MC_lo_as_01180, NNPDF40MC_nlo_as_01180, NNPDF40MC_nnlo_as_01180
39  return __PDF_list
40 
41  @property
42  def default_scales(self):
43  """! Default scale variations for this process."""
44  return [[1.0, 1.0, 1.0, 0.5, 0.5, 2.0, 2.0],\
45  [1.0, 0.5, 2.0, 0.5, 1.0, 1.0, 2.0]]
46 
47  @property
48  def files_for_cleanup(self):
49  """! Wildcarded list of files created by this process that can be deleted."""
50  return [
51  "bornequiv",
52  "FlavRegList",
53  "fort.18",
54  "mint_upb_btildeupb.top",
55  "mint_upb_remnupb.top",
56  "pwg*.top",
57  "pwgboundviolations*.dat",
58  "pwgcounters*.dat",
59  "pwgseeds.dat",
60  "pwgubsigma.dat",
61  "pwhg_checklimits",
62  "realequiv*",
63  "reweighting_input.xml",
64  "virtequiv"
65  ]
66 
67  @property
69  """! Wildcarded list of integration files that might be created by this process."""
70  """! All files matching these patterns will be included in the gridpack."""
71  return [
72  "pwg*xg*.dat",
73  "pwg*upb*.dat",
74  "pwggrid*.dat",
75  "pwgfullgrid*.dat",
76  "pwgubound*.dat",
77  "pwg*stat.dat",
78  ]
79 
80  @property
82  """! Wildcarded list of integration files that are needed for this process."""
83  """! If some of the patterns don't match any files before running, a warning will be made to inform that no pre-made integration grid will be used."""
84  return [
85  "pwg*xg*.dat",
86  #"pwg*upb*.dat", # not needed by ttj MiNNLO
87  "pwggrid*.dat",
88  #"pwgfullgrid*.dat", # not needed by ttj MiNNLO
89  "pwgubound*.dat",
90  ]
91 
92  @property
93  def powheg_version(self):
94  """! Version of PowhegBox process."""
95  return "V2"
96 
97  def stage_is_completed(self, stage):
98  """! Set whether the specified POWHEG-BOX generation stage is complete."""
99  if stage == 1:
100  required_files = ["pwg*xg*.dat"]
101  elif stage == 2:
102  required_files = ["pwg*upb*.dat", "pwggrid*.dat"]
103  elif stage == 3:
104  required_files = ["pwgfullgrid*.dat", "pwgubound*.dat"]
105  else:
106  return False
107 
108  # Check that required files have been found
109  for required_file in required_files:
110  if not glob.glob(required_file):
111  return False
112  return True
python.processes.powheg_base.PowhegBase
Base class for PowhegBox processes.
Definition: powheg_base.py:14
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:48
python.processes.powheg_V2.PowhegV2.powheg_version
def powheg_version(self)
Version of PowhegBox process.
Definition: powheg_V2.py:93
python.processes.powheg_V2.PowhegV2.__init__
def __init__(self, base_directory, executable_name, warning_output=[], info_output=[], error_output=[], **kwargs)
Constructor.
Definition: powheg_V2.py:14
python.processes.powheg_V2.PowhegV2.default_scales
def default_scales(self)
Default scale variations for this process.
Definition: powheg_V2.py:42
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
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:81
python.processes.powheg_V2.PowhegV2
Base class for PowhegBox V2 processes.
Definition: powheg_V2.py:6
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:68
python.processes.powheg_V2.PowhegV2.default_PDFs
def default_PDFs(self)
Default PDFs for this process.
Definition: powheg_V2.py:27
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:97