3 from AthenaCommon
import Logging
4 from ...decorators
import timed
5 from ...utility
import FileParser, LHE
10 logger = Logging.logging.getLogger(
"PowhegControl")
13 @
timed(
"merge output")
15 """! Merge output events if running in multicore mode.
17 @param cores Number of cores in use.
18 @param n_events_unscaled Total number of events generated.
19 @param powheg_LHE_output Name of LHE file produced by PowhegBox.
21 @author James Robinson <james.robinson@cern.ch>
23 logger.info(
"Concatenating output LHE files: expecting {}, found {}".
format(cores, len(glob.glob(
"pwgevents*.lhe"))))
24 LHE.merge(
"pwgevents*.lhe", powheg_LHE_output)
25 subprocess.call(
"rm pwgevents-*.lhe 2> /dev/null", shell=
True)
27 FileParser(
"powheg*.input").text_replace(
"numevts .*",
"numevts {}".
format(n_events_unscaled))