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 #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) < 2.5' )
0016 jetsForCoreTrackingEndcap = jetsForCoreTracking.clone( cut = 'pt > 100 && abs(eta) > 1.4 && 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.GroupedCkfTrajectoryBuilder.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.GroupedCkfTrajectoryBuilder.clone(
0160     trajectoryFilter = dict(refToPSet_ = 'jetCoreRegionalStepBarrelTrajectoryFilter'),
0161     maxCand = 50,
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     #clustersToSkip = cms.InputTag('jetCoreRegionalStepClusters'),
0172 )
0173 trackingNoLoopers.toModify(jetCoreRegionalStepEndcapTrajectoryBuilder,
0174                            maxPtForLooperReconstruction = cms.double(0.0))
0175 #customized cleaner for DeepCore
0176 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
0177 jetCoreRegionalStepDeepCoreTrajectoryCleaner = trajectoryCleanerBySharedHits.clone(
0178     ComponentName = 'jetCoreRegionalStepDeepCoreTrajectoryCleaner',
0179     fractionShared = 0.45
0180 )
0181 
0182 ############## to run MCtruthSeedGenerator ####################
0183 #import RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi
0184 #import Validation.RecoTrack.JetCoreMCtruthSeedGenerator_cfi
0185 #seedingDeepCore.toReplaceWith(jetCoreRegionalStepSeedsBarrel,
0186 #    RecoTracker.TkSeedGenerator.deepCoreSeedGenerator_cfi.deepCoreSeedGenerator.clone(#to run MCtruthSeedGenerator clone here from Validation.RecoTrack
0187 #       vertices="firstStepPrimaryVertices" 
0188 #    )
0189 #)
0190 
0191 
0192 # MAKING OF TRACK CANDIDATES
0193 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0194 jetCoreRegionalStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0195     src                    = 'jetCoreRegionalStepSeeds',
0196     maxSeedsBeforeCleaning = 10000,
0197     TrajectoryBuilderPSet  = dict(refToPSet_ = 'jetCoreRegionalStepTrajectoryBuilder'),
0198     NavigationSchool       = 'SimpleNavigationSchool',
0199     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0200     #numHitsForSeedCleaner = 50,
0201     #onlyPixelHitsForSeedCleaner = True,
0202 )
0203 jetCoreRegionalStepBarrelTrackCandidates = jetCoreRegionalStepTrackCandidates.clone(
0204     src                    = 'jetCoreRegionalStepSeedsBarrel',
0205     TrajectoryBuilderPSet  = cms.PSet( refToPSet_ = cms.string('jetCoreRegionalStepBarrelTrajectoryBuilder')),
0206     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0207     #numHitsForSeedCleaner = cms.int32(50),
0208     #onlyPixelHitsForSeedCleaner = cms.bool(True),
0209     TrajectoryCleaner         = 'jetCoreRegionalStepDeepCoreTrajectoryCleaner',
0210     doSeedingRegionRebuilding = True,
0211 )
0212 jetCoreRegionalStepEndcapTrackCandidates = jetCoreRegionalStepTrackCandidates.clone(
0213     src                    = 'jetCoreRegionalStepSeedsEndcap',
0214     TrajectoryBuilderPSet  = cms.PSet( refToPSet_ = cms.string('jetCoreRegionalStepEndcapTrajectoryBuilder')),
0215     ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
0216     #numHitsForSeedCleaner = cms.int32(50),
0217     #onlyPixelHitsForSeedCleaner = cms.bool(True),
0218 )
0219 
0220 # TRACK FITTING
0221 import RecoTracker.TrackProducer.TrackProducer_cfi
0222 jetCoreRegionalStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0223     AlgorithmName = 'jetCoreRegionalStep',
0224     src           = 'jetCoreRegionalStepTrackCandidates',
0225     Fitter        = 'FlexibleKFFittingSmoother'
0226 )
0227 jetCoreRegionalStepBarrelTracks = jetCoreRegionalStepTracks.clone(
0228     src           = 'jetCoreRegionalStepBarrelTrackCandidates',
0229 )
0230 jetCoreRegionalStepEndcapTracks = jetCoreRegionalStepTracks.clone(
0231     src           = 'jetCoreRegionalStepEndcapTrackCandidates',
0232 )
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 
0245 
0246 # Final selection
0247 from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import *
0248 jetCoreRegionalStep = TrackCutClassifier.clone(
0249     src = 'jetCoreRegionalStepTracks',
0250     mva = dict(
0251     minPixelHits  = [1,1,1],
0252         maxChi2       = [9999.,9999.,9999.],
0253         maxChi2n      = [1.6,1.0,0.7],
0254         minLayers     = [3,5,5],
0255         min3DLayers   = [1,2,3],
0256         maxLostLayers = [4,3,2],
0257         maxDz         = [0.5,0.35,0.2],
0258         maxDr         = [0.3,0.2,0.1]
0259     ),
0260     vertices = 'firstStepGoodPrimaryVertices'
0261 )
0262 jetCoreRegionalStepBarrel = jetCoreRegionalStep.clone(
0263     src = 'jetCoreRegionalStepBarrelTracks',
0264     mva = dict(
0265 #   minPixelHits  = [1,1,1], # they could be easily increased to at least 2 or 3 !
0266         min3DLayers   = [1,2,2],
0267     ),
0268 )
0269 
0270 from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import *
0271 trackingPhase1.toReplaceWith(jetCoreRegionalStep, TrackMVAClassifierPrompt.clone(
0272      mva = dict(GBRForestLabel = 'MVASelectorJetCoreRegionalStep_Phase1'),
0273      src = 'jetCoreRegionalStepTracks',
0274      qualityCuts = [-0.2,0.0,0.4]
0275 ))
0276 
0277 trackingPhase1.toReplaceWith(jetCoreRegionalStepBarrel, jetCoreRegionalStep.clone(
0278      src = 'jetCoreRegionalStepBarrelTracks',
0279 ))
0280 
0281 pp_on_AA.toModify(jetCoreRegionalStep, qualityCuts = [-0.2, 0.0, 0.8])
0282 pp_on_AA.toModify(jetCoreRegionalStepBarrel, qualityCuts = [-0.2, 0.0, 0.8])
0283 
0284 from RecoTracker.FinalTrackSelectors.trackTfClassifier_cfi import *
0285 from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
0286 from RecoTracker.FinalTrackSelectors.trackSelectionTf_CKF_cfi import *
0287 trackdnn.toReplaceWith(jetCoreRegionalStep, trackTfClassifier.clone(
0288      src = 'jetCoreRegionalStepTracks',
0289      qualityCuts = qualityCutDictionary.JetCoreRegionalStep.value()
0290 ))
0291 trackdnn.toReplaceWith(jetCoreRegionalStepBarrel, trackTfClassifier.clone(
0292      src = 'jetCoreRegionalStepBarrelTracks',
0293      qualityCuts = qualityCutDictionary.JetCoreRegionalStep.value()
0294 ))
0295 
0296 fastSim.toModify(jetCoreRegionalStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
0297 
0298 
0299 jetCoreRegionalStepEndcap = jetCoreRegionalStep.clone(
0300     src = 'jetCoreRegionalStepEndcapTracks',
0301 )
0302 
0303 # Final sequence
0304 JetCoreRegionalStepTask = cms.Task(jetsForCoreTracking,                 
0305                                    firstStepGoodPrimaryVertices,
0306                                    #jetCoreRegionalStepClusters,
0307                                    jetCoreRegionalStepSeedLayers,
0308                                    jetCoreRegionalStepTrackingRegions,
0309                                    jetCoreRegionalStepHitDoublets,
0310                                    jetCoreRegionalStepSeeds,
0311                                    jetCoreRegionalStepTrackCandidates,
0312                                    jetCoreRegionalStepTracks,
0313                                    #jetCoreRegionalStepClassifier1,jetCoreRegionalStepClassifier2,
0314                                    jetCoreRegionalStep)
0315 JetCoreRegionalStep = cms.Sequence(JetCoreRegionalStepTask)
0316 
0317 JetCoreRegionalStepBarrelTask = cms.Task(jetsForCoreTrackingBarrel,
0318                                          firstStepGoodPrimaryVertices,
0319                                          #jetCoreRegionalStepClusters,
0320                                          jetCoreRegionalStepSeedLayers,
0321                                          jetCoreRegionalStepSeedsBarrel,
0322                                          jetCoreRegionalStepBarrelTrackCandidates,
0323                                          jetCoreRegionalStepBarrelTracks,
0324                                          jetCoreRegionalStepBarrel)
0325 
0326 JetCoreRegionalStepEndcapTask = cms.Task(jetsForCoreTrackingEndcap,
0327                                          firstStepGoodPrimaryVertices,
0328                                          #jetCoreRegionalStepClusters,
0329                                          jetCoreRegionalStepSeedLayers,
0330                                          jetCoreRegionalStepEndcapTrackingRegions,
0331                                          jetCoreRegionalStepEndcapHitDoublets,
0332                                          jetCoreRegionalStepSeedsEndcap,
0333                                          jetCoreRegionalStepEndcapTrackCandidates,
0334                                          jetCoreRegionalStepEndcapTracks,
0335                                          jetCoreRegionalStepEndcap)
0336 
0337 
0338 from Configuration.ProcessModifiers.seedingDeepCore_cff import seedingDeepCore
0339 
0340 from RecoTracker.FinalTrackSelectors.TrackCollectionMerger_cfi import *
0341 seedingDeepCore.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 fastSim.toReplaceWith(JetCoreRegionalStepTask, 
0359                       cms.Task(jetCoreRegionalStepTracks,
0360                                    jetCoreRegionalStep))