CMS 3D CMS Logo

Functions
customiseEarlyDeleteForSeeding Namespace Reference

Functions

def customiseEarlyDeleteForSeeding (process, products)
 

Function Documentation

def customiseEarlyDeleteForSeeding.customiseEarlyDeleteForSeeding (   process,
  products 
)

Definition at line 5 of file customiseEarlyDeleteForSeeding.py.

References mps_alisetup.append.

5 def customiseEarlyDeleteForSeeding(process, products):
6  # Find the producers
7  depends = collections.defaultdict(list)
8 
9  def _branchName(productType, moduleLabel, instanceLabel=""):
10  return "%s_%s_%s_%s" % (productType, moduleLabel, instanceLabel, process.name_())
11 
12  for name, module in process.producers_().iteritems():
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))
24  # LayerHitMapCache of the doublets is forwarded to both
25  # products, hence the dependency
26  depends[name].append(module.doublets.getModuleLabel())
27  elif cppType in ["MultiHitFromChi2EDProducer"]:
28  products[name].extend([
29  _branchName("RegionsSeedingHitSets", name),
30  _branchName("BaseTrackerRecHitsOwned", name)
31  ])
32  elif cppType in ["PixelQuadrupletEDProducer", "CAHitQuadrupletEDProducer", "CAHitTripletEDProducer"]:
33  products[name].append(_branchName("RegionsSeedingHitSets", name))
34  elif cppType == "PixelQuadrupletMergerEDProducer":
35  products[name].extend([
36  _branchName("RegionsSeedingHitSets", name),
37  _branchName("TrajectorySeeds", name)
38  ])
39 
40  if len(products) == 0:
41  return products
42 
43  # Resolve data dependencies
44  #
45  # If a productB depends on productA (e.g. by ref or pointer), then
46  # everybody that mightGet's producB, must also mightGet productA
47  def _resolve(keys, name):
48  for dependsOn in depends[name]:
49  if dependsOn in keys:
50  _resolve(keys, dependsOn)
51  keys.remove(dependsOn)
52  products[name].extend(products[dependsOn])
53 
54  keys = set(depends.keys())
55  while len(keys) > 0:
56  name = keys.pop()
57  _resolve(keys, name)
58 
59  return products
60 
def customiseEarlyDeleteForSeeding(process, products)