Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-28 02:15:11

0001 # Abstract all early deletion settings here
0002 
0003 import collections
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 
0007 from RecoTracker.Configuration.customiseEarlyDeleteForSeeding import customiseEarlyDeleteForSeeding
0008 from RecoTracker.Configuration.customiseEarlyDeleteForMkFit import customiseEarlyDeleteForMkFit
0009 from RecoTracker.Configuration.customiseEarlyDeleteForCKF import customiseEarlyDeleteForCKF
0010 from CommonTools.ParticleFlow.Isolation.customiseEarlyDeleteForCandIsoDeposits import customiseEarlyDeleteForCandIsoDeposits
0011 
0012 def customiseEarlyDelete(process):
0013     # Mapping label -> [branches]
0014     # for the producers whose products are to be deleted early
0015     products = collections.defaultdict(list)
0016 
0017     (products, references) = customiseEarlyDeleteForSeeding(process, products)
0018     products = customiseEarlyDeleteForMkFit(process, products)
0019     (products, newReferences) = customiseEarlyDeleteForCKF(process, products)
0020     references.update(newReferences)
0021 
0022     products = customiseEarlyDeleteForCandIsoDeposits(process, products)
0023 
0024     branchSet = set()
0025     for branches in products.values():
0026         for branch in branches:
0027             branchSet.add(branch)
0028     branchList = sorted(branchSet)
0029     process.options.canDeleteEarly.extend(branchList)
0030 
0031     for prod, refs in references.items():
0032         process.options.holdsReferencesToDeleteEarly.append(cms.PSet(product=cms.string(prod), references=cms.vstring(refs)))
0033 
0034     # LogErrorHarvester should not wait for deleted items
0035     for prod in process.producers_().values():
0036         if prod.type_() == "LogErrorHarvester":
0037             if not hasattr(prod,'excludeModules'):
0038                 prod.excludeModules = cms.untracked.vstring()
0039             t = prod.excludeModules.value()
0040             t.extend([b.split('_')[1] for b in branchList])
0041             prod.excludeModules = t
0042 
0043     return process