File indexing completed on 2024-04-06 12:28:00
0001 import FWCore.ParameterSet.Config as cms
0002
0003 import collections
0004
0005 def customiseEarlyDeleteForSeeding(process, products):
0006
0007 references = collections.defaultdict(list)
0008
0009 def _branchName(productType, moduleLabel, instanceLabel=""):
0010 return "%s_%s_%s_%s" % (productType, moduleLabel, instanceLabel, process.name_())
0011
0012 for name, module in process.producers_().items():
0013 cppType = module._TypedParameterizable__type
0014 if cppType == "HitPairEDProducer":
0015 if module.produceSeedingHitSets:
0016 products[name].append(_branchName("RegionsSeedingHitSets", name))
0017 if module.produceIntermediateHitDoublets:
0018 products[name].append(_branchName("IntermediateHitDoublets", name))
0019 elif cppType in ["PixelTripletHLTEDProducer", "PixelTripletLargeTipEDProducer"]:
0020
0021
0022 b = _branchName('IntermediateHitDoublets', module.doublets.getModuleLabel())
0023 if module.produceSeedingHitSets:
0024 pBranch = _branchName("RegionsSeedingHitSets", name)
0025 products[name].append(pBranch)
0026 references[pBranch]=[b]
0027 if module.produceIntermediateHitTriplets:
0028 pBranch = _branchName("IntermediateHitTriplets", name)
0029 products[name].append(pBranch)
0030 references[pBranch]=[b]
0031 elif cppType in ["MultiHitFromChi2EDProducer"]:
0032 products[name].extend([
0033 _branchName("RegionsSeedingHitSets", name),
0034 _branchName("BaseTrackerRecHitsOwned", name)
0035 ])
0036 references[_branchName("RegionsSeedingHitSets", name)]=[_branchName("BaseTrackerRecHitsOwned", name)]
0037 elif cppType in ["CAHitQuadrupletEDProducer", "CAHitTripletEDProducer"]:
0038 products[name].append(_branchName("RegionsSeedingHitSets", name))
0039
0040 return (products, references)