CMS 3D CMS Logo

customizeHLTIter0ToMkFit.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 import RecoTracker.MkFit.mkFitGeometryESProducer_cfi as mkFitGeometryESProducer_cfi
4 import RecoTracker.MkFit.mkFitSiPixelHitConverter_cfi as mkFitSiPixelHitConverter_cfi
5 import RecoTracker.MkFit.mkFitSiStripHitConverter_cfi as mkFitSiStripHitConverter_cfi
6 import RecoTracker.MkFit.mkFitEventOfHitsProducer_cfi as mkFitEventOfHitsProducer_cfi
7 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
8 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
9 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
10 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
12 
14  # mkFit needs all clusters, so switch off the on-demand mode
15  process.hltSiStripRawToClustersFacility.onDemand = False
16 
17  process.hltSiStripRecHits = SiStripRecHitConverter_cfi.siStripMatchedRecHits.clone(
18  ClusterProducer = "hltSiStripRawToClustersFacility",
19  StripCPE = "hltESPStripCPEfromTrackAngle:hltESPStripCPEfromTrackAngle",
20  doMatching = False,
21  )
22 
23  # Use fourth hit if one is available
24  process.hltIter0PFLowPixelSeedsFromPixelTracks.includeFourthHit = cms.bool(True)
25 
26  process.hltMkFitGeometryESProducer = mkFitGeometryESProducer_cfi.mkFitGeometryESProducer.clone()
27 
28  process.hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits = mkFitSiPixelHitConverter_cfi.mkFitSiPixelHitConverter.clone(
29  hits = "hltSiPixelRecHits",
30  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
31  )
32  process.hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits = mkFitSiStripHitConverter_cfi.mkFitSiStripHitConverter.clone(
33  rphiHits = "hltSiStripRecHits:rphiRecHit",
34  stereoHits = "hltSiStripRecHits:stereoRecHit",
35  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
36  minGoodStripCharge = dict(refToPSet_ = 'HLTSiStripClusterChargeCutLoose'),
37  )
38  process.hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits = mkFitEventOfHitsProducer_cfi.mkFitEventOfHitsProducer.clone(
39  beamSpot = "hltOnlineBeamSpot",
40  pixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
41  stripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
42  )
43  process.hltIter0PFlowCkfTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
44  seeds = "hltIter0PFLowPixelSeedsFromPixelTracks",
45  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
46  )
47  process.hltIter0PFlowTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
48  ComponentName = 'hltIter0PFlowTrackCandidatesMkFitConfig',
49  config = 'RecoTracker/MkFit/data/mkfit-phase1-initialStep.json',
50  )
51  process.hltIter0PFlowCkfTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
52  pixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
53  stripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
54  eventOfHits = "hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits",
55  seeds = "hltIter0PFlowCkfTrackCandidatesMkFitSeeds",
56  config = ('', 'hltIter0PFlowTrackCandidatesMkFitConfig'),
57  minGoodStripCharge = dict(refToPSet_ = 'HLTSiStripClusterChargeCutLoose'),
58  )
59  process.hltIter0PFlowCkfTrackCandidates = mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
60  seeds = "hltIter0PFLowPixelSeedsFromPixelTracks",
61  mkFitEventOfHits = "hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits",
62  mkFitPixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
63  mkFitStripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
64  mkFitSeeds = "hltIter0PFlowCkfTrackCandidatesMkFitSeeds",
65  tracks = "hltIter0PFlowCkfTrackCandidatesMkFit",
66  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
67  propagatorAlong = ":PropagatorWithMaterialParabolicMf",
68  propagatorOpposite = ":PropagatorWithMaterialParabolicMfOpposite",
69  )
70 
71  process.HLTDoLocalStripSequence += process.hltSiStripRecHits
72 
73  replaceWith = (process.hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits +
74  process.hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits +
75  process.hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits +
76  process.hltIter0PFlowCkfTrackCandidatesMkFitSeeds +
77  process.hltIter0PFlowCkfTrackCandidatesMkFit +
78  process.hltIter0PFlowCkfTrackCandidates)
79 
80  process.HLTIterativeTrackingIteration0.replace(process.hltIter0PFlowCkfTrackCandidates, replaceWith)
81 
82  for path in process.paths_().values():
83  if not path.contains(process.HLTIterativeTrackingIteration0) and path.contains(process.hltIter0PFlowCkfTrackCandidates):
84  path.replace(process.hltIter0PFlowCkfTrackCandidates, replaceWith)
85 
86  return process