Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:10

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 RecoTracker.PixelSeeding.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
0061 from RecoTracker.PixelSeeding.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
0062 from RecoTracker.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import *
0063 import RecoTracker.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
0064 lowPtQuadStepHitQuadruplets = _caHitQuadrupletEDProducer.clone(
0065     doublets = 'lowPtQuadStepHitDoublets',
0066     extraHitRPhitolerance = _pixelTripletHLTEDProducer.extraHitRPhitolerance,
0067     SeedComparitorPSet = RecoTracker.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 RecoTracker.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.GroupedCkfTrajectoryBuilderIterativeDefault.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.ckfTrackCandidatesIterativeDefault.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.TrackProducerIterativeDefault_cfi
0218 lowPtQuadStepTracks = RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi.TrackProducerIterativeDefault.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 pp_on_AA.toModify(lowPtQuadStep, 
0236         mva         = dict(GBRForestLabel = 'HIMVASelectorLowPtQuadStep_Phase1'),
0237         qualityCuts = [-0.9, -0.4, 0.3],
0238 )
0239 
0240 from RecoTracker.FinalTrackSelectors.trackTfClassifier_cfi import *
0241 from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
0242 from RecoTracker.FinalTrackSelectors.trackSelectionTf_CKF_cfi import *
0243 trackdnn.toReplaceWith(lowPtQuadStep, trackTfClassifier.clone(
0244     src = 'lowPtQuadStepTracks',
0245     qualityCuts = qualityCutDictionary.LowPtQuadStep.value()
0246 ))
0247 highBetaStar_2018.toModify(lowPtQuadStep,qualityCuts = [-0.9,-0.35,-0.15])
0248 fastSim.toModify(lowPtQuadStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0249 
0250 ((~trackingMkFitLowPtQuadStep) & trackdnn).toModify(lowPtQuadStep, mva = dict(tfDnnLabel  = 'trackSelectionTf_CKF'),
0251                                                     qualityCuts = [-0.33,  0.13,  0.35])
0252 
0253 (pp_on_AA & trackdnn).toModify(lowPtQuadStep, qualityCuts =  [-0.35, 0.8, 0.98] )
0254 
0255 # For Phase2PU140
0256 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
0257 lowPtQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0258     src = 'lowPtQuadStepTracks',
0259     trackSelectors = [
0260         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0261             name = 'lowPtQuadStepLoose',
0262             chi2n_par = 2.0,
0263             res_par = ( 0.003, 0.002 ),
0264             minNumberLayers = 3,
0265             maxNumberLostLayers = 2,
0266             minNumber3DLayers = 3,
0267             d0_par1 = ( 0.8, 4.0 ),
0268             dz_par1 = ( 0.7, 4.0 ),
0269             d0_par2 = ( 0.6, 4.0 ),
0270             dz_par2 = ( 0.6, 4.0 )
0271             ), #end of pset
0272         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0273             name = 'lowPtQuadStepTight',
0274             preFilterName = 'lowPtQuadStepLoose',
0275             chi2n_par = 1.4,
0276             res_par = ( 0.003, 0.002 ),
0277             minNumberLayers = 3,
0278             maxNumberLostLayers = 2,
0279             minNumber3DLayers = 3,
0280             d0_par1 = ( 0.7, 4.0 ),
0281             dz_par1 = ( 0.6, 4.0 ),
0282             d0_par2 = ( 0.5, 4.0 ),
0283             dz_par2 = ( 0.5, 4.0 )
0284             ),
0285         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0286             name = 'lowPtQuadStep',
0287             preFilterName = 'lowPtQuadStepTight',
0288             min_eta = -4.0,
0289             max_eta = 4.0,
0290             chi2n_par = 1.2,
0291             res_par = ( 0.003, 0.001 ),
0292             minNumberLayers = 3,
0293             maxNumberLostLayers = 2,
0294             minNumber3DLayers = 3,
0295             d0_par1 = ( 0.5, 4.0 ),
0296             dz_par1 = ( 0.5, 4.0 ),
0297             d0_par2 = ( 0.45, 4.0 ),
0298             dz_par2 = ( 0.45, 4.0 )
0299             ),
0300     ] #end of vpset
0301 ) #end of clone
0302 
0303 
0304 # Final sequence
0305 LowPtQuadStepTask = cms.Task(lowPtQuadStepClusters,
0306                              lowPtQuadStepSeedLayers,
0307                              lowPtQuadStepTrackingRegions,
0308                              lowPtQuadStepHitDoublets,
0309                              lowPtQuadStepHitQuadruplets,
0310                              lowPtQuadStepSeeds,
0311                              lowPtQuadStepTrackCandidates,
0312                              lowPtQuadStepTracks,
0313                              lowPtQuadStep)
0314 LowPtQuadStep = cms.Sequence(LowPtQuadStepTask)
0315 
0316 _LowPtQuadStepTask_trackingMkFit = LowPtQuadStepTask.copy()
0317 _LowPtQuadStepTask_trackingMkFit.add(lowPtQuadStepTrackCandidatesMkFitSeeds, lowPtQuadStepTrackCandidatesMkFit, lowPtQuadStepTrackCandidatesMkFitConfig)
0318 trackingMkFitLowPtQuadStep.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_trackingMkFit)
0319 
0320 _LowPtQuadStepTask_Phase2PU140 = LowPtQuadStepTask.copy()
0321 _LowPtQuadStepTask_Phase2PU140.replace(lowPtQuadStep, lowPtQuadStepSelector)
0322 trackingPhase2PU140.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_Phase2PU140)
0323 
0324 # fast tracking mask producer
0325 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
0326 lowPtQuadStepMasks = maskProducerFromClusterRemover(lowPtQuadStepClusters)
0327 fastSim.toReplaceWith(LowPtQuadStepTask,
0328                       cms.Task(lowPtQuadStepMasks
0329                                ,lowPtQuadStepTrackingRegions
0330                                ,lowPtQuadStepSeeds
0331                                ,lowPtQuadStepTrackCandidates
0332                                ,lowPtQuadStepTracks
0333                                ,lowPtQuadStep
0334                                ) )