CMS 3D CMS Logo

logErrorHarvester_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from FWCore.Modules.logErrorHarvester_cfi import logErrorHarvester
3 
5  logName = 'logErrorHarvester'
6  if not hasattr(process,logName):
7  return process
8 
9  modulesFromAllOutput = set()
10  onlyOneOutput = (len(process.outputModules_()) == 1)
11  for o in process.outputModules_().itervalues():
12  if not hasattr(o,"outputCommands"):
13  continue
14  modulesFromOutput = set()
15  storesLogs = False
16  if (not onlyOneOutput) and hasattr(o,"SelectEvents") and hasattr(o.SelectEvents,"SelectEvents") and o.SelectEvents.SelectEvents:
17  #if the output module is skimming events, we do not want to force running of
18  # unscheduled modules
19  continue
20  for ln in o.outputCommands.value():
21  if -1 != ln.find("keep"):
22  s = ln.split("_")
23  if len(s)>1:
24  if s[1].find("*")==-1:
25  if s[1] != logName:
26  modulesFromOutput.add(s[1])
27  else:
28  storesLogs = True
29  if storesLogs:
30  modulesFromAllOutput =modulesFromAllOutput.union(modulesFromOutput)
31  if hasattr(process.logErrorHarvester,"includeModules"):
32  #need to exclude items from includeModules which are not being stored
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(*toExclude)
38  else:
39  process.logErrorHarvester.includeModules = cms.untracked.vstring(*modulesFromAllOutput)
40  return process
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
def customiseLogErrorHarvesterUsingOutputCommands(process)