CMS 3D CMS Logo

Functions
logErrorHarvester_cff Namespace Reference

Functions

def customiseLogErrorHarvesterUsingOutputCommands (process)
 

Function Documentation

def logErrorHarvester_cff.customiseLogErrorHarvesterUsingOutputCommands (   process)

Definition at line 5 of file logErrorHarvester_cff.py.

References spr.find().

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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
42 
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
def customiseLogErrorHarvesterUsingOutputCommands(process)