ATLAS Offline Software
output_file_renamer.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon import Logging
4 from ...decorators import timed
5 import os
6 
7 
8 logger = Logging.logging.getLogger("PowhegControl")
9 
10 
11 @timed("output file renaming")
12 def output_file_renamer(output_events_name, powheg_LHE_output):
13  """! Move output to correctly named file.
14 
15  @param output_file_name Name of output LHE file.
16  @param powheg_LHE_output Name of LHE file produced by PowhegBox.
17 
18  @author James Robinson <james.robinson@cern.ch>
19  """
20  logger.info("Starting to run PowhegControl output file renamer")
21  try:
22  os.rename(powheg_LHE_output, output_events_name)
23  logger.info("Moved {} to {}".format(powheg_LHE_output, output_events_name))
24  except OSError:
25  logger.warning("No output LHEF file found! Probably because the Powheg process was killed before finishing.")
26  raise RuntimeError("No output LHEF file produced by Powheg. Terminating job.")
python.decorators.timed.timed
def timed(name)
Decorator to output function execution time.
Definition: timed.py:12
vtune_athena.format
format
Definition: vtune_athena.py:14
python.algorithms.postprocessors.output_file_renamer.output_file_renamer
def output_file_renamer(output_events_name, powheg_LHE_output)
Move output to correctly named file.
Definition: output_file_renamer.py:12