CMS 3D CMS Logo

DisplacedGeneralStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
3 
4 #----------------------------------------- NEW CLUSTERS (remove previously used clusters)
5 displacedGeneralStepClusters = _cfg.clusterRemoverForIter("DisplacedGeneralStep")
6 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
7  _era.toReplaceWith(displacedGeneralStepClusters, _cfg.clusterRemoverForIter("DisplacedGeneralStep", _eraName, _postfix))
8 
9 #----------------------------------------- SEEDING LAYERS
10 import RecoTracker.TkSeedingLayers.DisplacedGeneralLayerTriplet_cfi
11 displacedGeneralStepSeedLayers = RecoTracker.TkSeedingLayers.DisplacedGeneralLayerTriplet_cfi.DisplacedGeneralLayerTriplet.clone()
12 
13 
14 #----------------------------------------- TrackingRegion
15 from RecoTracker.TkTrackingRegions.globalTrackingRegion_cfi import globalTrackingRegion as _globalTrackingRegion
16 displacedGeneralStepTrackingRegions = _globalTrackingRegion.clone(
17  RegionPSet = dict(
18  precise = True,
19  useMultipleScattering = True,
20  originHalfLength = 55,
21  originRadius = 10,
22  ptMin = 1
23  )
24 )
25 
26 
27 
28 
29 #----------------------------------------- Triplet seeding
30 
31 from RecoTracker.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import ClusterShapeHitFilterESProducer as _ClusterShapeHitFilterESProducer
32 displacedGeneralStepClusterShapeHitFilter = _ClusterShapeHitFilterESProducer.clone(
33  ComponentName = 'displacedGeneralStepClusterShapeHitFilter',
34  doStripShapeCut = cms.bool(False),
35  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
36 )
37 
38 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
39 displacedGeneralStepHitDoublets = _hitPairEDProducer.clone(
40  seedingLayers = "displacedGeneralStepSeedLayers",
41  trackingRegions = "displacedGeneralStepTrackingRegions",
42  maxElement = 50000000,
43  produceIntermediateHitDoublets = True,
44 )
45 
46 from RecoTracker.TkSeedGenerator.multiHitFromChi2EDProducer_cfi import multiHitFromChi2EDProducer as _multiHitFromChi2EDProducer
47 displacedGeneralStepHitTriplets = _multiHitFromChi2EDProducer.clone(
48  doublets = "displacedGeneralStepHitDoublets",
49  extraPhiKDBox = 0.01,
50 )
51 
52 
53 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
54 from RecoTracker.PixelLowPtUtilities.StripSubClusterShapeSeedFilter_cfi import StripSubClusterShapeSeedFilter as _StripSubClusterShapeSeedFilter
55 displacedGeneralStepSeeds = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
56  seedingHitSets = "displacedGeneralStepHitTriplets",
57  SeedComparitorPSet = dict(
58  ComponentName = 'CombinedSeedComparitor',
59  mode = cms.string("and"),
60  comparitors = cms.VPSet(
61  cms.PSet(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
62  ComponentName = cms.string('PixelClusterShapeSeedComparitor'),
63  FilterAtHelixStage = cms.bool(True),
64  FilterPixelHits = cms.bool(False),
65  FilterStripHits = cms.bool(True),
66  ClusterShapeHitFilterName = cms.string('displacedGeneralStepClusterShapeHitFilter'),
67  ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache") # not really needed here since FilterPixelHits=False
68  ),
69  _StripSubClusterShapeSeedFilter.clone()
70  )
71  )
72 )
73 
74 
75 
76 #----------------------------------------- QUALITY CUTS DURING TRACK BUILDING
77 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
78 _displacedGeneralStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
79  maxLostHits = 1,
80  minimumNumberOfHits = 4,
81  minPt = 1,
82 )
83 
84 displacedGeneralStepTrajectoryFilter = _displacedGeneralStepTrajectoryFilterBase.clone(
85  seedPairPenalty = 1,
86 )
87 
88 
89 displacedGeneralStepTrajectoryFilterInOut = displacedGeneralStepTrajectoryFilter.clone()
90 
91 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
92 displacedGeneralStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
93  ComponentName = 'displacedGeneralStepChi2Est',
94  nSigma = 3.0,
95  MaxChi2 = 10.0,
96  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
97 )
98 
99 
100 
101 #----------------------------------------- TRACK BUILDING
103 displacedGeneralStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilderIterativeDefault.clone(
104  trajectoryFilter = dict(refToPSet_ = 'displacedGeneralStepTrajectoryFilter'),
105  inOutTrajectoryFilter = dict(refToPSet_ = 'displacedGeneralStepTrajectoryFilterInOut'),
106  useSameTrajFilter = False,
107  minNrOfHitsForRebuild = 4,
108  maxCand = 2,
109  estimator = 'displacedGeneralStepChi2Est'
110 )
111 
112 
113 
114 #----------------------------------------- MAKING OF TRACK CANDIDATES
116 displacedGeneralStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidatesIterativeDefault.clone(
117  src = 'displacedGeneralStepSeeds',
118  TrajectoryCleaner = 'displacedGeneralStepTrajectoryCleanerBySharedHits',
119 
120  numHitsForSeedCleaner = 50,
121  onlyPixelHitsForSeedCleaner = False,
122  TrajectoryBuilderPSet = dict(refToPSet_ = 'displacedGeneralStepTrajectoryBuilder'),
123  clustersToSkip = 'displacedGeneralStepClusters',
124  doSeedingRegionRebuilding = True,
125  useHitsSplitting = True,
126  cleanTrajectoryAfterInOut = True
127 )
128 
129 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
130 displacedGeneralStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
131  ComponentName = 'displacedGeneralStepTrajectoryCleanerBySharedHits',
132  fractionShared = 0.25,
133  allowSharedFirstHit = True
134 )
135 
136 
137 
138 
139 
140 # ----------------------------------------- TRACK FITTING AND SMOOTHING OPTIONS
142 displacedGeneralStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
143  ComponentName = 'displacedGeneralStepFitterSmoother',
144  EstimateCut = 30,
145  MinNumberOfHits = 8,
146  Fitter = 'displacedGeneralStepRKFitter',
147  Smoother = 'displacedGeneralStepRKSmoother'
148 )
149 
150 
151 
152 # Also necessary to specify minimum number of hits after final track fit
153 displacedGeneralStepRKTrajectoryFitter = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectoryFitter.clone(
154  ComponentName = 'displacedGeneralStepRKFitter',
155  minHits = 8
156 )
157 
158 
159 
160 displacedGeneralStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
161  ComponentName = 'displacedGeneralStepRKSmoother',
162  errorRescaling = 10.0,
163  minHits = 8
164 )
165 
166 
167 
169 generalDisplacedFlexibleKFFittingSmoother = TrackingTools.TrackFitters.FlexibleKFFittingSmoother_cfi.FlexibleKFFittingSmoother.clone(
170  ComponentName = 'generalDisplacedFlexibleKFFittingSmoother',
171  standardFitter = 'displacedGeneralStepFitterSmoother',
172 )
173 
174 
175 
176 
177 import RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi
178 displacedGeneralStepTracks = RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi.TrackProducerIterativeDefault.clone(
179  src = 'displacedGeneralStepTrackCandidates',
180  AlgorithmName = 'displacedGeneralStep',
181  Fitter = 'generalDisplacedFlexibleKFFittingSmoother',
182 )
183 
184 
185 #---------------------------------------- TRACK SELECTION AND QUALITY FLAG SETTING.
186 
189 displacedGeneralStepClassifier1 = TrackMVAClassifierDetached.clone(
190  src = 'displacedGeneralStepTracks',
191  mva = dict(GBRForestLabel = 'MVASelectorIter6_13TeV'),
192  qualityCuts = [-0.6,-0.45,-0.3]
193 )
194 displacedGeneralStepClassifier2 = TrackMVAClassifierPrompt.clone(
195 src = 'displacedGeneralStepTracks',
196  mva = dict(GBRForestLabel = 'MVASelectorIter0_13TeV'),
197  qualityCuts = [0.0,0.0,0.0]
198 )
199 
201 displacedGeneralStep = ClassifierMerger.clone(
202  inputClassifiers=['displacedGeneralStepClassifier1','displacedGeneralStepClassifier2']
203 )
204 
205 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
206 trackingPhase1.toReplaceWith(displacedGeneralStep, displacedGeneralStepClassifier1.clone(
207  mva = dict(GBRForestLabel = 'MVASelectorTobTecStep_Phase1'),
208  qualityCuts = [-0.6,-0.45,-0.3],
209 ))
210 
211 
212 
213 DisplacedGeneralStepTask = cms.Task(displacedGeneralStepClusters,
214  displacedGeneralStepSeedLayers,
215  displacedGeneralStepTrackingRegions,
216  displacedGeneralStepHitDoublets,
217  displacedGeneralStepHitTriplets,
218  displacedGeneralStepSeeds,
219  displacedGeneralStepTrackCandidates,
220  displacedGeneralStepTracks,
221  displacedGeneralStepClassifier1,displacedGeneralStepClassifier2,
222  displacedGeneralStep)
223 
224 DisplacedGeneralStep = cms.Sequence(DisplacedGeneralStepTask)