ATLAS Offline Software
Loading...
Searching...
No Matches
Generators
PowhegControl
python
algorithms
preprocessors
preprocessors/directory_cleaner.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
glob
6
import
os
7
8
9
logger = Logging.logging.getLogger(
"PowhegControl"
)
10
11
12
@timed("directory cleaner")
13
def
directory_cleaner(*args):
14
"""! Clean up the directory before running.
15
16
Remove any existing LHE files to avoid repeated events.
17
18
@author James Robinson <james.robinson@cern.ch>
19
"""
20
for
LHE_file
in
glob.glob(
"*.lhe"
) + glob.glob(
"*.ev*ts"
):
21
logger.warning(
"Removing existing LHE file: {}"
.format(LHE_file))
22
os.remove(LHE_file)
Generated on
for ATLAS Offline Software by
1.14.0