CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Phase1PU70_MuonSeededStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 ###### Muon reconstruction module #####
4 from RecoMuon.MuonIdentification.earlyMuons_cfi import earlyMuons
5 
6 ###### SEEDER MODELS ######
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 ### This is also needed for seeding
16 from RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi import hitCollectorForOutInMuonSeeds
17 
18 ###### EVENT-SETUP STUFF #######
19 ###---------- Trajectory Cleaner, deciding how overlapping track candidates are arbitrated ----------------
21 muonSeededTrajectoryCleanerBySharedHits = TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi.trajectoryCleanerBySharedHits.clone(
22  ComponentName = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
23  fractionShared = cms.double(0.1),
24  ValidHitBonus = cms.double(1000.0),
25  MissingHitPenalty = cms.double(1.0),
26  ComponentType = cms.string('TrajectoryCleanerBySharedHits'),
27  allowSharedFirstHit = cms.bool(True)
28 )
29 
30 ###------------- MeasurementEstimator, defining the searcgh window for pattern recongnition ----------------
31 
33 muonSeededMeasurementEstimatorForInOut = TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi.Chi2MeasurementEstimator.clone(
34  ComponentName = cms.string('muonSeededMeasurementEstimatorForInOut'),
35  MaxChi2 = cms.double(400.0), ## was 30 ## TO BE TUNED
36  nSigma = cms.double(4.), ## was 3 ## TO BE TUNED
37 )
38 muonSeededMeasurementEstimatorForOutIn = TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi.Chi2MeasurementEstimator.clone(
39  ComponentName = cms.string('muonSeededMeasurementEstimatorForOutIn'),
40  MaxChi2 = cms.double(30.0), ## was 30 ## TO BE TUNED
41  nSigma = cms.double(3.), ## was 3 ## TO BE TUNED
42 )
43 
44 ###------------- TrajectoryFilter, defining selections on the trajectories while building them ----------------
46 muonSeededTrajectoryFilterForInOut = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone()
47 muonSeededTrajectoryFilterForInOut.constantValueForLostHitsFractionFilter = 10 ## allow more lost hits
48 muonSeededTrajectoryFilterForInOut.minimumNumberOfHits = 3 ## allow more lost hits
49 
50 muonSeededTrajectoryFilterForOutIn = muonSeededTrajectoryFilterForInOut.clone()
51 muonSeededTrajectoryFilterForOutIn.constantValueForLostHitsFractionFilter = 10 ## allow more lost hits
52 muonSeededTrajectoryFilterForOutIn.minimumNumberOfHits = 5 ## allow more lost hits
53 
54 ###------------- TrajectoryBuilders ----------------
56 muonSeededTrajectoryBuilderForInOut = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
57  foundHitBonus = cms.double(1000.0),
58  lostHitPenalty = cms.double(1.0),
59  maxCand = cms.int32(5),
60  estimator = cms.string('muonSeededMeasurementEstimatorForInOut'),
61  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForInOut')),
62  inOutTrajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForInOut')), # not sure if it is used
63  minNrOfHitsForRebuild = cms.int32(2),
64  requireSeedHitsInRebuild = cms.bool(True),
65  keepOriginalIfRebuildFails = cms.bool(True),
66 )
67 muonSeededTrajectoryBuilderForOutIn = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
68  foundHitBonus = cms.double(1000.0),
69  lostHitPenalty = cms.double(1.0),
70  maxCand = cms.int32(3),
71  estimator = cms.string('muonSeededMeasurementEstimatorForOutIn'),
72  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForOutIn')),
73  inOutTrajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForOutIn')), # not sure if it is used
74  minNrOfHitsForRebuild = cms.int32(5),
75  requireSeedHitsInRebuild = cms.bool(True),
76  keepOriginalIfRebuildFails = cms.bool(False),
77 )
78 
79 ###------------- Fitter-Smoother -------------------
81 muonSeededFittingSmootherWithOutliersRejectionAndRK = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
82  ComponentName = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
83  BreakTrajWith2ConsecutiveMissing = cms.bool(False),
84  EstimateCut = cms.double(50.), ## was 20.
85 )
86 
87 ######## TRACK CANDIDATE MAKERS
89 muonSeededTrackCandidatesInOut = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
90  src = cms.InputTag("muonSeededSeedsInOut"),
91  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string("muonSeededTrajectoryBuilderForInOut")),
92  TrajectoryCleaner = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
93  RedundantSeedCleaner = cms.string("none"),
94 )
95 muonSeededTrackCandidatesOutIn = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
96  src = cms.InputTag("muonSeededSeedsOutIn"),
97  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string("muonSeededTrajectoryBuilderForOutIn")),
98  TrajectoryCleaner = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
99  numHitsForSeedCleaner = cms.int32(50),
100  onlyPixelHitsForSeedCleaner = cms.bool(False),
101 )
102 
103 ######## TRACK PRODUCERS
105 muonSeededTracksOutIn = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
106  src = cms.InputTag("muonSeededTrackCandidatesOutIn"),
107  AlgorithmName = cms.string('muonSeededStepOutIn'),
108  Fitter = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
109 )
110 muonSeededTracksInOut = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
111  src = cms.InputTag("muonSeededTrackCandidatesInOut"),
112  AlgorithmName = cms.string('muonSeededStepInOut'),
113  Fitter = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
114 )
115 
116 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
117 muonSeededTracksInOutSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
118  src='muonSeededTracksInOut',
119  trackSelectors= cms.VPSet(
120  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
121  name = 'muonSeededTracksInOutLoose',
122  applyAdaptedPVCuts = cms.bool(False),
123  chi2n_par = 10.0,
124  minNumberLayers = 3,
125  min_nhits = 5,
126  maxNumberLostLayers = 4,
127  minNumber3DLayers = 0,
128  minHitsToBypassChecks = 7
129  ),
130  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
131  name = 'muonSeededTracksInOutTight',
132  preFilterName = 'muonSeededTracksInOutLoose',
133  applyAdaptedPVCuts = cms.bool(False),
134  chi2n_par = 1.0,
135  minNumberLayers = 5,
136  min_nhits = 6,
137  maxNumberLostLayers = 3,
138  minNumber3DLayers = 2,
139  minHitsToBypassChecks = 10
140  ),
141  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
142  name = 'muonSeededTracksInOutHighPurity',
143  preFilterName = 'muonSeededTracksInOutTight',
144  applyAdaptedPVCuts = cms.bool(False),
145  chi2n_par = 0.4,
146  minNumberLayers = 5,
147  min_nhits = 7,
148  maxNumberLostLayers = 2,
149  minNumber3DLayers = 2,
150  minHitsToBypassChecks = 20
151  ),
152  ) #end of vpset
153  ) #end of clone
154 
155 muonSeededTracksOutInSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
156  src='muonSeededTracksOutIn',
157  trackSelectors= cms.VPSet(
158  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
159  name = 'muonSeededTracksOutInLoose',
160  applyAdaptedPVCuts = cms.bool(False),
161  chi2n_par = 10.0,
162  minNumberLayers = 3,
163  min_nhits = 5,
164  maxNumberLostLayers = 4,
165  minNumber3DLayers = 0,
166  minHitsToBypassChecks = 7
167  ),
168  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
169  name = 'muonSeededTracksOutInTight',
170  preFilterName = 'muonSeededTracksOutInLoose',
171  applyAdaptedPVCuts = cms.bool(False),
172  chi2n_par = 1.0,
173  minNumberLayers = 5,
174  min_nhits = 6,
175  maxNumberLostLayers = 3,
176  minNumber3DLayers = 2,
177  minHitsToBypassChecks = 10
178  ),
179  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
180  name = 'muonSeededTracksOutInHighPurity',
181  preFilterName = 'muonSeededTracksOutInTight',
182  applyAdaptedPVCuts = cms.bool(False),
183  chi2n_par = 0.4,
184  minNumberLayers = 5,
185  min_nhits = 7,
186  maxNumberLostLayers = 2,
187  minNumber3DLayers = 2,
188  minHitsToBypassChecks = 20
189  ),
190  ) #end of vpset
191  ) #end of clone
192 
193 
194 
195 muonSeededStepCore = cms.Sequence(
196  muonSeededSeedsInOut + muonSeededTrackCandidatesInOut + muonSeededTracksInOut +
197  muonSeededSeedsOutIn + muonSeededTrackCandidatesOutIn + muonSeededTracksOutIn
198 )
199 muonSeededStepExtra = cms.Sequence(
200  muonSeededTracksInOutSelector +
201  muonSeededTracksOutInSelector
202 )
203 
204 muonSeededStep = cms.Sequence(
205  earlyMuons +
206  muonSeededStepCore +
207  muonSeededStepExtra
208 )
209 
210 
211 ##### MODULES FOR DEBUGGING ###############3
212 muonSeededSeedsInOutAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsInOut"))
213 muonSeededSeedsOutInAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsOutIn"))
214 muonSeededTrackCandidatesInOutAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesInOut"))
215 muonSeededTrackCandidatesOutInAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesOutIn"))
216 muonSeededStepDebug = cms.Sequence(
217  muonSeededSeedsOutInAsTracks + muonSeededTrackCandidatesOutInAsTracks +
218  muonSeededSeedsInOutAsTracks + muonSeededTrackCandidatesInOutAsTracks
219 )