CMS 3D CMS Logo

earlyDeleteSettings_cff.py
Go to the documentation of this file.
1 # Abstract all early deletion settings here
2 
3 import collections
4 
5 import FWCore.ParameterSet.Config as cms
6 
7 from RecoTracker.Configuration.customiseEarlyDeleteForSeeding import customiseEarlyDeleteForSeeding
8 from RecoTracker.Configuration.customiseEarlyDeleteForMkFit import customiseEarlyDeleteForMkFit
9 from RecoTracker.Configuration.customiseEarlyDeleteForCKF import customiseEarlyDeleteForCKF
10 from CommonTools.ParticleFlow.Isolation.customiseEarlyDeleteForCandIsoDeposits import customiseEarlyDeleteForCandIsoDeposits
11 
12 def customiseEarlyDelete(process):
13  # Mapping label -> [branches]
14  # for the producers whose products are to be deleted early
15  products = collections.defaultdict(list)
16 
17  (products, references) = customiseEarlyDeleteForSeeding(process, products)
18  products = customiseEarlyDeleteForMkFit(process, products)
19  (products, newReferences) = customiseEarlyDeleteForCKF(process, products)
20  references.update(newReferences)
21 
22  products = customiseEarlyDeleteForCandIsoDeposits(process, products)
23 
24  branchSet = set()
25  for branches in products.values():
26  for branch in branches:
27  branchSet.add(branch)
28  branchList = sorted(branchSet)
29  process.options.canDeleteEarly.extend(branchList)
30 
31  for prod, refs in references.items():
32  process.options.holdsReferencesToDeleteEarly.append(cms.PSet(product=cms.string(prod), references=cms.vstring(refs)))
33 
34  # LogErrorHarvester should not wait for deleted items
35  for prod in process.producers_().values():
36  if prod.type_() == "LogErrorHarvester":
37  if not hasattr(prod,'excludeModules'):
38  prod.excludeModules = cms.untracked.vstring()
39  t = prod.excludeModules.value()
40  t.extend([b.split('_')[1] for b in branchList])
41  prod.excludeModules = t
42 
43  return process