Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
0003 
0004 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0005 
0006 #for dnn classifier
0007 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
0008 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
0009 
0010 # for no-loopers
0011 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
0012 
0013 ###############################################################
0014 # Large impact parameter Tracking using mixed-triplet seeding #
0015 ###############################################################
0016 
0017 #here just for backward compatibility
0018 chargeCut2069Clusters =  cms.EDProducer('ClusterChargeMasker',
0019     oldClusterRemovalInfo = cms.InputTag(''), # to be set below
0020     pixelClusters = cms.InputTag('siPixelClusters'),
0021     stripClusters = cms.InputTag('siStripClusters'),
0022     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
0023 )
0024 
0025 mixedTripletStepClusters = _cfg.clusterRemoverForIter('MixedTripletStep')
0026 chargeCut2069Clusters.oldClusterRemovalInfo = mixedTripletStepClusters.oldClusterRemovalInfo.value()
0027 mixedTripletStepClusters.oldClusterRemovalInfo = 'chargeCut2069Clusters'
0028 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
0029     _era.toReplaceWith(mixedTripletStepClusters, _cfg.clusterRemoverForIter('MixedTripletStep', _eraName, _postfix))
0030 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
0031 trackingPhase1.toModify(chargeCut2069Clusters, oldClusterRemovalInfo = mixedTripletStepClusters.oldClusterRemovalInfo.value())
0032 trackingPhase1.toModify(mixedTripletStepClusters, oldClusterRemovalInfo='chargeCut2069Clusters')
0033 
0034 # SEEDING LAYERS
0035 from RecoLocalTracker.SiStripClusterizer.SiStripClusterChargeCut_cfi import *
0036 from RecoTracker.IterativeTracking.DetachedTripletStep_cff import detachedTripletStepSeedLayers
0037 import RecoTracker.TkSeedingLayers.seedingLayersEDProducer_cfi as _mod
0038 mixedTripletStepSeedLayersA = _mod.seedingLayersEDProducer.clone(
0039      layerList = ['BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg'],
0040 #    layerList = ['BPix1+BPix2+BPix3', 
0041 #        'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg', 
0042 #        'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg', 
0043 #        'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg'],
0044     BPix = dict(
0045         TTRHBuilder = cms.string('WithTrackAngle'),
0046         HitProducer = cms.string('siPixelRecHits'),
0047         skipClusters = cms.InputTag('mixedTripletStepClusters')
0048     ),
0049     FPix = dict(
0050         TTRHBuilder = cms.string('WithTrackAngle'),
0051         HitProducer = cms.string('siPixelRecHits'),
0052         skipClusters = cms.InputTag('mixedTripletStepClusters')
0053     ),
0054     TEC = dict(
0055         matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0056         useRingSlector = cms.bool(True),
0057         TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0058         minRing = cms.int32(1),
0059         maxRing = cms.int32(1),
0060         skipClusters = cms.InputTag('mixedTripletStepClusters')
0061     )
0062 )
0063 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
0064 trackingLowPU.toModify(mixedTripletStepSeedLayersA,
0065     layerList = [
0066         'BPix1+BPix2+BPix3',
0067         'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
0068         'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg',
0069         'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg',
0070         'FPix1_pos+FPix2_pos+TEC1_pos', 'FPix1_neg+FPix2_neg+TEC1_neg',
0071         'FPix2_pos+TEC2_pos+TEC3_pos', 'FPix2_neg+TEC2_neg+TEC3_neg'
0072     ],
0073     TEC = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
0074 )
0075 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
0076 highBetaStar_2018.toModify(mixedTripletStepSeedLayersA,
0077     layerList = [
0078         'BPix1+BPix2+BPix3',
0079         'BPix1+FPix1_pos+FPix2_pos','BPix1+FPix1_neg+FPix2_neg',
0080         'BPix2+FPix1_pos+FPix2_pos','BPix2+FPix1_neg+FPix2_neg',
0081         'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
0082         'BPix1+BPix2+FPix2_pos', 'BPix1+BPix2+FPix2_neg'
0083     ]
0084 )
0085 
0086 
0087 # TrackingRegion
0088 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpotFixedZ_cfi import globalTrackingRegionFromBeamSpotFixedZ as _globalTrackingRegionFromBeamSpotFixedZ
0089 _mixedTripletStepTrackingRegionsCommon = _globalTrackingRegionFromBeamSpotFixedZ.clone(RegionPSet = dict(
0090     ptMin            = 0.4,
0091     originHalfLength = 15.0,
0092     originRadius     = 1.5
0093 ))
0094 trackingLowPU.toModify(_mixedTripletStepTrackingRegionsCommon, RegionPSet = dict(originHalfLength = 10.0))
0095 highBetaStar_2018.toModify(_mixedTripletStepTrackingRegionsCommon,RegionPSet = dict(
0096      ptMin        = 0.05,
0097      originRadius = 0.2
0098 ))
0099 
0100 mixedTripletStepTrackingRegionsA = _mixedTripletStepTrackingRegionsCommon.clone()
0101 
0102 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
0103 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0104 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
0105 _mixedTripletStepTrackingRegionsCommon_pp_on_HI = _globalTrackingRegionWithVertices.clone(
0106                 RegionPSet=dict(
0107                     fixedError             = 3.75,
0108                     ptMin                  = 0.4,
0109                     originRadius           = 1.5,
0110                     originRScaling4BigEvts = True,
0111                     ptMinScaling4BigEvts   = True,
0112                     minOriginR             = 0.,
0113                     maxPtMin               = 0.7,
0114                     scalingStartNPix       = 20000,
0115                     scalingEndNPix         = 35000
0116                 )
0117 )
0118 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(mixedTripletStepTrackingRegionsA,_mixedTripletStepTrackingRegionsCommon_pp_on_HI)
0119 
0120 
0121 # seeding
0122 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import ClusterShapeHitFilterESProducer as _ClusterShapeHitFilterESProducer
0123 mixedTripletStepClusterShapeHitFilter  = _ClusterShapeHitFilterESProducer.clone(
0124     ComponentName    = 'mixedTripletStepClusterShapeHitFilter',
0125     clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
0126 )
0127 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
0128 mixedTripletStepHitDoubletsA = _hitPairEDProducer.clone(
0129     seedingLayers   = 'mixedTripletStepSeedLayersA',
0130     trackingRegions = 'mixedTripletStepTrackingRegionsA',
0131     maxElement      = 50000000,
0132     produceIntermediateHitDoublets = True,
0133 )
0134 from RecoPixelVertexing.PixelTriplets.pixelTripletLargeTipEDProducer_cfi import pixelTripletLargeTipEDProducer as _pixelTripletLargeTipEDProducer
0135 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import *
0136 mixedTripletStepHitTripletsA = _pixelTripletLargeTipEDProducer.clone(
0137     doublets              = 'mixedTripletStepHitDoubletsA',
0138     produceSeedingHitSets = True,
0139 )
0140 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
0141 _mixedTripletStepSeedsACommon = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
0142     seedingHitSets     = 'mixedTripletStepHitTripletsA',
0143     SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
0144         ComponentName = 'PixelClusterShapeSeedComparitor',
0145         FilterAtHelixStage = cms.bool(False),
0146         FilterPixelHits = cms.bool(True),
0147         FilterStripHits = cms.bool(True),
0148         ClusterShapeHitFilterName = cms.string('mixedTripletStepClusterShapeHitFilter'),
0149         ClusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCache')
0150     ),
0151 )
0152 trackingLowPU.toModify(_mixedTripletStepSeedsACommon,
0153     SeedComparitorPSet = dict(ClusterShapeHitFilterName = 'ClusterShapeHitFilter')
0154 )
0155 mixedTripletStepSeedsA = _mixedTripletStepSeedsACommon.clone()
0156 
0157 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
0158 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
0159 _fastSim_mixedTripletStepSeedsA = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
0160     trackingRegions = 'mixedTripletStepTrackingRegionsA',
0161     hitMasks        = cms.InputTag('mixedTripletStepMasks'),
0162     seedFinderSelector = dict(pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(mixedTripletStepHitTripletsA),
0163                               layerList = mixedTripletStepSeedLayersA.layerList.value())
0164 )
0165 fastSim.toReplaceWith(mixedTripletStepSeedsA,_fastSim_mixedTripletStepSeedsA)
0166 
0167 # SEEDING LAYERS
0168 mixedTripletStepSeedLayersB = _mod.seedingLayersEDProducer.clone(
0169     layerList = ['BPix2+BPix3+TIB1'],
0170     BPix = dict(
0171         TTRHBuilder = cms.string('WithTrackAngle'),
0172         HitProducer = cms.string('siPixelRecHits'),
0173         skipClusters = cms.InputTag('mixedTripletStepClusters')
0174     ),
0175     TIB = dict(
0176         matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0177         TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0178         skipClusters = cms.InputTag('mixedTripletStepClusters')
0179     )
0180 )
0181 trackingLowPU.toModify(mixedTripletStepSeedLayersB,
0182     layerList = ['BPix2+BPix3+TIB1', 'BPix2+BPix3+TIB2'],
0183     TIB = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
0184 )
0185 trackingPhase1.toModify(mixedTripletStepSeedLayersB, layerList = ['BPix3+BPix4+TIB1'])
0186 
0187 # TrackingRegion
0188 mixedTripletStepTrackingRegionsB = _mixedTripletStepTrackingRegionsCommon.clone(RegionPSet = dict(ptMin=0.6, originHalfLength=10.0))
0189 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(mixedTripletStepTrackingRegionsB, 
0190                 _mixedTripletStepTrackingRegionsCommon_pp_on_HI.clone(RegionPSet=dict(
0191                     fixedError = 2.5,
0192                     ptMin      = 0.6,)
0193                 )
0194 )
0195 highBetaStar_2018.toReplaceWith(mixedTripletStepTrackingRegionsB, _mixedTripletStepTrackingRegionsCommon.clone())
0196 
0197 # seeding
0198 mixedTripletStepHitDoubletsB = mixedTripletStepHitDoubletsA.clone(
0199     seedingLayers   = 'mixedTripletStepSeedLayersB',
0200     trackingRegions = 'mixedTripletStepTrackingRegionsB',
0201 )
0202 mixedTripletStepHitTripletsB = mixedTripletStepHitTripletsA.clone(doublets = 'mixedTripletStepHitDoubletsB')
0203 mixedTripletStepSeedsB = _mixedTripletStepSeedsACommon.clone(seedingHitSets = 'mixedTripletStepHitTripletsB')
0204 #fastsim
0205 _fastSim_mixedTripletStepSeedsB = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
0206     trackingRegions = 'mixedTripletStepTrackingRegionsB',
0207     hitMasks        = cms.InputTag('mixedTripletStepMasks'),
0208     seedFinderSelector = dict(pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(mixedTripletStepHitTripletsB),
0209                               layerList = mixedTripletStepSeedLayersB.layerList.value())
0210 )
0211 fastSim.toReplaceWith(mixedTripletStepSeedsB,_fastSim_mixedTripletStepSeedsB)
0212 
0213 
0214 import RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi
0215 mixedTripletStepSeeds = RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi.globalCombinedSeeds.clone(
0216     seedCollections = ['mixedTripletStepSeedsA',
0217                        'mixedTripletStepSeedsB']
0218 )
0219 # QUALITY CUTS DURING TRACK BUILDING
0220 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff
0221 _mixedTripletStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
0222 #    maxLostHits = 0,
0223     minimumNumberOfHits = 3,
0224     minPt               = 0.1
0225 )
0226 highBetaStar_2018.toModify(_mixedTripletStepTrajectoryFilterBase,minPt = 0.05)
0227 
0228 mixedTripletStepTrajectoryFilter = _mixedTripletStepTrajectoryFilterBase.clone(
0229     constantValueForLostHitsFractionFilter = 1.4,
0230 )
0231 trackingLowPU.toReplaceWith(mixedTripletStepTrajectoryFilter, _mixedTripletStepTrajectoryFilterBase.clone(
0232     maxLostHits = 0,
0233 ))
0234 
0235 (pp_on_XeXe_2017 | pp_on_AA).toModify(mixedTripletStepTrajectoryFilter, minPt=0.4)
0236 
0237 # Propagator taking into account momentum uncertainty in multiple scattering calculation.
0238 import TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff
0239 import TrackingTools.MaterialEffects.MaterialPropagator_cfi
0240 mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone(
0241 #mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.MaterialPropagatorParabolicMF.clone(
0242     ComponentName = 'mixedTripletStepPropagator',
0243     ptMin         = 0.1
0244 )
0245 for e in [pp_on_XeXe_2017, pp_on_AA]:
0246     e.toModify(mixedTripletStepPropagator, ptMin=0.4)
0247 highBetaStar_2018.toModify(mixedTripletStepPropagator,ptMin = 0.05)
0248 
0249 import TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi
0250 mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi.OppositeMaterialPropagator.clone(
0251 #mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.OppositeMaterialPropagatorParabolicMF.clone(
0252     ComponentName = 'mixedTripletStepPropagatorOpposite',
0253     ptMin         = 0.1
0254 )
0255 for e in [pp_on_XeXe_2017, pp_on_AA]:
0256     e.toModify(mixedTripletStepPropagatorOpposite, ptMin=0.4)
0257 highBetaStar_2018.toModify(mixedTripletStepPropagatorOpposite,ptMin = 0.05)
0258 
0259 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
0260 mixedTripletStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
0261     ComponentName    = 'mixedTripletStepChi2Est',
0262     nSigma           = 3.0,
0263     MaxChi2          = 16.0,
0264     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
0265 )
0266 trackingLowPU.toModify(mixedTripletStepChi2Est,
0267     clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')
0268 )
0269 
0270 # TRACK BUILDING
0271 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
0272 mixedTripletStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
0273     trajectoryFilter       = dict(refToPSet_ = 'mixedTripletStepTrajectoryFilter'),
0274     propagatorAlong        = 'mixedTripletStepPropagator',
0275     propagatorOpposite     = 'mixedTripletStepPropagatorOpposite',
0276     maxCand                = 2,
0277     estimator              = 'mixedTripletStepChi2Est',
0278     maxDPhiForLooperReconstruction = 2.0,
0279     maxPtForLooperReconstruction = 0.7,
0280 )
0281 trackingNoLoopers.toModify(mixedTripletStepTrajectoryBuilder,
0282                            maxPtForLooperReconstruction = 0.0)
0283 # MAKING OF TRACK CANDIDATES
0284 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0285 # Give handle for CKF for HI
0286 _mixedTripletStepTrackCandidatesCkf = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0287     src            = 'mixedTripletStepSeeds',
0288     clustersToSkip = 'mixedTripletStepClusters',
0289     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0290     numHitsForSeedCleaner     = 50,
0291     #onlyPixelHitsForSeedCleaner = True,
0292     TrajectoryBuilderPSet     = dict(refToPSet_ = 'mixedTripletStepTrajectoryBuilder'),
0293     doSeedingRegionRebuilding = True,
0294     useHitsSplitting          = True,
0295     TrajectoryCleaner         = 'mixedTripletStepTrajectoryCleanerBySharedHits',
0296 )
0297 mixedTripletStepTrackCandidates = _mixedTripletStepTrackCandidatesCkf.clone()
0298 
0299 from Configuration.ProcessModifiers.trackingMkFitMixedTripletStep_cff import trackingMkFitMixedTripletStep
0300 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
0301 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
0302 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
0303 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
0304 mixedTripletStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
0305     seeds = 'mixedTripletStepSeeds',
0306 )
0307 mixedTripletStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
0308     ComponentName = 'mixedTripletStepTrackCandidatesMkFitConfig',
0309     config = 'RecoTracker/MkFit/data/mkfit-phase1-mixedTripletStep.json',
0310 )
0311 mixedTripletStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
0312     seeds = 'mixedTripletStepTrackCandidatesMkFitSeeds',
0313     config = ('', 'mixedTripletStepTrackCandidatesMkFitConfig'),
0314     clustersToSkip = 'mixedTripletStepClusters',
0315 )
0316 trackingMkFitMixedTripletStep.toReplaceWith(mixedTripletStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
0317     seeds = 'mixedTripletStepSeeds',
0318     mkFitSeeds = 'mixedTripletStepTrackCandidatesMkFitSeeds',
0319     tracks = 'mixedTripletStepTrackCandidatesMkFit',
0320 ))
0321 (pp_on_XeXe_2017 | pp_on_AA).toModify(mixedTripletStepTrackCandidatesMkFitConfig, minPt=0.4)
0322 
0323 import FastSimulation.Tracking.TrackCandidateProducer_cfi
0324 fastSim.toReplaceWith(mixedTripletStepTrackCandidates,
0325                       FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
0326         src = 'mixedTripletStepSeeds',
0327         MinNumberOfCrossedLayers = 3,
0328         hitMasks = cms.InputTag('mixedTripletStepMasks'),
0329         )
0330 )
0331 
0332 
0333 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
0334 mixedTripletStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
0335         ComponentName       = 'mixedTripletStepTrajectoryCleanerBySharedHits',
0336         fractionShared      = 0.11,
0337         allowSharedFirstHit = True
0338 )
0339 trackingLowPU.toModify(mixedTripletStepTrajectoryCleanerBySharedHits, fractionShared = 0.19)
0340 
0341 
0342 # TRACK FITTING
0343 import RecoTracker.TrackProducer.TrackProducer_cfi
0344 mixedTripletStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0345     AlgorithmName = 'mixedTripletStep',
0346     src           = 'mixedTripletStepTrackCandidates',
0347     Fitter        = 'FlexibleKFFittingSmoother'
0348 )
0349 fastSim.toModify(mixedTripletStepTracks, TTRHBuilder = 'WithoutRefit')
0350 
0351 # TRACK SELECTION AND QUALITY FLAG SETTING.
0352 from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import *
0353 from RecoTracker.FinalTrackSelectors.TrackMVAClassifierDetached_cfi import *
0354 mixedTripletStepClassifier1 = TrackMVAClassifierDetached.clone(
0355      src         = 'mixedTripletStepTracks',
0356      mva         = dict(GBRForestLabel = 'MVASelectorIter4_13TeV'),
0357      qualityCuts = [-0.5,0.0,0.5]
0358 )
0359 fastSim.toModify(mixedTripletStepClassifier1, vertices = 'firstStepPrimaryVerticesBeforeMixing')
0360 
0361 mixedTripletStepClassifier2 = TrackMVAClassifierPrompt.clone(
0362     src         = 'mixedTripletStepTracks',
0363     mva         = dict(GBRForestLabel = 'MVASelectorIter0_13TeV'),
0364     qualityCuts = [-0.2,-0.2,-0.2]
0365 )
0366 fastSim.toModify(mixedTripletStepClassifier2,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0367 
0368 from RecoTracker.FinalTrackSelectors.ClassifierMerger_cfi import *
0369 mixedTripletStep = ClassifierMerger.clone(
0370     inputClassifiers=['mixedTripletStepClassifier1','mixedTripletStepClassifier2']
0371 )
0372 trackingPhase1.toReplaceWith(mixedTripletStep, mixedTripletStepClassifier1.clone(
0373     mva = dict(GBRForestLabel = 'MVASelectorMixedTripletStep_Phase1'),
0374     qualityCuts = [-0.5,0.0,0.5]
0375 ))
0376 
0377 from RecoTracker.FinalTrackSelectors.trackTfClassifier_cfi import *
0378 from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
0379 from RecoTracker.FinalTrackSelectors.trackSelectionTf_CKF_cfi import *
0380 trackdnn.toReplaceWith(mixedTripletStep, trackTfClassifier.clone(
0381     src = 'mixedTripletStepTracks',
0382     qualityCuts = qualityCutDictionary.MixedTripletStep.value()
0383 ))
0384 (trackdnn & fastSim).toModify(mixedTripletStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0385 
0386 highBetaStar_2018.toModify(mixedTripletStep,qualityCuts = [-0.7,0.0,0.5])
0387 pp_on_AA.toModify(mixedTripletStep, qualityCuts = [-0.5,0.0,0.9])
0388 
0389 # For LowPU
0390 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
0391 mixedTripletStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0392     src            = 'mixedTripletStepTracks',
0393     useAnyMVA      = cms.bool(False),
0394     GBRForestLabel = cms.string('MVASelectorIter4'),
0395     trackSelectors = [
0396         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0397             name = 'mixedTripletStepVtxLoose',
0398             chi2n_par = 1.2,
0399             res_par = ( 0.003, 0.001 ),
0400             minNumberLayers = 3,
0401             maxNumberLostLayers = 1,
0402             minNumber3DLayers = 2,
0403             d0_par1 = ( 1.2, 3.0 ),
0404             dz_par1 = ( 1.2, 3.0 ),
0405             d0_par2 = ( 1.3, 3.0 ),
0406             dz_par2 = ( 1.3, 3.0 )
0407         ),
0408         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0409             name = 'mixedTripletStepTrkLoose',
0410             chi2n_par = 0.6,
0411             res_par = ( 0.003, 0.001 ),
0412             minNumberLayers = 4,
0413             maxNumberLostLayers = 1,
0414             minNumber3DLayers = 3,
0415             d0_par1 = ( 1.2, 4.0 ),
0416             dz_par1 = ( 1.2, 4.0 ),
0417             d0_par2 = ( 1.2, 4.0 ),
0418             dz_par2 = ( 1.2, 4.0 )
0419         ),
0420         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0421             name = 'mixedTripletStepVtxTight',
0422             preFilterName = 'mixedTripletStepVtxLoose',
0423             chi2n_par = 0.6,
0424             res_par = ( 0.003, 0.001 ),
0425             minNumberLayers = 3,
0426             maxNumberLostLayers = 1,
0427             minNumber3DLayers = 3,
0428             d0_par1 = ( 1.1, 3.0 ),
0429             dz_par1 = ( 1.1, 3.0 ),
0430             d0_par2 = ( 1.2, 3.0 ),
0431             dz_par2 = ( 1.2, 3.0 )
0432         ),
0433         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0434             name = 'mixedTripletStepTrkTight',
0435             preFilterName = 'mixedTripletStepTrkLoose',
0436             chi2n_par = 0.4,
0437             res_par = ( 0.003, 0.001 ),
0438             minNumberLayers = 5,
0439             maxNumberLostLayers = 1,
0440             minNumber3DLayers = 4,
0441             d0_par1 = ( 1.1, 4.0 ),
0442             dz_par1 = ( 1.1, 4.0 ),
0443             d0_par2 = ( 1.1, 4.0 ),
0444             dz_par2 = ( 1.1, 4.0 )
0445         ),
0446         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0447             name = 'mixedTripletStepVtx',
0448             preFilterName = 'mixedTripletStepVtxTight',
0449             chi2n_par = 0.4,
0450             res_par = ( 0.003, 0.001 ),
0451             minNumberLayers = 3,
0452             maxNumberLostLayers = 1,
0453             minNumber3DLayers = 3,
0454             d0_par1 = ( 1.1, 3.0 ),
0455             dz_par1 = ( 1.1, 3.0 ),
0456             d0_par2 = ( 1.2, 3.0 ),
0457             dz_par2 = ( 1.2, 3.0 )
0458         ),
0459         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0460             name = 'mixedTripletStepTrk',
0461             preFilterName = 'mixedTripletStepTrkTight',
0462             chi2n_par = 0.3,
0463             res_par = ( 0.003, 0.001 ),
0464             minNumberLayers = 5,
0465             maxNumberLostLayers = 0,
0466             minNumber3DLayers = 4,
0467             d0_par1 = ( 0.9, 4.0 ),
0468             dz_par1 = ( 0.9, 4.0 ),
0469             d0_par2 = ( 0.9, 4.0 ),
0470             dz_par2 = ( 0.9, 4.0 )
0471         )
0472     ] #end of vpset
0473 ) #end of clone
0474 
0475 
0476 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
0477 import RecoTracker.FinalTrackSelectors.trackListMerger_cfi
0478 _trackListMergerBase = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
0479     TrackProducers     = ['mixedTripletStepTracks',
0480                           'mixedTripletStepTracks'],
0481     hasSelector        = [1,1],
0482     selectedTrackQuals = ['mixedTripletStepSelector:mixedTripletStepVtx',
0483                           'mixedTripletStepSelector:mixedTripletStepTrk'],
0484     setsToMerge        = [cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )],
0485     writeOnlyTrkQuals  = True
0486 )
0487 trackingLowPU.toReplaceWith(mixedTripletStep, _trackListMergerBase)
0488 
0489 
0490 
0491 MixedTripletStepTask = cms.Task(chargeCut2069Clusters,mixedTripletStepClusters,
0492                                 mixedTripletStepSeedLayersA,
0493                                 mixedTripletStepTrackingRegionsA,
0494                                 mixedTripletStepHitDoubletsA,
0495                                 mixedTripletStepHitTripletsA,
0496                                 mixedTripletStepSeedsA,
0497                                 mixedTripletStepSeedLayersB,
0498                                 mixedTripletStepTrackingRegionsB,
0499                                 mixedTripletStepHitDoubletsB,
0500                                 mixedTripletStepHitTripletsB,
0501                                 mixedTripletStepSeedsB,
0502                                 mixedTripletStepSeeds,
0503                                 mixedTripletStepTrackCandidates,
0504                                 mixedTripletStepTracks,
0505                                 mixedTripletStepClassifier1,mixedTripletStepClassifier2,
0506                                 mixedTripletStep)
0507 MixedTripletStep = cms.Sequence(MixedTripletStepTask)
0508 
0509 _MixedTripletStepTask_trackingMkFit = MixedTripletStepTask.copy()
0510 _MixedTripletStepTask_trackingMkFit.add(mixedTripletStepTrackCandidatesMkFitSeeds, mixedTripletStepTrackCandidatesMkFit, mixedTripletStepTrackCandidatesMkFitConfig)
0511 trackingMkFitMixedTripletStep.toReplaceWith(MixedTripletStepTask, _MixedTripletStepTask_trackingMkFit)
0512 
0513 _MixedTripletStepTask_LowPU = MixedTripletStepTask.copyAndExclude([chargeCut2069Clusters, mixedTripletStepClassifier1])
0514 _MixedTripletStepTask_LowPU.replace(mixedTripletStepClassifier2, mixedTripletStepSelector)
0515 trackingLowPU.toReplaceWith(MixedTripletStepTask, _MixedTripletStepTask_LowPU)
0516 
0517 #fastsim
0518 import FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi
0519 mixedTripletStepMasks = FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi.maskProducerFromClusterRemover(mixedTripletStepClusters)
0520 mixedTripletStepMasks.oldHitRemovalInfo = cms.InputTag('pixelPairStepMasks')
0521 
0522 fastSim.toReplaceWith(MixedTripletStepTask,
0523                       cms.Task(mixedTripletStepMasks
0524                                    ,mixedTripletStepTrackingRegionsA
0525                                    ,mixedTripletStepSeedsA
0526                                    ,mixedTripletStepTrackingRegionsB
0527                                    ,mixedTripletStepSeedsB
0528                                    ,mixedTripletStepSeeds
0529                                    ,mixedTripletStepTrackCandidates
0530                                    ,mixedTripletStepTracks
0531                                    ,mixedTripletStepClassifier1,mixedTripletStepClassifier2
0532                                    ,mixedTripletStep                                 
0533                                    )
0534 )