ATLAS Offline Software
Functions
python.algorithms.preprocessors.reweighter Namespace Reference

Functions

def reweighter (process, *args)
 Prepare for reweighting by enabling the runcard option. More...
 

Function Documentation

◆ reweighter()

def python.algorithms.preprocessors.reweighter.reweighter (   process,
args 
)

Prepare for reweighting by enabling the runcard option.

Author
James Robinson james.nosp@m..rob.nosp@m.inson.nosp@m.@cer.nosp@m.n.ch

Definition at line 9 of file preprocessors/reweighter.py.

9 def reweighter(process, *args):
10  """! Prepare for reweighting by enabling the runcard option.
11 
12  @author James Robinson <james.robinson@cern.ch>
13  """
14  # Alter/remove runcard options depending on which weighting scheme is being used
15  if process.use_XML_reweighting:
16  FileParser("powheg.input").text_remove("lhrwgt_descr")
17  FileParser("powheg.input").text_remove("lhrwgt_group_combine")
18  FileParser("powheg.input").text_remove("lhrwgt_group_name")
19  FileParser("powheg.input").text_remove("lhrwgt_id")
20  FileParser("powheg.input").text_remove("storeinfo_rwgt")
21  else:
22  FileParser("powheg.input").text_remove("rwl_add")
23  FileParser("powheg.input").text_remove("rwl_file")
24  FileParser("powheg.input").text_remove("rwl_format_rwgt")
25  FileParser("powheg.input").text_remove("rwl_group_events")
26  # Enable #rwgt information lines - these cause Pythia to crash if present in the final output
27  FileParser("powheg.input").text_replace("storeinfo_rwgt 0", "storeinfo_rwgt 1")
28 
29  # Make a copy of the nominal input file
30  shutil.copy("powheg.input", "powheg_nominal.input")
31 
python.algorithms.preprocessors.reweighter.reweighter
def reweighter(process, *args)
Prepare for reweighting by enabling the runcard option.
Definition: preprocessors/reweighter.py:9