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 
0003 # for dnn classifier
0004 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
0005 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
0006 
0007 # for no-loopers
0008 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
0009 
0010 # This step runs over all clusters
0011 
0012 # run only if there are high pT jets
0013 jetsForCoreTracking = cms.EDFilter('CandPtrSelector', src = cms.InputTag('ak4CaloJetsForTrk'), cut = cms.string('pt > 100 && abs(eta) < 2.5'), filter = cms.bool(False))
0014 
0015 jetsForCoreTrackingBarrel = jetsForCoreTracking.clone( cut = 'pt > 100 && abs(eta) < 1.4' )
0016 jetsForCoreTrackingEndcap = jetsForCoreTracking.clone( cut = 'pt > 100 && abs(eta) < 2.5' )
0017 
0018 # care only at tracks from main PV
0019 firstStepGoodPrimaryVertices = cms.EDFilter('PrimaryVertexObjectFilter',
0020      filterParams = cms.PSet(
0021              minNdof = cms.double(25.0),
0022              maxZ = cms.double(15.0),
0023              maxRho = cms.double(2.0)
0024      ),
0025      src=cms.InputTag('firstStepPrimaryVertices')
0026 )
0027 
0028 import RecoTracker.TkSeedingLayers.seedingLayersEDProducer_cfi as _mod
0029 
0030 # SEEDING LAYERS
0031 jetCoreRegionalStepSeedLayers = _mod.seedingLayersEDProducer.clone(
0032     layerList = ['BPix1+BPix2', 'BPix1+BPix3', 'BPix2+BPix3', 
0033                  'BPix1+FPix1_pos', 'BPix1+FPix1_neg', 
0034                  'BPix2+FPix1_pos', 'BPix2+FPix1_neg', 
0035                  'FPix1_pos+FPix2_pos', 'FPix1_neg+FPix2_neg',
0036                  #'BPix2+TIB1','BPix2+TIB2',
0037                  'BPix3+TIB1','BPix3+TIB2'],
0038     TIB = dict(
0039         matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0040         TTRHBuilder = cms.string('WithTrackAngle'), 
0041         clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone'))
0042     ),
0043     BPix = dict(
0044         useErrorsFromParam = cms.bool(True),
0045         hitErrorRPhi = cms.double(0.0027),
0046         hitErrorRZ = cms.double(0.006),
0047         TTRHBuilder = cms.string('WithTrackAngle'),
0048         HitProducer = cms.string('siPixelRecHits'),
0049         #skipClusters = cms.InputTag('jetCoreRegionalStepClusters')
0050     ),
0051     FPix = dict(
0052         useErrorsFromParam = cms.bool(True),
0053         hitErrorRPhi = cms.double(0.0051),
0054         hitErrorRZ = cms.double(0.0036),
0055         TTRHBuilder = cms.string('WithTrackAngle'),
0056         HitProducer = cms.string('siPixelRecHits'),
0057         #skipClusters = cms.InputTag('jetCoreRegionalStepClusters')
0058     )
0059 )
0060 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
0061 _layerListForPhase1 = [
0062         'BPix1+BPix2', 'BPix1+BPix3', 'BPix1+BPix4',
0063         'BPix2+BPix3', 'BPix2+BPix4',
0064         'BPix3+BPix4',
0065         'BPix1+FPix1_pos', 'BPix1+FPix1_neg',
0066         'BPix2+FPix1_pos', 'BPix2+FPix1_neg',
0067         'FPix1_pos+FPix2_pos', 'FPix1_neg+FPix2_neg',
0068         'FPix1_pos+FPix3_pos', 'FPix1_neg+FPix3_neg',
0069         'FPix2_pos+FPix3_pos', 'FPix2_neg+FPix3_neg',
0070         #'BPix3+TIB1','BPix3+TIB2'
0071         'BPix4+TIB1','BPix4+TIB2'
0072     ]
0073 trackingPhase1.toModify(jetCoreRegionalStepSeedLayers, layerList = _layerListForPhase1)
0074 
0075 # TrackingRegion
0076 from RecoTauTag.HLTProducers.tauRegionalPixelSeedTrackingRegions_cfi import tauRegionalPixelSeedTrackingRegions as _tauRegionalPixelSeedTrackingRegions
0077 jetCoreRegionalStepTrackingRegions = _tauRegionalPixelSeedTrackingRegions.clone(
0078     RegionPSet=dict(
0079         ptMin          = 10,
0080         deltaPhiRegion = 0.20,
0081         deltaEtaRegion = 0.20,
0082         JetSrc         = 'jetsForCoreTracking',
0083         vertexSrc      = 'firstStepGoodPrimaryVertices',
0084         howToUseMeasurementTracker = 'Never')
0085 )
0086 jetCoreRegionalStepEndcapTrackingRegions = jetCoreRegionalStepTrackingRegions.clone(
0087     RegionPSet=dict(
0088         JetSrc = 'jetsForCoreTrackingEndcap')
0089 )
0090 
0091 # Seeding
0092 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
0093 jetCoreRegionalStepHitDoublets = _hitPairEDProducer.clone(
0094     seedingLayers         = 'jetCoreRegionalStepSeedLayers',
0095     trackingRegions       = 'jetCoreRegionalStepTrackingRegions',
0096     produceSeedingHitSets = True,
0097     maxElementTotal       = 12000000,
0098 )
0099 jetCoreRegionalStepEndcapHitDoublets = jetCoreRegionalStepHitDoublets.clone(
0100     trackingRegions = 'jetCoreRegionalStepEndcapTrackingRegions',
0101 )
0102 
0103 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
0104 jetCoreRegionalStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
0105     seedingHitSets = 'jetCoreRegionalStepHitDoublets',
0106     forceKinematicWithRegionDirection = True
0107 )
0108 import RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi
0109 jetCoreRegionalStepSeedsBarrel = RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi.deepCoreSeedGenerator.clone(#to run MCtruthSeedGenerator clone here from Validation.RecoTrack
0110     vertices = "firstStepPrimaryVertices",
0111     cores    = "jetsForCoreTrackingBarrel"
0112 )
0113 
0114 jetCoreRegionalStepSeedsEndcap = jetCoreRegionalStepSeeds.clone(
0115     seedingHitSets = 'jetCoreRegionalStepEndcapHitDoublets',
0116 )
0117 
0118 # QUALITY CUTS DURING TRACK BUILDING
0119 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff
0120 jetCoreRegionalStepTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
0121     minimumNumberOfHits = 4,
0122     seedPairPenalty     = 0,
0123     minPt               = 0.1
0124 )
0125 jetCoreRegionalStepBarrelTrajectoryFilter = jetCoreRegionalStepTrajectoryFilter.clone(
0126     minimumNumberOfHits = 2,
0127     maxConsecLostHits   = 2,
0128     maxLostHitsFraction = 1.1,
0129     seedPairPenalty     = 0,
0130     minPt               = 0.9 ## should it be slightly decrease ?
0131 )
0132 jetCoreRegionalStepEndcapTrajectoryFilter = jetCoreRegionalStepTrajectoryFilter.clone()
0133 
0134 
0135 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
0136 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0137 (pp_on_XeXe_2017 | pp_on_AA).toModify(jetCoreRegionalStepTrajectoryFilter, minPt=5.0)
0138 
0139 import TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi
0140 jetCoreRegionalStepChi2Est = TrackingTools.KalmanUpdators.Chi2MeasurementEstimator_cfi.Chi2MeasurementEstimator.clone(
0141     ComponentName = 'jetCoreRegionalStepChi2Est',
0142     nSigma        = 3.0,
0143     MaxChi2       = 30.0
0144 )
0145 
0146 # TRACK BUILDING
0147 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
0148 #need to also load the refToPSet_ used by GroupedCkfTrajectoryBuilder
0149 CkfBaseTrajectoryFilter_block = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.CkfBaseTrajectoryFilter_block
0150 jetCoreRegionalStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilderIterativeDefault.clone(
0151     trajectoryFilter = dict(refToPSet_ = 'jetCoreRegionalStepTrajectoryFilter'),
0152     maxCand = 50,
0153     estimator = 'jetCoreRegionalStepChi2Est',
0154     maxDPhiForLooperReconstruction = 2.0,
0155     maxPtForLooperReconstruction = 0.7,
0156 )
0157 trackingNoLoopers.toModify(jetCoreRegionalStepTrajectoryBuilder,
0158                            maxPtForLooperReconstruction = 0.0)    
0159 jetCoreRegionalStepBarrelTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilderIterativeDefault.clone(
0160     trajectoryFilter = dict(refToPSet_ = 'jetCoreRegionalStepBarrelTrajectoryFilter'),
0161     maxCand = 30,
0162     estimator = 'jetCoreRegionalStepChi2Est',
0163     keepOriginalIfRebuildFails = True,
0164     lockHits = False,
0165     requireSeedHitsInRebuild = False,
0166 )
0167 trackingNoLoopers.toModify(jetCoreRegionalStepBarrelTrajectoryBuilder,
0168                            maxPtForLooperReconstruction = cms.double(0.0))    
0169 jetCoreRegionalStepEndcapTrajectoryBuilder = jetCoreRegionalStepTrajectoryBuilder.clone(
0170     trajectoryFilter = cms.PSet(refToPSet_ = cms.string('jetCoreRegionalStepEndcapTrajectoryFilter')),
0171     maxCand = 30,
0172     #clustersToSkip = cms.InputTag('jetCoreRegionalStepClusters'),
0173 )
0174 trackingNoLoopers.toModify(jetCoreRegionalStepEndcapTrajectoryBuilder,
0175                            maxPtForLooperReconstruction = cms.double(0.0))
0176 #customized cleaner for DeepCore
0177 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
0178 jetCoreRegionalStepDeepCoreTrajectoryCleaner = trajectoryCleanerBySharedHits.clone(
0179     ComponentName = 'jetCoreRegionalStepDeepCoreTrajectoryCleaner',
0180     fractionShared = 0.45
0181 )
0182 
0183 ############## to run MCtruthSeedGenerator ####################
0184 #import RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi
0185 #import Validation.RecoTrack.JetCoreMCtruthSeedGenerator_cfi
0186 #seedingDeepCore.toReplaceWith(jetCoreRegionalStepSeedsBarrel,
0187 #    RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi.deepCoreSeedGenerator.clone(#to run MCtruthSeedGenerator clone here from Validation.RecoTrack
0188 #       vertices="firstStepPrimaryVertices" 
0189 #    )
0190 #)
0191 
0192 
0193 # MAKING OF TRACK CANDIDATES
0194 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0195 jetCoreRegionalStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidatesIterativeDefault.clone(
0196     src                    = 'jetCoreRegionalStepSeeds',
0197     maxSeedsBeforeCleaning = 10000,
0198     TrajectoryBuilderPSet  = dict(refToPSet_ = 'jetCoreRegionalStepTrajectoryBuilder'),
0199     NavigationSchool       = 'SimpleNavigationSchool',
0200     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0201     #numHitsForSeedCleaner = 50,
0202     #onlyPixelHitsForSeedCleaner = True,
0203 )
0204 jetCoreRegionalStepBarrelTrackCandidates = jetCoreRegionalStepTrackCandidates.clone(
0205     src                    = 'jetCoreRegionalStepSeedsBarrel',
0206     TrajectoryBuilderPSet  = cms.PSet( refToPSet_ = cms.string('jetCoreRegionalStepBarrelTrajectoryBuilder')),
0207     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0208     #numHitsForSeedCleaner = cms.int32(50),
0209     #onlyPixelHitsForSeedCleaner = cms.bool(True),
0210     TrajectoryCleaner         = 'jetCoreRegionalStepDeepCoreTrajectoryCleaner',
0211     doSeedingRegionRebuilding = True,
0212 )
0213 jetCoreRegionalStepEndcapTrackCandidates = jetCoreRegionalStepTrackCandidates.clone(
0214     src                    = 'jetCoreRegionalStepSeedsEndcap',
0215     TrajectoryBuilderPSet  = cms.PSet( refToPSet_ = cms.string('jetCoreRegionalStepEndcapTrajectoryBuilder')),
0216     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0217     #numHitsForSeedCleaner = cms.int32(50),
0218     #onlyPixelHitsForSeedCleaner = cms.bool(True),
0219 )
0220 
0221 # TRACK FITTING
0222 import RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi
0223 jetCoreRegionalStepTracks = RecoTracker.TrackProducer.TrackProducerIterativeDefault_cfi.TrackProducerIterativeDefault.clone(
0224     AlgorithmName = 'jetCoreRegionalStep',
0225     src           = 'jetCoreRegionalStepTrackCandidates',
0226     Fitter        = 'FlexibleKFFittingSmoother'
0227 )
0228 jetCoreRegionalStepBarrelTracks = jetCoreRegionalStepTracks.clone(
0229     src           = 'jetCoreRegionalStepBarrelTrackCandidates',
0230 )
0231 jetCoreRegionalStepEndcapTracks = jetCoreRegionalStepTracks.clone(
0232     src           = 'jetCoreRegionalStepEndcapTrackCandidates',
0233 )
0234 
0235 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0236 import RecoTracker.FinalTrackSelectors.trackListMerger_cfi
0237 _fastSim_jetCoreRegionalStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
0238     TrackProducers     = [],
0239     hasSelector        = [],
0240     selectedTrackQuals = [],
0241     copyExtras         = True
0242 )
0243 fastSim.toReplaceWith(jetCoreRegionalStepTracks,_fastSim_jetCoreRegionalStepTracks)
0244 from Configuration.ProcessModifiers.seedingDeepCore_cff import seedingDeepCore
0245 (seedingDeepCore & fastSim).toReplaceWith(jetCoreRegionalStepBarrelTracks,_fastSim_jetCoreRegionalStepTracks)
0246 (seedingDeepCore & fastSim).toReplaceWith(jetCoreRegionalStepEndcapTracks,_fastSim_jetCoreRegionalStepTracks)
0247 
0248 # Final selection
0249 from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import *
0250 jetCoreRegionalStep = TrackCutClassifier.clone(
0251     src = 'jetCoreRegionalStepTracks',
0252     mva = dict(
0253     minPixelHits  = [1,1,1],
0254         maxChi2       = [9999.,9999.,9999.],
0255         maxChi2n      = [1.6,1.0,0.7],
0256         minLayers     = [3,5,5],
0257         min3DLayers   = [1,2,3],
0258         maxLostLayers = [4,3,2],
0259         maxDz         = [0.5,0.35,0.2],
0260         maxDr         = [0.3,0.2,0.1]
0261     ),
0262     vertices = 'firstStepGoodPrimaryVertices'
0263 )
0264 jetCoreRegionalStepBarrel = jetCoreRegionalStep.clone(
0265     src = 'jetCoreRegionalStepBarrelTracks',
0266     mva = dict(
0267 #   minPixelHits  = [1,1,1], # they could be easily increased to at least 2 or 3 !
0268         min3DLayers   = [1,2,2],
0269     ),
0270 )
0271 
0272 from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import *
0273 trackingPhase1.toReplaceWith(jetCoreRegionalStep, TrackMVAClassifierPrompt.clone(
0274      mva = dict(GBRForestLabel = 'MVASelectorJetCoreRegionalStep_Phase1'),
0275      src = 'jetCoreRegionalStepTracks',
0276      qualityCuts = [-0.2,0.0,0.4]
0277 ))
0278 
0279 trackingPhase1.toReplaceWith(jetCoreRegionalStepBarrel, jetCoreRegionalStep.clone(
0280      src = 'jetCoreRegionalStepBarrelTracks',
0281 ))
0282 
0283 pp_on_AA.toModify(jetCoreRegionalStep, qualityCuts = [-0.2, 0.0, 0.8])
0284 pp_on_AA.toModify(jetCoreRegionalStepBarrel, qualityCuts = [-0.2, 0.0, 0.8])
0285 
0286 from RecoTracker.FinalTrackSelectors.trackTfClassifier_cfi import *
0287 from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
0288 from RecoTracker.FinalTrackSelectors.trackSelectionTf_CKF_cfi import *
0289 trackdnn.toReplaceWith(jetCoreRegionalStep, trackTfClassifier.clone(
0290      src = 'jetCoreRegionalStepTracks',
0291      qualityCuts = qualityCutDictionary.JetCoreRegionalStep.value()
0292 ))
0293 trackdnn.toReplaceWith(jetCoreRegionalStepBarrel, trackTfClassifier.clone(
0294      src = 'jetCoreRegionalStepBarrelTracks',
0295      qualityCuts = qualityCutDictionary.JetCoreRegionalStep.value()
0296 ))
0297 
0298 fastSim.toModify(jetCoreRegionalStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0299 
0300 
0301 jetCoreRegionalStepEndcap = jetCoreRegionalStep.clone(
0302     src = 'jetCoreRegionalStepEndcapTracks',
0303 )
0304 
0305 # Final sequence
0306 JetCoreRegionalStepTask = cms.Task(jetsForCoreTracking,                 
0307                                    firstStepGoodPrimaryVertices,
0308                                    #jetCoreRegionalStepClusters,
0309                                    jetCoreRegionalStepSeedLayers,
0310                                    jetCoreRegionalStepTrackingRegions,
0311                                    jetCoreRegionalStepHitDoublets,
0312                                    jetCoreRegionalStepSeeds,
0313                                    jetCoreRegionalStepTrackCandidates,
0314                                    jetCoreRegionalStepTracks,
0315                                    #jetCoreRegionalStepClassifier1,jetCoreRegionalStepClassifier2,
0316                                    jetCoreRegionalStep)
0317 JetCoreRegionalStep = cms.Sequence(JetCoreRegionalStepTask)
0318 
0319 JetCoreRegionalStepBarrelTask = cms.Task(jetsForCoreTrackingBarrel,
0320                                          firstStepGoodPrimaryVertices,
0321                                          #jetCoreRegionalStepClusters,
0322                                          jetCoreRegionalStepSeedLayers,
0323                                          jetCoreRegionalStepSeedsBarrel,
0324                                          jetCoreRegionalStepBarrelTrackCandidates,
0325                                          jetCoreRegionalStepBarrelTracks,
0326                                          jetCoreRegionalStepBarrel)
0327 
0328 JetCoreRegionalStepEndcapTask = cms.Task(jetsForCoreTrackingEndcap,
0329                                          firstStepGoodPrimaryVertices,
0330                                          #jetCoreRegionalStepClusters,
0331                                          jetCoreRegionalStepSeedLayers,
0332                                          jetCoreRegionalStepEndcapTrackingRegions,
0333                                          jetCoreRegionalStepEndcapHitDoublets,
0334                                          jetCoreRegionalStepSeedsEndcap,
0335                                          jetCoreRegionalStepEndcapTrackCandidates,
0336                                          jetCoreRegionalStepEndcapTracks,
0337                                          jetCoreRegionalStepEndcap)
0338 
0339 
0340 from RecoTracker.FinalTrackSelectors.TrackCollectionMerger_cfi import *
0341 (seedingDeepCore & ~fastSim).toReplaceWith(jetCoreRegionalStepTracks, TrackCollectionMerger.clone(
0342     trackProducers   = ["jetCoreRegionalStepBarrelTracks",
0343                         "jetCoreRegionalStepEndcapTracks",],
0344     inputClassifiers = ["jetCoreRegionalStepBarrel",
0345                         "jetCoreRegionalStepEndcap",],
0346     foundHitBonus    = 100.0,
0347     lostHitPenalty   = 1.0
0348 ))
0349 
0350 seedingDeepCore.toReplaceWith(jetCoreRegionalStep, jetCoreRegionalStepTracks.clone()) #(*)
0351 
0352 seedingDeepCore.toReplaceWith(JetCoreRegionalStepTask, cms.Task(
0353     JetCoreRegionalStepBarrelTask,
0354     JetCoreRegionalStepEndcapTask,
0355     cms.Task(jetCoreRegionalStepTracks,jetCoreRegionalStep)
0356 ))
0357 
0358 # short-circuit tracking parts for fastsim
0359 fastSim.toReplaceWith(JetCoreRegionalStepTask, 
0360     cms.Task(jetCoreRegionalStepTracks,
0361              jetCoreRegionalStep))
0362 (seedingDeepCore & fastSim).toReplaceWith(JetCoreRegionalStepTask,
0363     cms.Task(jetCoreRegionalStepBarrelTracks, jetCoreRegionalStepEndcapTracks,
0364              jetCoreRegionalStepTracks,
0365              jetCoreRegionalStepBarrel, jetCoreRegionalStepEndcap,
0366              jetCoreRegionalStep))