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 
15  # if any of the following objects does not exist, do not apply any customisation
16  for objLabel in [
17  'hltSiStripRawToClustersFacility',
18  'HLTDoLocalStripSequence',
19  'HLTIterativeTrackingIteration0',
20  'hltIter0PFlowCkfTrackCandidates',
21  ]:
22  if not hasattr(process, objLabel):
23  print(f'# WARNING: customizeHLTIter0ToMkFit failed (object with label "{objLabel}" not found) - no customisation applied !')
24  return process
25 
26  # mkFit needs all clusters, so switch off the on-demand mode
27  process.hltSiStripRawToClustersFacility.onDemand = False
28 
29  process.hltSiStripRecHits = SiStripRecHitConverter_cfi.siStripMatchedRecHits.clone(
30  ClusterProducer = "hltSiStripRawToClustersFacility",
31  StripCPE = "hltESPStripCPEfromTrackAngle:hltESPStripCPEfromTrackAngle",
32  doMatching = False,
33  )
34 
35  # Use fourth hit if one is available
36  process.hltIter0PFLowPixelSeedsFromPixelTracks.includeFourthHit = cms.bool(True)
37 
38  process.hltMkFitGeometryESProducer = mkFitGeometryESProducer_cfi.mkFitGeometryESProducer.clone()
39 
40  process.hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits = mkFitSiPixelHitConverter_cfi.mkFitSiPixelHitConverter.clone(
41  hits = "hltSiPixelRecHits",
42  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
43  )
44  process.hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits = mkFitSiStripHitConverter_cfi.mkFitSiStripHitConverter.clone(
45  rphiHits = "hltSiStripRecHits:rphiRecHit",
46  stereoHits = "hltSiStripRecHits:stereoRecHit",
47  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
48  minGoodStripCharge = dict(refToPSet_ = 'HLTSiStripClusterChargeCutLoose'),
49  )
50  process.hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits = mkFitEventOfHitsProducer_cfi.mkFitEventOfHitsProducer.clone(
51  beamSpot = "hltOnlineBeamSpot",
52  pixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
53  stripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
54  )
55  process.hltIter0PFlowCkfTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
56  seeds = "hltIter0PFLowPixelSeedsFromPixelTracks",
57  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
58  )
59  process.hltIter0PFlowTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
60  ComponentName = 'hltIter0PFlowTrackCandidatesMkFitConfig',
61  config = 'RecoTracker/MkFit/data/mkfit-phase1-initialStep.json',
62  )
63  process.hltIter0PFlowCkfTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
64  pixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
65  stripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
66  eventOfHits = "hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits",
67  seeds = "hltIter0PFlowCkfTrackCandidatesMkFitSeeds",
68  config = ('', 'hltIter0PFlowTrackCandidatesMkFitConfig'),
69  minGoodStripCharge = dict(refToPSet_ = 'HLTSiStripClusterChargeCutLoose'),
70  )
71  process.hltIter0PFlowCkfTrackCandidates = mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
72  seeds = "hltIter0PFLowPixelSeedsFromPixelTracks",
73  mkFitEventOfHits = "hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits",
74  mkFitPixelHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits",
75  mkFitStripHits = "hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits",
76  mkFitSeeds = "hltIter0PFlowCkfTrackCandidatesMkFitSeeds",
77  tracks = "hltIter0PFlowCkfTrackCandidatesMkFit",
78  ttrhBuilder = ":hltESPTTRHBWithTrackAngle",
79  propagatorAlong = ":PropagatorWithMaterialParabolicMf",
80  propagatorOpposite = ":PropagatorWithMaterialParabolicMfOpposite",
81  )
82 
83  process.HLTDoLocalStripSequence += process.hltSiStripRecHits
84 
85  replaceWith = (process.hltIter0PFlowCkfTrackCandidatesMkFitSiPixelHits +
86  process.hltIter0PFlowCkfTrackCandidatesMkFitSiStripHits +
87  process.hltIter0PFlowCkfTrackCandidatesMkFitEventOfHits +
88  process.hltIter0PFlowCkfTrackCandidatesMkFitSeeds +
89  process.hltIter0PFlowCkfTrackCandidatesMkFit +
90  process.hltIter0PFlowCkfTrackCandidates)
91 
92  process.HLTIterativeTrackingIteration0.replace(process.hltIter0PFlowCkfTrackCandidates, replaceWith)
93 
94  for path in process.paths_().values():
95  if not path.contains(process.HLTIterativeTrackingIteration0) and path.contains(process.hltIter0PFlowCkfTrackCandidates):
96  path.replace(process.hltIter0PFlowCkfTrackCandidates, replaceWith)
97 
98  return process
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47