Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-17 23:57:46

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ###### Muon reconstruction module #####
0004 from RecoMuon.MuonIdentification.earlyMuons_cfi import earlyMuons
0005 
0006 ###### SEEDER MODELS ######
0007 import RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi
0008 import RecoTracker.SpecialSeedGenerators.inOutSeedsFromTrackerMuons_cfi
0009 muonSeededSeedsOutIn = RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi.outInSeedsFromStandaloneMuons.clone(
0010     src = 'earlyMuons',
0011 )
0012 muonSeededSeedsInOut = RecoTracker.SpecialSeedGenerators.inOutSeedsFromTrackerMuons_cfi.inOutSeedsFromTrackerMuons.clone(
0013     src = 'earlyMuons',
0014 )
0015 ### This is also needed for seeding
0016 from RecoTracker.SpecialSeedGenerators.outInSeedsFromStandaloneMuons_cfi import hitCollectorForOutInMuonSeeds
0017 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
0018 _tracker_apv_vfp30_2016.toModify(hitCollectorForOutInMuonSeeds, MinPtForHitRecoveryInGluedDet=1e9)
0019 
0020 ###### EVENT-SETUP STUFF #######
0021 ###---------- Trajectory Cleaner, deciding how overlapping track candidates are arbitrated  ----------------
0022 import TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi 
0023 muonSeededTrajectoryCleanerBySharedHits = TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi.trajectoryCleanerBySharedHits.clone(
0024     ComponentName       = 'muonSeededTrajectoryCleanerBySharedHits',
0025     fractionShared      = 0.1,
0026     ValidHitBonus       = 1000.0,
0027     MissingHitPenalty   = 1.0,
0028     ComponentType       = 'TrajectoryCleanerBySharedHits',
0029     allowSharedFirstHit = True
0030 )
0031 
0032 ###------------- MeasurementEstimator, defining the searcgh window for pattern recongnition ----------------
0033 
0034 from TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi import Chi2MeasurementEstimator as _Chi2MeasurementEstimator
0035 _muonSeededMeasurementEstimatorForInOutBase = _Chi2MeasurementEstimator.clone(
0036     ComponentName = 'muonSeededMeasurementEstimatorForInOut',
0037     MaxChi2       = 80.0, ## was 30 ## TO BE TUNED
0038     nSigma        = 4.,    ## was 3  ## TO BE TUNED 
0039 )
0040 muonSeededMeasurementEstimatorForInOut = _muonSeededMeasurementEstimatorForInOutBase.clone(
0041     MaxSagitta = -1.
0042 )
0043 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
0044 trackingPhase2PU140.toModify(muonSeededMeasurementEstimatorForInOut, MaxChi2 = 400.0, MaxSagitta = 2)
0045 
0046 _muonSeededMeasurementEstimatorForOutInBase = _Chi2MeasurementEstimator.clone(
0047     ComponentName = 'muonSeededMeasurementEstimatorForOutIn',
0048     MaxChi2       = 30.0, ## was 30 ## TO BE TUNED
0049     nSigma        = 3.,    ## was 3  ## TO BE TUNED
0050 )
0051 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
0052 _tracker_apv_vfp30_2016.toModify(_muonSeededMeasurementEstimatorForOutInBase, MinPtForHitRecoveryInGluedDet=1e9)
0053 muonSeededMeasurementEstimatorForOutIn = _muonSeededMeasurementEstimatorForOutInBase.clone(
0054     MaxSagitta = -1. 
0055 )
0056 
0057 ###------------- TrajectoryFilter, defining selections on the trajectories while building them ----------------
0058 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff
0059 muonSeededTrajectoryFilterForInOut = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
0060     constantValueForLostHitsFractionFilter = 10, ## allow more lost hits
0061     minimumNumberOfHits                    = 3 ## allow more lost hits
0062 )
0063 muonSeededTrajectoryFilterForOutIn = muonSeededTrajectoryFilterForInOut.clone(
0064     constantValueForLostHitsFractionFilter = 10, ## allow more lost hits
0065     minimumNumberOfHits = 5 ## allow more lost hits
0066 )
0067 ###------------- TrajectoryBuilders ----------------
0068 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
0069 muonSeededTrajectoryBuilderForInOut = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
0070     foundHitBonus    = 1000.0,
0071     lostHitPenalty   = 1.0,
0072     maxCand          = 5,
0073     estimator        = 'muonSeededMeasurementEstimatorForInOut',
0074     trajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForInOut'),
0075     inOutTrajectoryFilter      = dict(refToPSet_ = 'muonSeededTrajectoryFilterForInOut'), # not sure if it is used
0076     minNrOfHitsForRebuild      = 2,
0077     requireSeedHitsInRebuild   = True, 
0078     keepOriginalIfRebuildFails = True, 
0079 )
0080 muonSeededTrajectoryBuilderForOutIn = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
0081     foundHitBonus    = 1000.0,
0082     lostHitPenalty   = 1.0,
0083     maxCand          = 3,
0084     estimator        = 'muonSeededMeasurementEstimatorForOutIn',
0085     trajectoryFilter = dict(refToPSet_ = 'muonSeededTrajectoryFilterForOutIn'),
0086     inOutTrajectoryFilter      = dict(refToPSet_ = 'muonSeededTrajectoryFilterForOutIn'), # not sure if it is used
0087     minNrOfHitsForRebuild      = 5,
0088     requireSeedHitsInRebuild   = True,
0089     keepOriginalIfRebuildFails = False,
0090 )
0091 
0092 ###-------------  Fitter-Smoother -------------------
0093 import TrackingTools.TrackFitters.RungeKuttaFitters_cff
0094 muonSeededFittingSmootherWithOutliersRejectionAndRK = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
0095     ComponentName = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
0096     BreakTrajWith2ConsecutiveMissing = False, 
0097     EstimateCut   = 50., ## was 20.
0098 )
0099 
0100 ######## TRACK CANDIDATE MAKERS
0101 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0102 muonSeededTrackCandidatesInOut = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0103     src = 'muonSeededSeedsInOut',
0104     TrajectoryBuilderPSet = dict(refToPSet_ = 'muonSeededTrajectoryBuilderForInOut'),
0105     TrajectoryCleaner     = 'muonSeededTrajectoryCleanerBySharedHits',
0106     RedundantSeedCleaner  = 'none', 
0107 )
0108 muonSeededTrackCandidatesOutIn = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0109     src = 'muonSeededSeedsOutIn',
0110     TrajectoryBuilderPSet       = dict(refToPSet_ = 'muonSeededTrajectoryBuilderForOutIn'),
0111     TrajectoryCleaner           = 'muonSeededTrajectoryCleanerBySharedHits',
0112     numHitsForSeedCleaner       = 50,
0113     onlyPixelHitsForSeedCleaner = False,
0114 )
0115 
0116 ######## TRACK PRODUCERS 
0117 import RecoTracker.TrackProducer.TrackProducer_cfi
0118 muonSeededTracksOutIn = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0119     src           = 'muonSeededTrackCandidatesOutIn',
0120     AlgorithmName = 'muonSeededStepOutIn',
0121     Fitter        = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
0122 )
0123 muonSeededTracksInOut = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0124     src           = 'muonSeededTrackCandidatesInOut',
0125     AlgorithmName = 'muonSeededStepInOut',
0126     Fitter        = 'muonSeededFittingSmootherWithOutliersRejectionAndRK',
0127 )
0128 
0129 # Final Classifier
0130 from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import *
0131 muonSeededTracksInOutClassifier = TrackCutClassifier.clone(
0132     src = 'muonSeededTracksInOut',
0133     mva = dict(
0134     minPixelHits  = [0,0,0],
0135         maxChi2       = [9999.,9999.,9999.],
0136         maxChi2n      = [10.0,1.0,0.4],
0137         minLayers     = [3,5,5],
0138         min3DLayers   = [1,2,2],
0139         maxLostLayers = [4,3,2]
0140     )
0141 )
0142 
0143 muonSeededTracksOutInClassifier = TrackCutClassifier.clone(
0144     src = 'muonSeededTracksOutIn',
0145     mva = dict(
0146     minPixelHits  = [0,0,0],
0147         maxChi2       = [9999.,9999.,9999.],
0148         maxChi2n      = [10.0,1.0,0.4],
0149         minLayers     = [3,5,5],
0150         min3DLayers   = [1,2,2],
0151         maxLostLayers = [4,3,2]
0152     )
0153 )
0154 
0155 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0156 pp_on_AA.toModify(muonSeededTracksOutInClassifier.mva,
0157                   dr_par = cms.PSet(
0158                       d0err = cms.vdouble(0.003, 0.003, 0.003),
0159                       d0err_par = cms.vdouble(0.001, 0.001, 0.001),
0160                       dr_exp = cms.vint32(4, 4, 4),
0161                       dr_par1 = cms.vdouble(0.4, 0.4, 0.4),
0162                       dr_par2 = cms.vdouble(0.3, 0.3, 0.3)
0163                   ),
0164                   dz_par = cms.PSet(
0165                       dz_exp = cms.vint32(4, 4, 4),
0166                       dz_par1 = cms.vdouble(0.4, 0.4, 0.4),
0167                       dz_par2 = cms.vdouble(0.35, 0.35, 0.35)
0168                   ),
0169                   maxDr         = [9999.,9999.,0.5],
0170                   maxDz         = [9999.,9999.,0.5],
0171                   minHits     =   [0,0,10],
0172                   minPixelHits  = [0,0,1],
0173 )
0174 pp_on_AA.toModify(muonSeededTracksInOutClassifier.mva,
0175                   dr_par = cms.PSet(
0176                       d0err = cms.vdouble(0.003, 0.003, 0.003),
0177                       d0err_par = cms.vdouble(0.001, 0.001, 0.001),
0178                       dr_exp = cms.vint32(4, 4, 4),
0179                       dr_par1 = cms.vdouble(0.4, 0.4, 0.4),
0180                       dr_par2 = cms.vdouble(0.3, 0.3, 0.3)
0181                   ),
0182                   dz_par = cms.PSet(
0183                       dz_exp = cms.vint32(4, 4, 4),
0184                       dz_par1 = cms.vdouble(0.4, 0.4, 0.4),
0185                       dz_par2 = cms.vdouble(0.35, 0.35, 0.35)
0186                   ),
0187                   maxDr         = [9999.,9999.,0.5],
0188                   maxDz         = [9999.,9999.,0.5],
0189                   minHits     =   [0,0,10],
0190                   minPixelHits  = [0,0,1],
0191 )
0192 
0193 # For Phase2PU140
0194 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
0195 muonSeededTracksInOutSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0196     src='muonSeededTracksInOut',
0197     trackSelectors= cms.VPSet(
0198         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0199             name                  = 'muonSeededTracksInOutLoose',
0200             applyAdaptedPVCuts    = False,
0201             chi2n_par             = 10.0,
0202             minNumberLayers       = 3,
0203             min_nhits             = 5,
0204             maxNumberLostLayers   = 4,
0205             minNumber3DLayers     = 0,
0206             minHitsToBypassChecks = 7
0207             ),
0208         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0209             name                  = 'muonSeededTracksInOutTight',
0210             preFilterName         = 'muonSeededTracksInOutLoose',
0211             applyAdaptedPVCuts    = False,
0212             chi2n_par             = 1.0,
0213             minNumberLayers       = 5,
0214             min_nhits             = 6,
0215             maxNumberLostLayers   = 3,
0216             minNumber3DLayers     = 2,
0217             minHitsToBypassChecks = 10
0218             ),
0219         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0220             name                  = 'muonSeededTracksInOutHighPurity',
0221             preFilterName         = 'muonSeededTracksInOutTight',
0222             applyAdaptedPVCuts    = False,
0223             chi2n_par             = 0.4,
0224             minNumberLayers       = 5,
0225             min_nhits             = 7,
0226             maxNumberLostLayers   = 2,
0227             minNumber3DLayers     = 2,
0228             minHitsToBypassChecks = 20
0229             ),
0230         ) #end of vpset
0231     ) #end of clone
0232 muonSeededTracksOutInSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0233     src='muonSeededTracksOutIn',
0234     trackSelectors= cms.VPSet(
0235         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0236             name                  = 'muonSeededTracksOutInLoose',
0237             applyAdaptedPVCuts    = False,
0238             chi2n_par             = 10.0,
0239             minNumberLayers       = 3,
0240             min_nhits             = 5,
0241             maxNumberLostLayers   = 4,
0242             minNumber3DLayers     = 0,
0243             minHitsToBypassChecks = 7
0244             ),
0245         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0246             name                  = 'muonSeededTracksOutInTight',
0247             preFilterName         = 'muonSeededTracksOutInLoose',
0248             applyAdaptedPVCuts    = False,
0249             chi2n_par             = 1.0,
0250             minNumberLayers       = 5,
0251             min_nhits             = 6,
0252             maxNumberLostLayers   = 3,
0253             minNumber3DLayers     = 2,
0254             minHitsToBypassChecks = 10
0255             ),
0256         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0257             name                  = 'muonSeededTracksOutInHighPurity',
0258             preFilterName         = 'muonSeededTracksOutInTight',
0259             applyAdaptedPVCuts    = False,
0260             chi2n_par             = 0.4,
0261             minNumberLayers       = 5,
0262             min_nhits             = 7,
0263             maxNumberLostLayers   = 2,
0264             minNumber3DLayers     = 2,
0265             minHitsToBypassChecks = 20
0266             ),
0267         ) #end of vpset
0268     ) #end of clone
0269 
0270 
0271 
0272 muonSeededStepCoreInOutTask = cms.Task(
0273     muonSeededSeedsInOut , muonSeededTrackCandidatesInOut , muonSeededTracksInOut
0274 )
0275 muonSeededStepCoreInOut = cms.Sequence(muonSeededStepCoreInOutTask)
0276 
0277 muonSeededStepCoreOutInTask = cms.Task(
0278     muonSeededSeedsOutIn , muonSeededTrackCandidatesOutIn , muonSeededTracksOutIn
0279 )
0280 muonSeededStepCoreOutIn = cms.Sequence(muonSeededStepCoreOutInTask)
0281 
0282 muonSeededStepCoreTask = cms.Task(
0283     muonSeededStepCoreInOutTask ,
0284     muonSeededStepCoreOutInTask
0285 )
0286 muonSeededStepCore = cms.Sequence(muonSeededStepCoreTask)
0287 #Phase2 : just muon Seed InOut is used in this moment
0288 #trackingPhase2PU140.toReplaceWith(muonSeededStepCore, muonSeededStepCoreInOut)
0289 
0290 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0291 phase2_timing_layer.toModify(muonSeededTracksInOut, TrajectoryInEvent = True)
0292 phase2_timing_layer.toModify(muonSeededTracksOutIn, TrajectoryInEvent = True)
0293 
0294 muonSeededStepExtraInOutTask = cms.Task(
0295     muonSeededTracksInOutClassifier
0296 )
0297 muonSeededStepExtraInOut = cms.Sequence(muonSeededStepExtraInOutTask)
0298 
0299 trackingPhase2PU140.toReplaceWith(muonSeededStepExtraInOutTask, cms.Task(
0300     muonSeededTracksInOutSelector
0301 ))
0302 
0303 muonSeededStepExtraTask = cms.Task(
0304     muonSeededStepExtraInOutTask ,
0305     muonSeededTracksOutInClassifier
0306 )
0307 
0308 muonSeededStepExtra = cms.Sequence(muonSeededStepExtraTask)
0309 trackingPhase2PU140.toReplaceWith(muonSeededStepExtraTask, cms.Task(
0310     muonSeededStepExtraInOutTask ,
0311     muonSeededTracksOutInSelector
0312 ))
0313 
0314 muonSeededStepTask = cms.Task(
0315     earlyMuons,
0316     muonSeededStepCoreTask,
0317     muonSeededStepExtraTask 
0318 )
0319 muonSeededStep = cms.Sequence(muonSeededStepTask) 
0320    
0321     
0322 ##### MODULES FOR DEBUGGING ###############3
0323 muonSeededSeedsInOutAsTracks = cms.EDProducer('FakeTrackProducerFromSeed', src = cms.InputTag('muonSeededSeedsInOut'))
0324 muonSeededSeedsOutInAsTracks = cms.EDProducer('FakeTrackProducerFromSeed', src = cms.InputTag('muonSeededSeedsOutIn'))
0325 muonSeededTrackCandidatesInOutAsTracks = cms.EDProducer('FakeTrackProducerFromCandidate', src = cms.InputTag('muonSeededTrackCandidatesInOut'))
0326 muonSeededTrackCandidatesOutInAsTracks = cms.EDProducer('FakeTrackProducerFromCandidate', src = cms.InputTag('muonSeededTrackCandidatesOutIn'))
0327 muonSeededStepDebugInOutTask = cms.Task(
0328     muonSeededSeedsInOutAsTracks , muonSeededTrackCandidatesInOutAsTracks
0329 )
0330 muonSeededStepDebugInOut = cms.Sequence(muonSeededStepDebugInOutTask)
0331 muonSeededStepDebugTask = cms.Task(
0332     muonSeededSeedsOutInAsTracks , muonSeededTrackCandidatesOutInAsTracks ,
0333     muonSeededStepDebugInOutTask
0334 )
0335 muonSeededStepDebug = cms.Sequence(muonSeededStepDebugTask)