1 import FWCore.ParameterSet.Config
as cms
7 depends = collections.defaultdict(list)
9 def _branchName(productType, moduleLabel, instanceLabel=""):
10 return "%s_%s_%s_%s" % (productType, moduleLabel, instanceLabel, process.name_())
12 for name, module
in process.producers_().
items():
13 cppType = module._TypedParameterizable__type
14 if cppType ==
"HitPairEDProducer":
15 if module.produceSeedingHitSets:
16 products[name].
append(_branchName(
"RegionsSeedingHitSets", name))
17 if module.produceIntermediateHitDoublets:
18 products[name].
append(_branchName(
"IntermediateHitDoublets", name))
19 elif cppType
in [
"PixelTripletHLTEDProducer",
"PixelTripletLargeTipEDProducer"]:
20 if module.produceSeedingHitSets:
21 products[name].
append(_branchName(
"RegionsSeedingHitSets", name))
22 if module.produceIntermediateHitTriplets:
23 products[name].
append(_branchName(
"IntermediateHitTriplets", name))
26 depends[name].
append(module.doublets.getModuleLabel())
27 elif cppType
in [
"MultiHitFromChi2EDProducer"]:
28 products[name].extend([
29 _branchName(
"RegionsSeedingHitSets", name),
30 _branchName(
"BaseTrackerRecHitsOwned", name)
32 elif cppType
in [
"CAHitQuadrupletEDProducer",
"CAHitTripletEDProducer"]:
33 products[name].
append(_branchName(
"RegionsSeedingHitSets", name))
35 if len(products) == 0:
42 def _resolve(keys, name):
43 for dependsOn
in depends[name]:
45 _resolve(keys, dependsOn)
46 keys.remove(dependsOn)
47 products[name].extend(products[dependsOn])
49 keys = set(depends.keys())