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