CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
customiseForTripletsByCellularAutomaton Namespace Reference

Functions

def customiseForTripletsByCellularAutomaton
 
def customiseLegacySeeding
 
def customiseNewSeeding
 

Variables

tuple _CAParameters
 

Function Documentation

def customiseForTripletsByCellularAutomaton.customiseForTripletsByCellularAutomaton (   process)

Definition at line 72 of file customiseForTripletsByCellularAutomaton.py.

References customiseLegacySeeding(), and customiseNewSeeding().

72 
74  for module in process._Process__producers.values():
75  if hasattr(module, "OrderedHitsFactoryPSet"):
77  elif module._TypedParameterizable__type in ["PixelTripletHLTEDProducer", "PixelTripletLargeTipEDProducer"]:
78  customiseNewSeeding(process, module)
79  return process
def customiseForTripletsByCellularAutomaton.customiseLegacySeeding (   module)

Definition at line 15 of file customiseForTripletsByCellularAutomaton.py.

Referenced by customiseForTripletsByCellularAutomaton().

15 
16 def customiseLegacySeeding(module):
17  pset = getattr(module, "OrderedHitsFactoryPSet")
18  if not hasattr(pset, "ComponentName"):
19  return
20  if pset.ComponentName != "StandardHitTripletGenerator":
21  return
22  # Adjust seeding layers
23  seedingLayersName = module.OrderedHitsFactoryPSet.SeedingLayers.getModuleLabel()
24 
25 
26  # Configure seed generator / pixel track producer
27  Triplets = module.OrderedHitsFactoryPSet.clone()
28  from RecoPixelVertexing.PixelTriplets.CAHitTripletGenerator_cfi import CAHitTripletGenerator as _CAHitTripletGenerator
29 
30  module.OrderedHitsFactoryPSet = _CAHitTripletGenerator.clone(
31  ComponentName = "CAHitTripletGenerator",
32  extraHitRPhitolerance = Triplets.GeneratorPSet.extraHitRPhitolerance,
33  SeedingLayers = seedingLayersName,
34  **_CAParameters
35  )
36 
37  if hasattr(Triplets.GeneratorPSet, "SeedComparitorPSet"):
38  module.OrderedHitsFactoryPSet.SeedComparitorPSet = Triplets.GeneratorPSet.SeedComparitorPSet
def customiseForTripletsByCellularAutomaton.customiseNewSeeding (   process,
  module 
)

Definition at line 39 of file customiseForTripletsByCellularAutomaton.py.

Referenced by customiseForTripletsByCellularAutomaton().

39 
40 def customiseNewSeeding(process, module):
41  doubletModuleName = module.doublets.getModuleLabel()
42  doubletModule = getattr(process, doubletModuleName)
43 
44  # Generate doublets for all adjacent layer pairs
45  doubletModule.layerPairs = [
46  0, # layer pair (0,1)
47  1, # layer pair (1,2)
48  ]
49 
50  # Bit of a hack to replace a module with another, but works
51  #
52  # In principle setattr(process) could work too, but it expands the
53  # sequences and I don't want that
54  modifier = cms.Modifier()
55  modifier._setChosen()
56 
57  comparitor = None
58  if hasattr(module, "SeedComparitorPSet"):
59  comparitor = module.SeedComparitorPSet.clone()
60 
61  # Replace triplet generator with the CA version
62  from RecoPixelVertexing.PixelTriplets.caHitTripletEDProducer_cfi import caHitTripletEDProducer as _caHitTripletEDProducer
63  modifier.toReplaceWith(module, _caHitTripletEDProducer.clone(
64  doublets = doubletModuleName,
65  extraHitRPhitolerance = module.extraHitRPhitolerance,
66  **_CAParameters
67  ))
68 
69  if comparitor:
70  module.SeedComparitorPSet = comparitor
71 

Variable Documentation

tuple customiseForTripletsByCellularAutomaton._CAParameters
Initial value:
1 = dict(
2  maxChi2 = dict(
3  pt1 = 0.8, pt2 = 2,
4  value1 = 20, value2 = 10,
5  enabled = True,
6  ),
7  useBendingCorrection = True,
8  CAThetaCut = 0.0015,
9  CAPhiCut = 0.01,
10  CAHardPtCut = 0,
11 )

Definition at line 3 of file customiseForTripletsByCellularAutomaton.py.