5 logName =
'logErrorHarvester'
6 if not hasattr(process,logName):
9 modulesFromAllOutput = set()
10 onlyOneOutput = (len(process.outputModules_()) == 1)
11 for o
in process.outputModules_().
values():
12 if not hasattr(o,
"outputCommands"):
14 modulesFromOutput = set()
16 if (
not onlyOneOutput)
and hasattr(o,
"SelectEvents")
and hasattr(o.SelectEvents,
"SelectEvents")
and o.SelectEvents.SelectEvents:
20 for ln
in o.outputCommands.value():
21 if -1 != ln.find(
"keep"):
24 if s[1].
find(
"*")==-1:
26 modulesFromOutput.add(s[1])
30 modulesFromAllOutput =modulesFromAllOutput.union(modulesFromOutput)
31 if hasattr(process.logErrorHarvester,
"includeModules"):
33 includeMods = set(process.logErrorHarvester.includeModules)
34 toExclude = includeMods.difference(modulesFromAllOutput)
35 if hasattr(process.logErrorHarvester,
"excludeModules"):
36 toExclude = toExclude.union(set(process.logErrorHarvester.excludeModules.value()))
37 process.logErrorHarvester.excludeModules = cms.untracked.vstring(sorted(toExclude))
39 process.logErrorHarvester.includeModules = cms.untracked.vstring(sorted(modulesFromAllOutput))