Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-10 06:14:17

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from RecoTracker.TkSeedingLayers.seedingLayersEDProducer_cfi import *
0004 
0005 from RecoTracker.ConversionSeedGenerators.PhotonConversionTrajectorySeedProducerFromSingleLeg_cfi import *
0006 from RecoTracker.ConversionSeedGenerators.ConversionStep2_cff import *
0007 
0008 from RecoLocalTracker.SubCollectionProducers.trackClusterRemover_cfi import trackClusterRemover as _trackClusterRemover
0009 _convClustersBase = _trackClusterRemover.clone(
0010     maxChi2               = 30.0,
0011     trajectories          = 'tobTecStepTracks',
0012     pixelClusters         = 'siPixelClusters',
0013     stripClusters         = 'siStripClusters',
0014     oldClusterRemovalInfo = 'tobTecStepClusters',
0015     TrackQuality          = 'highPurity'
0016 )
0017 
0018 convClusters = _convClustersBase.clone(
0019     trackClassifier       = 'tobTecStep:QualityMasks',
0020 )
0021 
0022 
0023 #Phase2 : configuring the phase2 track Cluster Remover
0024 from RecoLocalTracker.SubCollectionProducers.phase2trackClusterRemover_cfi import phase2trackClusterRemover as _phase2trackClusterRemover
0025 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
0026 trackingPhase2PU140.toReplaceWith(convClusters, _phase2trackClusterRemover.clone(
0027     maxChi2                                  = 30.0,
0028     phase2pixelClusters                      = 'siPixelClusters',
0029     phase2OTClusters                         = 'siPhase2Clusters',
0030     TrackQuality                             = 'highPurity',
0031     minNumberOfLayersWithMeasBeforeFiltering = 0,
0032     trajectories                             = 'detachedQuadStepTracks',
0033     oldClusterRemovalInfo                    = 'detachedQuadStepClusters',
0034     overrideTrkQuals                         = 'detachedQuadStepSelector:detachedQuadStepTrk'
0035 ))
0036 
0037 _convLayerPairsStripOnlyLayers = ['TIB1+TID1_pos', 
0038                                  'TIB1+TID1_neg', 
0039                                  'TIB1+TID2_pos', 
0040                                  'TIB1+TID2_neg',
0041                                  'TIB1+TIB2',
0042                                  'TIB1+MTIB3',
0043                                  
0044                                  'TIB2+TID1_pos', 
0045                                  'TIB2+TID1_neg', 
0046                                  'TIB2+TID2_pos', 
0047                                  'TIB2+TID2_neg', 
0048                                  'TIB2+MTIB3',
0049                                  'TIB2+MTIB4',
0050                                  
0051                                  'MTIB3+MTIB4',
0052                                  'MTIB3+TOB1',
0053                                  'MTIB3+TID1_pos',
0054                                  'MTIB3+TID1_neg',
0055                                  
0056                                  'MTIB4+TOB1',
0057                                  'MTIB4+TOB2',
0058                                  
0059                                  'TOB1+TOB2',
0060                                  'TOB1+MTOB3',
0061                                  'TOB1+TEC1_pos',
0062                                  'TOB1+TEC1_neg',
0063 
0064                                  'TOB2+MTOB3',
0065                                  'TOB2+MTOB4',
0066                                  'TOB2+TEC1_pos',
0067                                  'TOB2+TEC1_neg',
0068                                  
0069                                  #NB: re-introduce these combinations when large displaced
0070                                  #    tracks, reconstructed only in TOB will be available
0071                                  #    For instance think at the OutIn Ecal Seeded tracks
0072                                  #'MTOB3+MTOB4',
0073                                  #'MTOB3+MTOB5',
0074                                  #'MTOB3+TEC1_pos',
0075                                  #'MTOB3+TEC1_neg',
0076                                  #
0077                                  #'MTOB4+MTOB5',
0078                                  #'MTOB4+MTOB6',
0079                                  #
0080                                  #'MTOB5+MTOB6',
0081                                  
0082                                  'TID1_pos+TID2_pos', 
0083                                  'TID2_pos+TID3_pos', 
0084                                  'TID3_pos+TEC1_pos', 
0085                                  
0086                                  'TID1_neg+TID2_neg', 
0087                                  'TID2_neg+TID3_neg', 
0088                                  'TID3_neg+TEC1_neg', 
0089                                  
0090                                  'TEC1_pos+TEC2_pos', 
0091                                  'TEC2_pos+TEC3_pos', 
0092                                  'TEC3_pos+TEC4_pos',
0093                                  'TEC4_pos+TEC5_pos',
0094                                  'TEC5_pos+TEC6_pos',
0095                                  'TEC6_pos+TEC7_pos',
0096                                  'TEC7_pos+TEC8_pos',
0097                                  
0098                                  'TEC1_neg+TEC2_neg', 
0099                                  'TEC2_neg+TEC3_neg', 
0100                                  'TEC3_neg+TEC4_neg',
0101                                  'TEC4_neg+TEC5_neg',
0102                                  'TEC5_neg+TEC6_neg',
0103                                  'TEC6_neg+TEC7_neg',
0104                                  'TEC7_neg+TEC8_neg']
0105                     
0106 _convLayerPairsLayerList = _convLayerPairsStripOnlyLayers
0107 _convLayerPairsLayerList =['BPix1+BPix2', 
0108                            
0109                            'BPix2+BPix3', 
0110                            'BPix2+FPix1_pos', 
0111                            'BPix2+FPix1_neg', 
0112                            'BPix2+FPix2_pos', 
0113                            'BPix2+FPix2_neg', 
0114                            
0115                            'FPix1_pos+FPix2_pos', 
0116                            'FPix1_neg+FPix2_neg',
0117                                 
0118                            'BPix3+TIB1', 
0119                            'BPix3+TIB2']
0120 _convLayerPairsLayerList.extend(_convLayerPairsStripOnlyLayers)
0121                                                         
0122     
0123 import RecoTracker.TkSeedingLayers.seedingLayersEDProducer_cfi as _mod
0124 
0125 convLayerPairs = _mod.seedingLayersEDProducer.clone(
0126                                 layerList = _convLayerPairsLayerList, 
0127                                 BPix = dict(
0128                                     TTRHBuilder = cms.string('WithTrackAngle'),
0129                                     HitProducer = cms.string('siPixelRecHits'),
0130                                     skipClusters = cms.InputTag('convClusters'),
0131                                     ),
0132                                 FPix = dict(
0133                                     TTRHBuilder = cms.string('WithTrackAngle'),
0134                                     HitProducer = cms.string('siPixelRecHits'),
0135                                     skipClusters = cms.InputTag('convClusters'),
0136                                     ),
0137                                 TIB = dict(
0138                                     TTRHBuilder = cms.string('WithTrackAngle'), 
0139                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0140                                     matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0141                                     skipClusters = cms.InputTag('convClusters'),
0142                                     ),
0143                                 MTIB = dict(
0144                                     TTRHBuilder = cms.string('WithTrackAngle'), 
0145                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0146                                     rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
0147                                     skipClusters = cms.InputTag('convClusters'),
0148                                     ),
0149                                 TID = dict(
0150                                     useSimpleRphiHitsCleaner = cms.bool(False),
0151                                     matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0152                                     useRingSlector = cms.bool(True),
0153                                     TTRHBuilder = cms.string('WithTrackAngle'), 
0154                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0155                                     maxRing = cms.int32(2),
0156                                     minRing = cms.int32(1),
0157                                     skipClusters = cms.InputTag('convClusters'),
0158                                     ),
0159                                 TEC = dict(
0160                                     useSimpleRphiHitsCleaner = cms.bool(False),
0161                                     minRing = cms.int32(1),
0162                                     matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0163                                     useRingSlector = cms.bool(True),
0164                                     TTRHBuilder = cms.string('WithTrackAngle'), 
0165                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0166                                     rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHitUnmatched'),
0167                                     maxRing = cms.int32(7),
0168                                     stereoRecHits = cms.InputTag('siStripMatchedRecHits','stereoRecHitUnmatched'),
0169                                     skipClusters = cms.InputTag('convClusters'),
0170                                     ),
0171                                 TOB = dict(
0172                                     matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
0173                                     TTRHBuilder = cms.string('WithTrackAngle'),
0174                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0175                                     skipClusters = cms.InputTag('convClusters'),
0176                                     ),
0177                                 MTOB = dict(
0178                                     TTRHBuilder = cms.string('WithTrackAngle'),
0179                                     clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
0180                                     rphiRecHits = cms.InputTag('siStripMatchedRecHits','rphiRecHit'),
0181                                     skipClusters = cms.InputTag('convClusters'),
0182                                     ),
0183                                 )
0184 
0185 #this was done by Sam Harper (Aug 2017) and is a best guess (and I do guess wrong sometimes)
0186 #in general I kept all the old layer pairs and added sensible phaseI combinations
0187 #most pairs are adjacent layers (with some small exceptions) so I stuck to that
0188 _convLayerPairsLayerListPhaseI = ['BPix1+BPix2', 
0189                                   
0190                                   'BPix2+BPix3', 
0191                                   'BPix3+BPix4',#added for PhaseI
0192                                   
0193                                   'BPix2+FPix1_pos', 
0194                                   'BPix2+FPix1_neg', 
0195                                   'BPix2+FPix2_pos', 
0196                                   'BPix2+FPix2_neg',                                        
0197                                   'BPix3+FPix1_pos', #added for phaseI 
0198                                   'BPix3+FPix1_neg', #added for phaseI 
0199                                   
0200                                   'FPix1_pos+FPix2_pos', 
0201                                   'FPix1_neg+FPix2_neg',
0202                                   
0203                                   'FPix2_pos+FPix3_pos', #added for phaseI 
0204                                   'FPix2_neg+FPix3_neg',#added for phaseI 
0205                                   
0206                                   'BPix3+TIB1', 
0207                                   #'BPix3+TIB2' #removed for phaseI
0208                                   'BPix4+TIB1', #added for phase I
0209                                   'BPix4+TIB2', #added for phase I
0210                                   ] 
0211 _convLayerPairsLayerListPhaseI.extend(_convLayerPairsStripOnlyLayers)
0212 
0213 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
0214 trackingPhase1.toModify(convLayerPairs, layerList = _convLayerPairsLayerListPhaseI)
0215 
0216 
0217 trackingPhase2PU140.toReplaceWith(convLayerPairs, cms.EDProducer('SeedingLayersEDProducer',
0218                                 layerList = cms.vstring('BPix1+BPix2',
0219                                                         'BPix2+BPix3',
0220                                                         'BPix3+BPix4',
0221 
0222                                                         'BPix1+FPix1_pos',
0223                                                         'BPix1+FPix1_neg',
0224                                                         'BPix2+FPix1_pos',
0225                                                         'BPix2+FPix1_neg',
0226                                                         'BPix3+FPix1_pos',
0227                                                         'BPix3+FPix1_neg',
0228 
0229                                                         'FPix1_pos+FPix2_pos',
0230                                                         'FPix1_neg+FPix2_neg',
0231                                                         'FPix2_pos+FPix3_pos',
0232                                                         'FPix2_neg+FPix3_neg'
0233                                                         ),
0234 
0235                                 BPix = cms.PSet(
0236                                     hitErrorRZ = cms.double(0.006),
0237                                     hitErrorRPhi = cms.double(0.0027),
0238                                     TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
0239                                     HitProducer = cms.string('siPixelRecHits'),
0240                                     useErrorsFromParam = cms.bool(True),
0241                                     skipClusters = cms.InputTag('convClusters'),
0242                                     ),
0243                                 FPix = cms.PSet(
0244                                     hitErrorRZ = cms.double(0.0036),
0245                                     hitErrorRPhi = cms.double(0.0051),
0246                                     TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
0247                                     HitProducer = cms.string('siPixelRecHits'),
0248                                     useErrorsFromParam = cms.bool(True),
0249                                     skipClusters = cms.InputTag('convClusters'),
0250                                     )
0251     )
0252 )
0253 
0254 photonConvTrajSeedFromSingleLeg.TrackRefitter      = 'generalTracks'
0255 photonConvTrajSeedFromSingleLeg.primaryVerticesTag = 'firstStepPrimaryVertices'
0256 #photonConvTrajSeedFromQuadruplets.TrackRefitter      = 'generalTracks'
0257 #photonConvTrajSeedFromQuadruplets.primaryVerticesTag = 'pixelVertices'
0258 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
0259 trackingLowPU.toModify(photonConvTrajSeedFromSingleLeg, primaryVerticesTag   = 'pixelVertices')
0260 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0261 pp_on_AA.toModify(photonConvTrajSeedFromSingleLeg, vtxMinDoF = 999999.)
0262     
0263 # TRACKER DATA CONTROL
0264 
0265 # QUALITY CUTS DURING TRACK BUILDING
0266 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff
0267 convCkfTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
0268         maxLostHits         = 1,
0269         minimumNumberOfHits = 3,
0270         minPt               = 0.1
0271 )
0272 
0273 
0274 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
0275 convStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
0276     ComponentName    = 'convStepChi2Est',
0277     nSigma           = 3.0,
0278     MaxChi2          = 30.0,
0279     MaxDisplacement  = 100,
0280     MaxSagitta       = -1.,
0281     clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
0282 )
0283 
0284 
0285 # TRACK BUILDING
0286 import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
0287 _convCkfTrajectoryBuilderBase = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
0288     trajectoryFilter = dict(refToPSet_ = 'convCkfTrajectoryFilter'),
0289     minNrOfHitsForRebuild = 3,
0290     maxCand = 1
0291 )
0292 
0293 convCkfTrajectoryBuilder = _convCkfTrajectoryBuilderBase.clone(
0294     estimator = 'convStepChi2Est'
0295 )
0296 
0297 trackingPhase2PU140.toReplaceWith(convCkfTrajectoryBuilder, _convCkfTrajectoryBuilderBase.clone(
0298     maxCand = 2
0299 ))
0300 
0301 # MAKING OF TRACK CANDIDATES
0302 import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
0303 convTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
0304     src = 'photonConvTrajSeedFromSingleLeg:convSeedCandidates',
0305     clustersToSkip = 'convClusters',
0306     TrajectoryBuilderPSet = dict(refToPSet_ = 'convCkfTrajectoryBuilder')
0307 )
0308 
0309 trackingPhase2PU140.toModify(convTrackCandidates,
0310     clustersToSkip = '',
0311     phase2clustersToSkip = 'convClusters'
0312 )
0313 
0314 import TrackingTools.TrackFitters.RungeKuttaFitters_cff
0315 convStepFitterSmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.KFFittingSmootherWithOutliersRejectionAndRK.clone(
0316     ComponentName = 'convStepFitterSmoother',
0317     EstimateCut   = 30,
0318     Smoother      = 'convStepRKSmoother'
0319 )
0320     
0321 convStepRKTrajectorySmoother = TrackingTools.TrackFitters.RungeKuttaFitters_cff.RKTrajectorySmoother.clone(
0322     ComponentName  = 'convStepRKSmoother',
0323     errorRescaling = 10.0
0324 )
0325 
0326         
0327 # TRACK FITTING
0328 import RecoTracker.TrackProducer.TrackProducer_cfi
0329 convStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
0330     src = 'convTrackCandidates',
0331     AlgorithmName = 'conversionStep',
0332     Fitter = 'convStepFitterSmoother'
0333 )
0334 
0335 
0336 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
0337 convStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
0338     src='convStepTracks',
0339     trackSelectors= cms.VPSet(
0340         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
0341             name = 'convStepLoose',
0342             applyAdaptedPVCuts = False,
0343             chi2n_par = 3.0,
0344             res_par = ( 0.003, 0.001 ),
0345             minNumberLayers = 3,
0346             maxNumberLostLayers = 1,
0347             minNumber3DLayers = 1,
0348             d0_par1 = ( 5., 8.0 ), # not sure these values are sane....
0349             dz_par1 = ( 5., 8.0 ),
0350             d0_par2 = ( 5., 8.0 ),
0351             dz_par2 = ( 5., 8.0 )
0352             ),
0353         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
0354             name = 'convStepTight',
0355             preFilterName = 'convStepLoose',
0356             chi2n_par = 2.5,
0357             res_par = ( 0.003, 0.001 ),
0358             minNumberLayers = 3,
0359             maxNumberLostLayers = 1,
0360             minNumber3DLayers = 1,
0361             d0_par1 = ( 5., 8.0 ),
0362             dz_par1 = ( 5., 8.0 ),
0363             d0_par2 = ( 5., 8.0 ),
0364             dz_par2 = ( 5., 8.0 )
0365             ),
0366         RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
0367             name = 'convStep',
0368             preFilterName = 'convStepTight',
0369             chi2n_par = 2.0,
0370             res_par = ( 0.003, 0.001 ),
0371             minNumberLayers = 3,
0372             maxNumberLostLayers = 1,
0373             minNumber3DLayers = 1,
0374             d0_par1 = ( 5., 8.0 ),
0375             dz_par1 = ( 5., 8.0 ),
0376             d0_par2 = ( 5., 8.0 ),
0377             dz_par2 = ( 5., 8.0 )
0378             ),
0379     ) #end of vpset
0380 ) #end of clone
0381 
0382 ConvStepTask = cms.Task( convClusters 
0383                          , convLayerPairs
0384                          , photonConvTrajSeedFromSingleLeg 
0385                          , convTrackCandidates
0386                          , convStepTracks
0387                          , convStepSelector
0388                          #+ Conv2Step #full quad-seeding sequence
0389                          )
0390 ConvStep = cms.Sequence( ConvStepTask ) 
0391 
0392 
0393 ### Quad-seeding sequence disabled (#+ Conv2Step)
0394 # if enabled, the quad-seeded tracks have to be merged with the single-leg seeded tracks
0395 # in RecoTracker.FinalTrackSelectors.MergeTrackCollections_cff change:
0396 ###
0397 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
0398 #    TrackProducers = 'convStepTracks',
0399 #    hasSelector=1,
0400 #    selectedTrackQuals = 'convStepSelector:convStep',
0401 #    setsToMerge = dict( tLists = 1, pQual = True ),
0402 #    copyExtras = True,
0403 #    makeReKeyedSeeds = False
0404 #    )
0405 ###
0406 # TO this:
0407 ###
0408 #conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
0409 #    TrackProducers = ['convStepTracks', 'conv2StepTracks'],
0410 #    hasSelector = [1,1],
0411 #    selectedTrackQuals = ['convStepSelector:convStep', 'conv2StepSelector:conv2Step'],
0412 #    setsToMerge = dict( tLists = [0,1], pQual = True ),
0413 #    copyExtras = True,
0414 #    makeReKeyedSeeds = False
0415 #    )
0416 ###