CMS 3D CMS Logo

MuonSeededStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 
4 from RecoMuon.MuonIdentification.earlyMuons_cfi import earlyMuons
5 
6 
7 import RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi
8 import RecoTracker.SpecialSeedGenerators.inOutSeedsFromTrackerMuons_cfi
9 muonSeededSeedsOutIn = RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi.outInSeedsFromStandaloneMuons.clone(
10  src = 'earlyMuons',
11 )
12 muonSeededSeedsInOut = RecoTracker.SpecialSeedGenerators.inOutSeedsFromTrackerMuons_cfi.inOutSeedsFromTrackerMuons.clone(
13  src = 'earlyMuons',
14 )
15 
16 from RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi import hitCollectorForOutInMuonSeeds
17 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
18 _tracker_apv_vfp30_2016.toModify(hitCollectorForOutInMuonSeeds, MinPtForHitRecoveryInGluedDet=1e9)
19 
20 
23 muonSeededTrajectoryCleanerBySharedHits = TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi.trajectoryCleanerBySharedHits.clone(
24  ComponentName = 'muonSeededTrajectoryCleanerBySharedHits',
25  fractionShared = 0.1,
26  ValidHitBonus = 1000.0,
27  MissingHitPenalty = 1.0,
28  ComponentType = 'TrajectoryCleanerBySharedHits',
29  allowSharedFirstHit = True
30 )
31 
32 
33 
34 from TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi import Chi2MeasurementEstimator as _Chi2MeasurementEstimator
35 _muonSeededMeasurementEstimatorForInOutBase = _Chi2MeasurementEstimator.clone(
36  ComponentName = 'muonSeededMeasurementEstimatorForInOut',
37  MaxChi2 = 80.0,
38  nSigma = 4.,
39 )
40 muonSeededMeasurementEstimatorForInOut = _muonSeededMeasurementEstimatorForInOutBase.clone(
41  MaxSagitta = -1.
42 )
43 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
44 trackingPhase2PU140.toModify(muonSeededMeasurementEstimatorForInOut, MaxChi2 = 400.0, MaxSagitta = 2)
45 
46 _muonSeededMeasurementEstimatorForOutInBase = _Chi2MeasurementEstimator.clone(
47  ComponentName = 'muonSeededMeasurementEstimatorForOutIn',
48  MaxChi2 = 30.0,
49  nSigma = 3.,
50 )
51 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
52 _tracker_apv_vfp30_2016.toModify(_muonSeededMeasurementEstimatorForOutInBase, MinPtForHitRecoveryInGluedDet=1e9)
53 muonSeededMeasurementEstimatorForOutIn = _muonSeededMeasurementEstimatorForOutInBase.clone(
54  MaxSagitta = -1.
55 )
56 
57 
59 muonSeededTrajectoryFilterForInOut = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
60  constantValueForLostHitsFractionFilter = 10,
61  minimumNumberOfHits = 3
62 )
63 muonSeededTrajectoryFilterForOutIn = muonSeededTrajectoryFilterForInOut.clone(
64  constantValueForLostHitsFractionFilter = 10,
65  minimumNumberOfHits = 5
66 )
67 
69 muonSeededTrajectoryBuilderForInOut = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
70  foundHitBonus = 1000.0,
71  lostHitPenalty = 1.0,
72  maxCand = 5,
73  estimator = 'muonSeededMeasurementEstimatorForInOut',
74  trajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForInOut'),
75  inOutTrajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForInOut'), # not sure if it is used
76  minNrOfHitsForRebuild = 2,
77  requireSeedHitsInRebuild = True,
78  keepOriginalIfRebuildFails = True,
79 )
80 muonSeededTrajectoryBuilderForOutIn = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
81  foundHitBonus = 1000.0,
82  lostHitPenalty = 1.0,
83  maxCand = 3,
84  estimator = 'muonSeededMeasurementEstimatorForOutIn',
85  trajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForOutIn'),
86  inOutTrajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForOutIn'), # not sure if it is used
87  minNrOfHitsForRebuild = 5,
88  requireSeedHitsInRebuild = True,
89  keepOriginalIfRebuildFails = False,
90 )
91 
92 
94 muonSeededFittingSmootherWithOutliersRejectionAndRK = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
95  ComponentName = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
96  BreakTrajWith2ConsecutiveMissing = False,
97  EstimateCut = 50.,
98 )
99 
100 
102 muonSeededTrackCandidatesInOut = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
103  src = 'muonSeededSeedsInOut',
104  TrajectoryBuilderPSet = dict(refToPSet_ = 'muonSeededTrajectoryBuilderForInOut'),
105  TrajectoryCleaner = 'muonSeededTrajectoryCleanerBySharedHits',
106  RedundantSeedCleaner = 'none',
107 )
108 muonSeededTrackCandidatesOutIn = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
109  src = 'muonSeededSeedsOutIn',
110  TrajectoryBuilderPSet = dict(refToPSet_ = 'muonSeededTrajectoryBuilderForOutIn'),
111  TrajectoryCleaner = 'muonSeededTrajectoryCleanerBySharedHits',
112  numHitsForSeedCleaner = 50,
113  onlyPixelHitsForSeedCleaner = False,
114 )
115 
116 
118 muonSeededTracksOutIn = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
119  src = 'muonSeededTrackCandidatesOutIn',
120  AlgorithmName = 'muonSeededStepOutIn',
121  Fitter = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
122 )
123 muonSeededTracksInOut = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
124  src = 'muonSeededTrackCandidatesInOut',
125  AlgorithmName = 'muonSeededStepInOut',
126  Fitter = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
127 )
128 
129 # Final Classifier
131 muonSeededTracksInOutClassifier = TrackCutClassifier.clone(
132  src = 'muonSeededTracksInOut',
133  mva = dict(
134  minPixelHits = [0,0,0],
135  maxChi2 = [9999.,9999.,9999.],
136  maxChi2n = [10.0,1.0,0.4],
137  minLayers = [3,5,5],
138  min3DLayers = [1,2,2],
139  maxLostLayers = [4,3,2]
140  )
141 )
142 
143 muonSeededTracksOutInClassifier = TrackCutClassifier.clone(
144  src = 'muonSeededTracksOutIn',
145  mva = dict(
146  minPixelHits = [0,0,0],
147  maxChi2 = [9999.,9999.,9999.],
148  maxChi2n = [10.0,1.0,0.4],
149  minLayers = [3,5,5],
150  min3DLayers = [1,2,2],
151  maxLostLayers = [4,3,2]
152  )
153 )
154 
155 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
156 pp_on_AA.toModify(muonSeededTracksOutInClassifier.mva,
157  dr_par = cms.PSet(
158  d0err = cms.vdouble(0.003, 0.003, 0.003),
159  d0err_par = cms.vdouble(0.001, 0.001, 0.001),
160  dr_exp = cms.vint32(4, 4, 4),
161  dr_par1 = cms.vdouble(0.4, 0.4, 0.4),
162  dr_par2 = cms.vdouble(0.3, 0.3, 0.3)
163  ),
164  dz_par = cms.PSet(
165  dz_exp = cms.vint32(4, 4, 4),
166  dz_par1 = cms.vdouble(0.4, 0.4, 0.4),
167  dz_par2 = cms.vdouble(0.35, 0.35, 0.35)
168  ),
169  maxDr = [9999.,9999.,0.5],
170  maxDz = [9999.,9999.,0.5],
171  minHits = [0,0,10],
172  minPixelHits = [0,0,1],
173 )
174 pp_on_AA.toModify(muonSeededTracksInOutClassifier.mva,
175  dr_par = cms.PSet(
176  d0err = cms.vdouble(0.003, 0.003, 0.003),
177  d0err_par = cms.vdouble(0.001, 0.001, 0.001),
178  dr_exp = cms.vint32(4, 4, 4),
179  dr_par1 = cms.vdouble(0.4, 0.4, 0.4),
180  dr_par2 = cms.vdouble(0.3, 0.3, 0.3)
181  ),
182  dz_par = cms.PSet(
183  dz_exp = cms.vint32(4, 4, 4),
184  dz_par1 = cms.vdouble(0.4, 0.4, 0.4),
185  dz_par2 = cms.vdouble(0.35, 0.35, 0.35)
186  ),
187  maxDr = [9999.,9999.,0.5],
188  maxDz = [9999.,9999.,0.5],
189  minHits = [0,0,10],
190  minPixelHits = [0,0,1],
191 )
192 
193 # For Phase2PU140
194 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
195 muonSeededTracksInOutSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
196  src='muonSeededTracksInOut',
197  trackSelectors= cms.VPSet(
198  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
199  name = 'muonSeededTracksInOutLoose',
200  applyAdaptedPVCuts = False,
201  chi2n_par = 10.0,
202  minNumberLayers = 3,
203  min_nhits = 5,
204  maxNumberLostLayers = 4,
205  minNumber3DLayers = 0,
206  minHitsToBypassChecks = 7
207  ),
208  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
209  name = 'muonSeededTracksInOutTight',
210  preFilterName = 'muonSeededTracksInOutLoose',
211  applyAdaptedPVCuts = False,
212  chi2n_par = 1.0,
213  minNumberLayers = 5,
214  min_nhits = 6,
215  maxNumberLostLayers = 3,
216  minNumber3DLayers = 2,
217  minHitsToBypassChecks = 10
218  ),
219  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
220  name = 'muonSeededTracksInOutHighPurity',
221  preFilterName = 'muonSeededTracksInOutTight',
222  applyAdaptedPVCuts = False,
223  chi2n_par = 0.4,
224  minNumberLayers = 5,
225  min_nhits = 7,
226  maxNumberLostLayers = 2,
227  minNumber3DLayers = 2,
228  minHitsToBypassChecks = 20
229  ),
230  ) #end of vpset
231  ) #end of clone
232 muonSeededTracksOutInSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
233  src='muonSeededTracksOutIn',
234  trackSelectors= cms.VPSet(
235  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
236  name = 'muonSeededTracksOutInLoose',
237  applyAdaptedPVCuts = False,
238  chi2n_par = 10.0,
239  minNumberLayers = 3,
240  min_nhits = 5,
241  maxNumberLostLayers = 4,
242  minNumber3DLayers = 0,
243  minHitsToBypassChecks = 7
244  ),
245  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
246  name = 'muonSeededTracksOutInTight',
247  preFilterName = 'muonSeededTracksOutInLoose',
248  applyAdaptedPVCuts = False,
249  chi2n_par = 1.0,
250  minNumberLayers = 5,
251  min_nhits = 6,
252  maxNumberLostLayers = 3,
253  minNumber3DLayers = 2,
254  minHitsToBypassChecks = 10
255  ),
256  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
257  name = 'muonSeededTracksOutInHighPurity',
258  preFilterName = 'muonSeededTracksOutInTight',
259  applyAdaptedPVCuts = False,
260  chi2n_par = 0.4,
261  minNumberLayers = 5,
262  min_nhits = 7,
263  maxNumberLostLayers = 2,
264  minNumber3DLayers = 2,
265  minHitsToBypassChecks = 20
266  ),
267  ) #end of vpset
268  ) #end of clone
269 
270 
271 
272 muonSeededStepCoreInOutTask = cms.Task(
273  muonSeededSeedsInOut , muonSeededTrackCandidatesInOut , muonSeededTracksInOut
274 )
275 muonSeededStepCoreInOut = cms.Sequence(muonSeededStepCoreInOutTask)
276 
277 muonSeededStepCoreOutInTask = cms.Task(
278  muonSeededSeedsOutIn , muonSeededTrackCandidatesOutIn , muonSeededTracksOutIn
279 )
280 muonSeededStepCoreOutIn = cms.Sequence(muonSeededStepCoreOutInTask)
281 
282 muonSeededStepCoreTask = cms.Task(
283  muonSeededStepCoreInOutTask ,
284  muonSeededStepCoreOutInTask
285 )
286 muonSeededStepCore = cms.Sequence(muonSeededStepCoreTask)
287 #Phase2 : just muon Seed InOut is used in this moment
288 #trackingPhase2PU140.toReplaceWith(muonSeededStepCore, muonSeededStepCoreInOut)
289 
290 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
291 phase2_timing_layer.toModify(muonSeededTracksInOut, TrajectoryInEvent = True)
292 phase2_timing_layer.toModify(muonSeededTracksOutIn, TrajectoryInEvent = True)
293 
294 muonSeededStepExtraInOutTask = cms.Task(
295  muonSeededTracksInOutClassifier
296 )
297 muonSeededStepExtraInOut = cms.Sequence(muonSeededStepExtraInOutTask)
298 
299 trackingPhase2PU140.toReplaceWith(muonSeededStepExtraInOutTask, cms.Task(
300  muonSeededTracksInOutSelector
301 ))
302 
303 muonSeededStepExtraTask = cms.Task(
304  muonSeededStepExtraInOutTask ,
305  muonSeededTracksOutInClassifier
306 )
307 
308 muonSeededStepExtra = cms.Sequence(muonSeededStepExtraTask)
309 trackingPhase2PU140.toReplaceWith(muonSeededStepExtraTask, cms.Task(
310  muonSeededStepExtraInOutTask ,
311  muonSeededTracksOutInSelector
312 ))
313 
314 muonSeededStepTask = cms.Task(
315  earlyMuons,
316  muonSeededStepCoreTask,
317  muonSeededStepExtraTask
318 )
319 muonSeededStep = cms.Sequence(muonSeededStepTask)
320 
321 
322 
323 muonSeededSeedsInOutAsTracks = cms.EDProducer('FakeTrackProducerFromSeed', src = cms.InputTag('muonSeededSeedsInOut'))
324 muonSeededSeedsOutInAsTracks = cms.EDProducer('FakeTrackProducerFromSeed', src = cms.InputTag('muonSeededSeedsOutIn'))
325 muonSeededTrackCandidatesInOutAsTracks = cms.EDProducer('FakeTrackProducerFromCandidate', src = cms.InputTag('muonSeededTrackCandidatesInOut'))
326 muonSeededTrackCandidatesOutInAsTracks = cms.EDProducer('FakeTrackProducerFromCandidate', src = cms.InputTag('muonSeededTrackCandidatesOutIn'))
327 muonSeededStepDebugInOutTask = cms.Task(
328  muonSeededSeedsInOutAsTracks , muonSeededTrackCandidatesInOutAsTracks
329 )
330 muonSeededStepDebugInOut = cms.Sequence(muonSeededStepDebugInOutTask)
331 muonSeededStepDebugTask = cms.Task(
332  muonSeededSeedsOutInAsTracks , muonSeededTrackCandidatesOutInAsTracks ,
333  muonSeededStepDebugInOutTask
334 )
335 muonSeededStepDebug = cms.Sequence(muonSeededStepDebugTask)