CMS 3D CMS Logo

Functions
logErrorHarvester_cff Namespace Reference

Functions

def customiseLogErrorHarvesterUsingOutputCommands (process)
 

Function Documentation

◆ customiseLogErrorHarvesterUsingOutputCommands()

def logErrorHarvester_cff.customiseLogErrorHarvesterUsingOutputCommands (   process)

Definition at line 4 of file logErrorHarvester_cff.py.

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

Referenced by ConfigBuilder.ConfigBuilder.prepare().

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