Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-22 22:55:56

0001 import FWCore.ParameterSet.Config as cms
0002 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
0003 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0004 
0005 #for dnn classifier
0006 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
0007 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
0008 
0009 # for no-loopers
0010 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
0011 
0012 # NEW CLUSTERS (remove previously used clusters)
0013 lowPtQuadStepClusters = _cfg.clusterRemoverForIter('LowPtQuadStep')
0014 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
0015     _era.toReplaceWith(lowPtQuadStepClusters, _cfg.clusterRemoverForIter('LowPtQuadStep', _eraName, _postfix))
0016 
0017 
0018 # SEEDING LAYERS
0019 import RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi
0020 lowPtQuadStepSeedLayers = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.clone(
0021     BPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters')),
0022     FPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters'))
0023 )
0024 
0025 # TrackingRegion
0026 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
0027 lowPtQuadStepTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
0028     ptMin        = 0.15,
0029     originRadius = 0.02,
0030     nSigmaZ      = 4.0 )
0031 )
0032 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
0033 trackingPhase2PU140.toModify(lowPtQuadStepTrackingRegions, RegionPSet = dict(ptMin = 0.35,originRadius = 0.025))
0034 
0035 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
0036 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0037 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
0038 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(lowPtQuadStepTrackingRegions, 
0039                 _globalTrackingRegionWithVertices.clone(RegionPSet=dict(
0040                     fixedError   = 0.5,
0041                     ptMin        = 0.49,
0042                     originRadius = 0.02 )
0043                 )
0044 )
0045 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
0046 highBetaStar_2018.toModify(lowPtQuadStepTrackingRegions,RegionPSet = dict(
0047      ptMin        = 0.05,
0048      originRadius = 0.2, )
0049 )
0050 
0051 # seeding
0052 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
0053 lowPtQuadStepHitDoublets = _hitPairEDProducer.clone(
0054     seedingLayers   = 'lowPtQuadStepSeedLayers',
0055     trackingRegions = 'lowPtQuadStepTrackingRegions',
0056     layerPairs      = [0,1,2], # layer pairs (0,1), (1,2), (2,3)
0057     maxElement      = 50000000,
0058     produceIntermediateHitDoublets = True,
0059 )
0060 from RecoPixelVertexing.PixelTriplets.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
0061 from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
0062 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import *
0063 import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
0064 lowPtQuadStepHitQuadruplets = _caHitQuadrupletEDProducer.clone(
0065     doublets = 'lowPtQuadStepHitDoublets',
0066     extraHitRPhitolerance = _pixelTripletHLTEDProducer.extraHitRPhitolerance,
0067     SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(),
0068     maxChi2 = dict(
0069         pt1    = 0.7, pt2    = 2,
0070         value1 = 1000, value2 = 150,
0071     ),
0072     useBendingCorrection = True,
0073     fitFastCircle        = True,
0074     fitFastCircleChi2Cut = True,
0075     CAThetaCut           = 0.0017,
0076     CAPhiCut             = 0.3,
0077 )
0078 trackingPhase2PU140.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0015,CAPhiCut = 0.25)
0079 highBetaStar_2018.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0034,CAPhiCut = 0.6)
0080 
0081 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
0082 lowPtQuadStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
0083     seedingHitSets = 'lowPtQuadStepHitQuadruplets',
0084 )
0085 
0086 #For FastSim phase1 tracking
0087 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
0088 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
0089 _fastSim_lowPtQuadStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
0090     trackingRegions = 'lowPtQuadStepTrackingRegions',
0091     hitMasks        = cms.InputTag('lowPtQuadStepMasks'),
0092     seedFinderSelector = dict( CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(lowPtQuadStepHitQuadruplets).clone(
0093             SeedComparitorPSet = dict(ComponentName = 'none')),
0094                                layerList = lowPtQuadStepSeedLayers.layerList.value(),
0095                                #new parameters required for phase1 seeding
0096                                BPix      = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
0097                                FPix      = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
0098                                layerPairs = lowPtQuadStepHitDoublets.layerPairs.value()
0099                                )
0100 )
0101 fastSim.toReplaceWith(lowPtQuadStepSeeds,_fastSim_lowPtQuadStepSeeds)
0102 
0103 # QUALITY CUTS DURING TRACK BUILDING
0104 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
0105 _lowPtQuadStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
0106     minimumNumberOfHits = 3,
0107     minPt               = 0.075,
0108 )
0109 lowPtQuadStepTrajectoryFilterBase = _lowPtQuadStepTrajectoryFilterBase.clone(
0110     maxCCCLostHits     = 0,
0111     minGoodStripCharge = dict(refToPSet_ = 'SiStripClusterChargeCutLoose')
0112 )
0113 trackingPhase2PU140.toReplaceWith(lowPtQuadStepTrajectoryFilterBase, _lowPtQuadStepTrajectoryFilterBase)
0114 
0115 (pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtQuadStepTrajectoryFilterBase, minPt=0.49)
0116 
0117 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeTrajectoryFilter_cfi import *
0118 # Composite filter
0119 lowPtQuadStepTrajectoryFilter = _TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone(
0120     filters = [cms.PSet(refToPSet_ = cms.string('lowPtQuadStepTrajectoryFilterBase'))]
0121 )
0122 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryFilter,
0123     filters = lowPtQuadStepTrajectoryFilter.filters.value() + [cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
0124 )
0125 
0126 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
0127 lowPtQuadStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
0128     ComponentName    = 'lowPtQuadStepChi2Est',
0129     nSigma           = 3.0,
0130     MaxChi2          = 9.0,
0131     clusterChargeCut = dict(refToPSet_ = ('SiStripClusterChargeCutTight')),
0132 )
0133 trackingPhase2PU140.toModify(lowPtQuadStepChi2Est,
0134     MaxChi2          = 16.0,
0135     clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone')
0136 )
0137 
0138 # TRACK BUILDING
0139 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
0140 lowPtQuadStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
0141     trajectoryFilter       = dict(refToPSet_ = 'lowPtQuadStepTrajectoryFilter'),
0142     maxCand                = 4,
0143     estimator              = 'lowPtQuadStepChi2Est',
0144     maxDPhiForLooperReconstruction = 2.0,
0145     # 0.63 GeV is the maximum pT for a charged particle to loop within the 1.1m radius
0146     # of the outermost Tracker barrel layer (with B=3.8T)
0147     maxPtForLooperReconstruction = 0.7,
0148 )
0149 trackingNoLoopers.toModify(lowPtQuadStepTrajectoryBuilder,
0150                            maxPtForLooperReconstruction = 0.0)
0151 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryBuilder,
0152     minNrOfHitsForRebuild      = 1,
0153     keepOriginalIfRebuildFails = True,
0154 )
0155 
0156 
0157 # MAKING OF TRACK CANDIDATES
0158 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits
0159 lowPtQuadStepTrajectoryCleanerBySharedHits = _trajectoryCleanerBySharedHits.clone(
0160     ComponentName       = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
0161     fractionShared      = 0.16,
0162     allowSharedFirstHit = True
0163 )
0164 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryCleanerBySharedHits, fractionShared = 0.09)
0165 
0166 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0167 lowPtQuadStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0168     src = 'lowPtQuadStepSeeds',
0169     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0170     numHitsForSeedCleaner       = 50,
0171     onlyPixelHitsForSeedCleaner = True,
0172     TrajectoryBuilderPSet       = dict(refToPSet_ = 'lowPtQuadStepTrajectoryBuilder'),
0173     TrajectoryCleaner           = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
0174     clustersToSkip              = 'lowPtQuadStepClusters',
0175     doSeedingRegionRebuilding   = True,
0176     useHitsSplitting            = True,
0177 )
0178 trackingPhase2PU140.toModify(lowPtQuadStepTrackCandidates,
0179     clustersToSkip       = '',
0180     phase2clustersToSkip = 'lowPtQuadStepClusters'
0181 )
0182 
0183 from Configuration.ProcessModifiers.trackingMkFitLowPtQuadStep_cff import trackingMkFitLowPtQuadStep
0184 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
0185 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
0186 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
0187 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
0188 lowPtQuadStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
0189     seeds = 'lowPtQuadStepSeeds',
0190 )
0191 lowPtQuadStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
0192     ComponentName = 'lowPtQuadStepTrackCandidatesMkFitConfig',
0193     config = 'RecoTracker/MkFit/data/mkfit-phase1-lowPtQuadStep.json',
0194 )
0195 lowPtQuadStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
0196     seeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
0197     config = ('', 'lowPtQuadStepTrackCandidatesMkFitConfig'),
0198     clustersToSkip = 'lowPtQuadStepClusters',
0199 )
0200 trackingMkFitLowPtQuadStep.toReplaceWith(lowPtQuadStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
0201     seeds = 'lowPtQuadStepSeeds',
0202     mkFitSeeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
0203     tracks = 'lowPtQuadStepTrackCandidatesMkFit',
0204 ))
0205 (pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtQuadStepTrackCandidatesMkFitConfig, minPt=0.49)
0206 
0207 #For FastSim phase1 tracking
0208 import FastSimulation.Tracking.TrackCandidateProducer_cfi
0209 _fastSim_lowPtQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
0210     src                      = 'lowPtQuadStepSeeds',
0211     MinNumberOfCrossedLayers = 3,
0212     hitMasks                 = cms.InputTag('lowPtQuadStepMasks')
0213 )
0214 fastSim.toReplaceWith(lowPtQuadStepTrackCandidates,_fastSim_lowPtQuadStepTrackCandidates)
0215 
0216 # TRACK FITTING
0217 import RecoTracker.TrackProducer.TrackProducer_cfi
0218 lowPtQuadStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0219     src           = 'lowPtQuadStepTrackCandidates',
0220     AlgorithmName = 'lowPtQuadStep',
0221     Fitter        = 'FlexibleKFFittingSmoother',
0222 )
0223 fastSim.toModify(lowPtQuadStepTracks,TTRHBuilder = 'WithoutRefit')
0224 
0225 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0226 phase2_timing_layer.toModify(lowPtQuadStepTracks, TrajectoryInEvent = True)
0227 
0228 # Final selection
0229 from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import *
0230 lowPtQuadStep = TrackMVAClassifierPrompt.clone(
0231      mva         = dict(GBRForestLabel = 'MVASelectorLowPtQuadStep_Phase1'),
0232      src         = 'lowPtQuadStepTracks',
0233      qualityCuts = [-0.7,-0.35,-0.15]
0234 )
0235 
0236 from RecoTracker.FinalTrackSelectors.trackTfClassifier_cfi import *
0237 from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
0238 from RecoTracker.FinalTrackSelectors.trackSelectionTf_CKF_cfi import *
0239 trackdnn.toReplaceWith(lowPtQuadStep, trackTfClassifier.clone(
0240     src = 'lowPtQuadStepTracks',
0241     qualityCuts = qualityCutDictionary.LowPtQuadStep.value()
0242 ))
0243 highBetaStar_2018.toModify(lowPtQuadStep,qualityCuts = [-0.9,-0.35,-0.15])
0244 pp_on_AA.toModify(lowPtQuadStep, 
0245         mva         = dict(GBRForestLabel = 'HIMVASelectorLowPtQuadStep_Phase1'),
0246         qualityCuts = [-0.9, -0.4, 0.3],
0247 )
0248 fastSim.toModify(lowPtQuadStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0249 
0250 # For Phase2PU140
0251 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
0252 lowPtQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0253     src = 'lowPtQuadStepTracks',
0254     trackSelectors = [
0255         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0256             name = 'lowPtQuadStepLoose',
0257             chi2n_par = 2.0,
0258             res_par = ( 0.003, 0.002 ),
0259             minNumberLayers = 3,
0260             maxNumberLostLayers = 2,
0261             minNumber3DLayers = 3,
0262             d0_par1 = ( 0.8, 4.0 ),
0263             dz_par1 = ( 0.7, 4.0 ),
0264             d0_par2 = ( 0.6, 4.0 ),
0265             dz_par2 = ( 0.6, 4.0 )
0266             ), #end of pset
0267         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0268             name = 'lowPtQuadStepTight',
0269             preFilterName = 'lowPtQuadStepLoose',
0270             chi2n_par = 1.4,
0271             res_par = ( 0.003, 0.002 ),
0272             minNumberLayers = 3,
0273             maxNumberLostLayers = 2,
0274             minNumber3DLayers = 3,
0275             d0_par1 = ( 0.7, 4.0 ),
0276             dz_par1 = ( 0.6, 4.0 ),
0277             d0_par2 = ( 0.5, 4.0 ),
0278             dz_par2 = ( 0.5, 4.0 )
0279             ),
0280         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0281             name = 'lowPtQuadStep',
0282             preFilterName = 'lowPtQuadStepTight',
0283             min_eta = -4.0,
0284             max_eta = 4.0,
0285             chi2n_par = 1.2,
0286             res_par = ( 0.003, 0.001 ),
0287             minNumberLayers = 3,
0288             maxNumberLostLayers = 2,
0289             minNumber3DLayers = 3,
0290             d0_par1 = ( 0.5, 4.0 ),
0291             dz_par1 = ( 0.5, 4.0 ),
0292             d0_par2 = ( 0.45, 4.0 ),
0293             dz_par2 = ( 0.45, 4.0 )
0294             ),
0295     ] #end of vpset
0296 ) #end of clone
0297 
0298 
0299 # Final sequence
0300 LowPtQuadStepTask = cms.Task(lowPtQuadStepClusters,
0301                              lowPtQuadStepSeedLayers,
0302                              lowPtQuadStepTrackingRegions,
0303                              lowPtQuadStepHitDoublets,
0304                              lowPtQuadStepHitQuadruplets,
0305                              lowPtQuadStepSeeds,
0306                              lowPtQuadStepTrackCandidates,
0307                              lowPtQuadStepTracks,
0308                              lowPtQuadStep)
0309 LowPtQuadStep = cms.Sequence(LowPtQuadStepTask)
0310 
0311 _LowPtQuadStepTask_trackingMkFit = LowPtQuadStepTask.copy()
0312 _LowPtQuadStepTask_trackingMkFit.add(lowPtQuadStepTrackCandidatesMkFitSeeds, lowPtQuadStepTrackCandidatesMkFit, lowPtQuadStepTrackCandidatesMkFitConfig)
0313 trackingMkFitLowPtQuadStep.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_trackingMkFit)
0314 
0315 _LowPtQuadStepTask_Phase2PU140 = LowPtQuadStepTask.copy()
0316 _LowPtQuadStepTask_Phase2PU140.replace(lowPtQuadStep, lowPtQuadStepSelector)
0317 trackingPhase2PU140.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_Phase2PU140)
0318 
0319 # fast tracking mask producer
0320 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
0321 lowPtQuadStepMasks = maskProducerFromClusterRemover(lowPtQuadStepClusters)
0322 fastSim.toReplaceWith(LowPtQuadStepTask,
0323                       cms.Task(lowPtQuadStepMasks
0324                                ,lowPtQuadStepTrackingRegions
0325                                ,lowPtQuadStepSeeds
0326                                ,lowPtQuadStepTrackCandidates
0327                                ,lowPtQuadStepTracks
0328                                ,lowPtQuadStep
0329                                ) )