CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
logErrorHarvester_cff Namespace Reference

Functions

def customiseLogErrorHarvesterUsingOutputCommands
 

Function Documentation

def logErrorHarvester_cff.customiseLogErrorHarvesterUsingOutputCommands (   process)

Definition at line 4 of file logErrorHarvester_cff.py.

References spr.find(), and makeHLTPrescaleTable.values.

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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 process.outputModules_().values():
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(sorted(toExclude))
39  else:
40  process.logErrorHarvester.includeModules = cms.untracked.vstring(sorted(modulesFromAllOutput))
41  return process
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19