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.Chi2MeasurementEstimator_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  MaxSagitta = cms.double(-1.)
38 )
39 muonSeededMeasurementEstimatorForOutIn = TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi.Chi2MeasurementEstimator.clone(
40  ComponentName = cms.string('muonSeededMeasurementEstimatorForOutIn'),
41  MaxChi2 = cms.double(30.0), ## was 30 ## TO BE TUNED
42  nSigma = cms.double(3.), ## was 3 ## TO BE TUNED
43  MaxSagitta = cms.double(-1.)
44 )
45 
46 ###------------- TrajectoryFilter, defining selections on the trajectories while building them ----------------
48 muonSeededTrajectoryFilterForInOut = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone()
49 muonSeededTrajectoryFilterForInOut.constantValueForLostHitsFractionFilter = 10 ## allow more lost hits
50 muonSeededTrajectoryFilterForInOut.minimumNumberOfHits = 3 ## allow more lost hits
51 
52 muonSeededTrajectoryFilterForOutIn = muonSeededTrajectoryFilterForInOut.clone()
53 muonSeededTrajectoryFilterForOutIn.constantValueForLostHitsFractionFilter = 10 ## allow more lost hits
54 muonSeededTrajectoryFilterForOutIn.minimumNumberOfHits = 5 ## allow more lost hits
55 
56 ###------------- TrajectoryBuilders ----------------
58 muonSeededTrajectoryBuilderForInOut = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
59  foundHitBonus = cms.double(1000.0),
60  lostHitPenalty = cms.double(1.0),
61  maxCand = cms.int32(5),
62  estimator = cms.string('muonSeededMeasurementEstimatorForInOut'),
63  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForInOut')),
64  inOutTrajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForInOut')), # not sure if it is used
65  minNrOfHitsForRebuild = cms.int32(2),
66  requireSeedHitsInRebuild = cms.bool(True),
67  keepOriginalIfRebuildFails = cms.bool(True),
68 )
69 muonSeededTrajectoryBuilderForOutIn = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
70  foundHitBonus = cms.double(1000.0),
71  lostHitPenalty = cms.double(1.0),
72  maxCand = cms.int32(3),
73  estimator = cms.string('muonSeededMeasurementEstimatorForOutIn'),
74  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForOutIn')),
75  inOutTrajectoryFilter = cms.PSet(refToPSet_ = cms.string('muonSeededTrajectoryFilterForOutIn')), # not sure if it is used
76  minNrOfHitsForRebuild = cms.int32(5),
77  requireSeedHitsInRebuild = cms.bool(True),
78  keepOriginalIfRebuildFails = cms.bool(False),
79 )
80 
81 ###------------- Fitter-Smoother -------------------
83 muonSeededFittingSmootherWithOutliersRejectionAndRK = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
84  ComponentName = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
85  BreakTrajWith2ConsecutiveMissing = cms.bool(False),
86  EstimateCut = cms.double(50.), ## was 20.
87 )
88 
89 ######## TRACK CANDIDATE MAKERS
91 muonSeededTrackCandidatesInOut = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
92  src = cms.InputTag("muonSeededSeedsInOut"),
93  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string("muonSeededTrajectoryBuilderForInOut")),
94  TrajectoryCleaner = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
95  RedundantSeedCleaner = cms.string("none"),
96 )
97 muonSeededTrackCandidatesOutIn = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
98  src = cms.InputTag("muonSeededSeedsOutIn"),
99  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string("muonSeededTrajectoryBuilderForOutIn")),
100  TrajectoryCleaner = cms.string('muonSeededTrajectoryCleanerBySharedHits'),
101  numHitsForSeedCleaner = cms.int32(50),
102  onlyPixelHitsForSeedCleaner = cms.bool(False),
103 )
104 
105 ######## TRACK PRODUCERS
107 muonSeededTracksOutIn = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
108  src = cms.InputTag("muonSeededTrackCandidatesOutIn"),
109  AlgorithmName = cms.string('muonSeededStepOutIn'),
110  Fitter = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
111 )
112 muonSeededTracksInOut = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
113  src = cms.InputTag("muonSeededTrackCandidatesInOut"),
114  AlgorithmName = cms.string('muonSeededStepInOut'),
115  Fitter = cms.string("muonSeededFittingSmootherWithOutliersRejectionAndRK"),
116 )
117 
118 
119 # Final Classifier
121 muonSeededTracksInOutClassifier = TrackCutClassifier.clone()
122 muonSeededTracksInOutClassifier.src='muonSeededTracksInOut'
123 muonSeededTracksInOutClassifier.mva.minPixelHits = [0,0,0]
124 muonSeededTracksInOutClassifier.mva.maxChi2 = [9999.,9999.,9999.]
125 muonSeededTracksInOutClassifier.mva.maxChi2n = [10.0,1.0,0.4]
126 muonSeededTracksInOutClassifier.mva.minLayers = [3,5,5]
127 muonSeededTracksInOutClassifier.mva.min3DLayers = [1,2,2]
128 muonSeededTracksInOutClassifier.mva.maxLostLayers = [4,3,2]
129 
130 
131 muonSeededTracksOutInClassifier = TrackCutClassifier.clone()
132 muonSeededTracksOutInClassifier.src='muonSeededTracksOutIn'
133 muonSeededTracksOutInClassifier.mva.minPixelHits = [0,0,0]
134 muonSeededTracksOutInClassifier.mva.maxChi2 = [9999.,9999.,9999.]
135 muonSeededTracksOutInClassifier.mva.maxChi2n = [10.0,1.0,0.4]
136 muonSeededTracksOutInClassifier.mva.minLayers = [3,5,5]
137 muonSeededTracksOutInClassifier.mva.min3DLayers = [1,2,2]
138 muonSeededTracksOutInClassifier.mva.maxLostLayers = [4,3,2]
139 
140 
141 
142 
143 muonSeededStepCore = cms.Sequence(
144  muonSeededSeedsInOut + muonSeededTrackCandidatesInOut + muonSeededTracksInOut +
145  muonSeededSeedsOutIn + muonSeededTrackCandidatesOutIn + muonSeededTracksOutIn
146 )
147 muonSeededStepExtra = cms.Sequence(
148  muonSeededTracksInOutClassifier +
149  muonSeededTracksOutInClassifier
150 )
151 
152 muonSeededStep = cms.Sequence(
153  earlyMuons +
154  muonSeededStepCore +
155  muonSeededStepExtra
156 )
157 
158 
159 ##### MODULES FOR DEBUGGING ###############3
160 muonSeededSeedsInOutAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsInOut"))
161 muonSeededSeedsOutInAsTracks = cms.EDProducer("FakeTrackProducerFromSeed", src = cms.InputTag("muonSeededSeedsOutIn"))
162 muonSeededTrackCandidatesInOutAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesInOut"))
163 muonSeededTrackCandidatesOutInAsTracks = cms.EDProducer("FakeTrackProducerFromCandidate", src = cms.InputTag("muonSeededTrackCandidatesOutIn"))
164 muonSeededStepDebug = cms.Sequence(
165  muonSeededSeedsOutInAsTracks + muonSeededTrackCandidatesOutInAsTracks +
166  muonSeededSeedsInOutAsTracks + muonSeededTrackCandidatesInOutAsTracks
167 )