CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.Chi2MeasurementEstimatorESProducer_cfi.Chi2MeasurementEstimator.clone(
34  ComponentName = cms.string('muonSeededMeasurementEstimatorForInOut'),
35  MaxChi2 = cms.double(80.0), ## was 30 ## TO BE TUNED
36  nSigma = cms.double(4.), ## was 3 ## TO BE TUNED
37 )
38 muonSeededMeasurementEstimatorForOutIn = TrackingTools.KalmanUpdators.Chi2MeasurementEstimatorESProducer_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 
117 # Final Classifier
119 muonSeededTracksInOutClassifier = TrackCutClassifier.clone()
120 muonSeededTracksInOutClassifier.src='muonSeededTracksInOut'
121 muonSeededTracksInOutClassifier.mva.minPixelHits = [0,0,0]
122 muonSeededTracksInOutClassifier.mva.maxChi2 = [9999.,9999.,9999.]
123 muonSeededTracksInOutClassifier.mva.maxChi2n = [10.0,1.0,0.4]
124 muonSeededTracksInOutClassifier.mva.minLayers = [3,5,5]
125 muonSeededTracksInOutClassifier.mva.min3DLayers = [1,2,2]
126 muonSeededTracksInOutClassifier.mva.maxLostLayers = [4,3,2]
127 
128 
129 muonSeededTracksOutInClassifier = TrackCutClassifier.clone()
130 muonSeededTracksOutInClassifier.src='muonSeededTracksOutIn'
131 muonSeededTracksOutInClassifier.mva.minPixelHits = [0,0,0]
132 muonSeededTracksOutInClassifier.mva.maxChi2 = [9999.,9999.,9999.]
133 muonSeededTracksOutInClassifier.mva.maxChi2n = [10.0,1.0,0.4]
134 muonSeededTracksOutInClassifier.mva.minLayers = [3,5,5]
135 muonSeededTracksOutInClassifier.mva.min3DLayers = [1,2,2]
136 muonSeededTracksOutInClassifier.mva.maxLostLayers = [4,3,2]
137 
138 
139 
140 
141 muonSeededStepCore = cms.Sequence(
142  muonSeededSeedsInOut + muonSeededTrackCandidatesInOut + muonSeededTracksInOut +
143  muonSeededSeedsOutIn + muonSeededTrackCandidatesOutIn + muonSeededTracksOutIn
144 )
145 muonSeededStepExtra = cms.Sequence(
146  muonSeededTracksInOutClassifier +
147  muonSeededTracksOutInClassifier
148 )
149 
150 muonSeededStep = cms.Sequence(
151  earlyMuons +
152  muonSeededStepCore +
153  muonSeededStepExtra
154 )
155 
156 
157 ##### MODULES FOR DEBUGGING ###############3
158 muonSeededSeedsInOutAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsInOut"))
159 muonSeededSeedsOutInAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsOutIn"))
160 muonSeededTrackCandidatesInOutAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesInOut"))
161 muonSeededTrackCandidatesOutInAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesOutIn"))
162 muonSeededStepDebug = cms.Sequence(
163  muonSeededSeedsOutInAsTracks + muonSeededTrackCandidatesOutInAsTracks +
164  muonSeededSeedsInOutAsTracks + muonSeededTrackCandidatesInOutAsTracks
165 )