Executor for skimming RAW events according to a list of run and event numbers.
More...
Executor for skimming RAW events according to a list of run and event numbers.
Definition at line 19 of file recoTransforms.py.
◆ preExecute()
def python.recoTransforms.skimRawExecutor.preExecute |
( |
|
self, |
|
|
|
input = set() , |
|
|
|
output = set() |
|
) |
| |
Definition at line 21 of file recoTransforms.py.
21 def preExecute(self, input = set(), output =
set()):
26 listEvtCommand = [
'AtlListBSEvents',
'-l']
27 listEvtCommand.extend(self.conf.argdict[
'inputBSFile'].value)
32 for line
in subprocess.check_output(listEvtCommand).
split(
"\n"):
33 if line.startswith(
"Index="):
35 splitStrings = line.split(
" ")
36 runprefix, runstr = splitStrings[1].
split(
"=")
37 evtprefix, evtstr = splitStrings[2].
split(
"=")
39 if runprefix !=
"Run" or evtprefix !=
"Event":
40 msg.warning(
"Failed to understand this line from AtlListBSEvents: %s", line)
42 runnumber =
int(runstr)
43 evtnumber =
int(evtstr)
46 rawEventList[runstr +
"-" + evtstr] =
True
47 msg.debug(
"Identified run %s, event %s in input RAW files", runstr, evtstr)
49 msg.warning(
"Failed to understand this line from AtlListBSEvents: %s", line)
50 except subprocess.CalledProcessError
as e:
51 errMsg =
"Call to AtlListBSEvents failed: {0}".
format(e)
53 raise trfExceptions.TransformExecutionException(trfExit.nameToCode(
"TRF_EXEC_SETUP_FAIL"), errMsg)
54 msg.info(
"Found %d events as skim candidates in RAW inputs", len(rawEventList))
57 slimmedFilterFile =
"slimmedFilterFile.{0}".
format(os.getpid())
58 with open(slimmedFilterFile,
"w")
as slimFF,
open(self.conf.argdict[
'filterFile'].value)
as masterFF:
62 runstr, evtstr = line.split()
63 if runstr +
"-" + evtstr
in rawEventList:
64 msg.debug(
"Found run %s, event %s in master filter list", runstr, evtstr)
65 os.write(slimFF.fileno(), line)
67 except ValueError
as e:
68 msg.warning(
"Failed to understand this line from master filter file: %s %s", line, e)
72 msg.info(
"No events matched in this input file - empty RAW file output will be made")
73 os.write(slimFF.fileno(),
"0 0\n")
74 msg.info(
"Matched %d lines from the master filter file against input events; wrote these to %s", count, slimmedFilterFile)
77 self._cmd = [
'acmd.py',
'filter-files']
79 self._cmd.
extend((
'-o', self.conf.argdict[
'outputBS_SKIMFile'].value[0]))
80 self._cmd.
extend((
'-s', slimmedFilterFile))
81 self._cmd.
extend(self.conf.argdict[
'inputBSFile'].value)
83 super(skimRawExecutor, self).preExecute()
◆ _cmd
python.recoTransforms.skimRawExecutor._cmd |
|
private |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.