CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MixedTripletStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
3 
4 from Configuration.Eras.Modifier_fastSim_cff import fastSim
5 
6 #for dnn classifier
7 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
8 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
9 
10 # for no-loopers
11 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
12 
13 ###############################################################
14 # Large impact parameter Tracking using mixed-triplet seeding #
15 ###############################################################
16 
17 #here just for backward compatibility
18 chargeCut2069Clusters = cms.EDProducer('ClusterChargeMasker',
19  oldClusterRemovalInfo = cms.InputTag(''), # to be set below
20  pixelClusters = cms.InputTag('siPixelClusters'),
21  stripClusters = cms.InputTag('siStripClusters'),
22  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
23 )
24 
25 mixedTripletStepClusters = _cfg.clusterRemoverForIter('MixedTripletStep')
26 chargeCut2069Clusters.oldClusterRemovalInfo = mixedTripletStepClusters.oldClusterRemovalInfo.value()
27 mixedTripletStepClusters.oldClusterRemovalInfo = 'chargeCut2069Clusters'
28 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
29  _era.toReplaceWith(mixedTripletStepClusters, _cfg.clusterRemoverForIter('MixedTripletStep', _eraName, _postfix))
30 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
31 trackingPhase1.toModify(chargeCut2069Clusters, oldClusterRemovalInfo = mixedTripletStepClusters.oldClusterRemovalInfo.value())
32 trackingPhase1.toModify(mixedTripletStepClusters, oldClusterRemovalInfo='chargeCut2069Clusters')
33 
34 # SEEDING LAYERS
36 from RecoTracker.IterativeTracking.DetachedTripletStep_cff import detachedTripletStepSeedLayers
38 mixedTripletStepSeedLayersA = _mod.seedingLayersEDProducer.clone(
39  layerList = ['BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg'],
40 # layerList = ['BPix1+BPix2+BPix3',
41 # 'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
42 # 'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg',
43 # 'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg'],
44  BPix = dict(
45  TTRHBuilder = cms.string('WithTrackAngle'),
46  HitProducer = cms.string('siPixelRecHits'),
47  skipClusters = cms.InputTag('mixedTripletStepClusters')
48  ),
49  FPix = dict(
50  TTRHBuilder = cms.string('WithTrackAngle'),
51  HitProducer = cms.string('siPixelRecHits'),
52  skipClusters = cms.InputTag('mixedTripletStepClusters')
53  ),
54  TEC = dict(
55  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
56  useRingSlector = cms.bool(True),
57  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
58  minRing = cms.int32(1),
59  maxRing = cms.int32(1),
60  skipClusters = cms.InputTag('mixedTripletStepClusters')
61  )
62 )
63 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
64 trackingLowPU.toModify(mixedTripletStepSeedLayersA,
65  layerList = [
66  'BPix1+BPix2+BPix3',
67  'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
68  'BPix1+FPix1_pos+FPix2_pos', 'BPix1+FPix1_neg+FPix2_neg',
69  'BPix2+FPix1_pos+FPix2_pos', 'BPix2+FPix1_neg+FPix2_neg',
70  'FPix1_pos+FPix2_pos+TEC1_pos', 'FPix1_neg+FPix2_neg+TEC1_neg',
71  'FPix2_pos+TEC2_pos+TEC3_pos', 'FPix2_neg+TEC2_neg+TEC3_neg'
72  ],
73  TEC = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
74 )
75 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
76 highBetaStar_2018.toModify(mixedTripletStepSeedLayersA,
77  layerList = [
78  'BPix1+BPix2+BPix3',
79  'BPix1+FPix1_pos+FPix2_pos','BPix1+FPix1_neg+FPix2_neg',
80  'BPix2+FPix1_pos+FPix2_pos','BPix2+FPix1_neg+FPix2_neg',
81  'BPix1+BPix2+FPix1_pos', 'BPix1+BPix2+FPix1_neg',
82  'BPix1+BPix2+FPix2_pos', 'BPix1+BPix2+FPix2_neg'
83  ]
84 )
85 
86 
87 # TrackingRegion
88 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpotFixedZ_cfi import globalTrackingRegionFromBeamSpotFixedZ as _globalTrackingRegionFromBeamSpotFixedZ
89 _mixedTripletStepTrackingRegionsCommon = _globalTrackingRegionFromBeamSpotFixedZ.clone(RegionPSet = dict(
90  ptMin = 0.4,
91  originHalfLength = 15.0,
92  originRadius = 1.5
93 ))
94 trackingLowPU.toModify(_mixedTripletStepTrackingRegionsCommon, RegionPSet = dict(originHalfLength = 10.0))
95 highBetaStar_2018.toModify(_mixedTripletStepTrackingRegionsCommon,RegionPSet = dict(
96  ptMin = 0.05,
97  originRadius = 0.2
98 ))
99 
100 mixedTripletStepTrackingRegionsA = _mixedTripletStepTrackingRegionsCommon.clone()
101 
102 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
103 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
104 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
105 _mixedTripletStepTrackingRegionsCommon_pp_on_HI = _globalTrackingRegionWithVertices.clone(
106  RegionPSet=dict(
107  fixedError = 3.75,
108  ptMin = 0.4,
109  originRadius = 1.5,
110  originRScaling4BigEvts = True,
111  ptMinScaling4BigEvts = True,
112  minOriginR = 0.,
113  maxPtMin = 0.7,
114  scalingStartNPix = 20000,
115  scalingEndNPix = 35000
116  )
117 )
118 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(mixedTripletStepTrackingRegionsA,_mixedTripletStepTrackingRegionsCommon_pp_on_HI)
119 
120 
121 # seeding
122 from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import ClusterShapeHitFilterESProducer as _ClusterShapeHitFilterESProducer
123 mixedTripletStepClusterShapeHitFilter = _ClusterShapeHitFilterESProducer.clone(
124  ComponentName = 'mixedTripletStepClusterShapeHitFilter',
125  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTight')
126 )
127 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
128 mixedTripletStepHitDoubletsA = _hitPairEDProducer.clone(
129  seedingLayers = 'mixedTripletStepSeedLayersA',
130  trackingRegions = 'mixedTripletStepTrackingRegionsA',
131  maxElement = 50000000,
132  produceIntermediateHitDoublets = True,
133 )
134 from RecoPixelVertexing.PixelTriplets.pixelTripletLargeTipEDProducer_cfi import pixelTripletLargeTipEDProducer as _pixelTripletLargeTipEDProducer
136 mixedTripletStepHitTripletsA = _pixelTripletLargeTipEDProducer.clone(
137  doublets = 'mixedTripletStepHitDoubletsA',
138  produceSeedingHitSets = True,
139 )
140 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
141 _mixedTripletStepSeedsACommon = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
142  seedingHitSets = 'mixedTripletStepHitTripletsA',
143  SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
144  ComponentName = 'PixelClusterShapeSeedComparitor',
145  FilterAtHelixStage = cms.bool(False),
146  FilterPixelHits = cms.bool(True),
147  FilterStripHits = cms.bool(True),
148  ClusterShapeHitFilterName = cms.string('mixedTripletStepClusterShapeHitFilter'),
149  ClusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCache')
150  ),
151 )
152 trackingLowPU.toModify(_mixedTripletStepSeedsACommon,
153  SeedComparitorPSet = dict(ClusterShapeHitFilterName = 'ClusterShapeHitFilter')
154 )
155 mixedTripletStepSeedsA = _mixedTripletStepSeedsACommon.clone()
156 
157 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
158 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
159 _fastSim_mixedTripletStepSeedsA = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
160  trackingRegions = 'mixedTripletStepTrackingRegionsA',
161  hitMasks = cms.InputTag('mixedTripletStepMasks'),
162  seedFinderSelector = dict(pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(mixedTripletStepHitTripletsA),
163  layerList = mixedTripletStepSeedLayersA.layerList.value())
164 )
165 fastSim.toReplaceWith(mixedTripletStepSeedsA,_fastSim_mixedTripletStepSeedsA)
166 
167 # SEEDING LAYERS
168 mixedTripletStepSeedLayersB = _mod.seedingLayersEDProducer.clone(
169  layerList = ['BPix2+BPix3+TIB1'],
170  BPix = dict(
171  TTRHBuilder = cms.string('WithTrackAngle'),
172  HitProducer = cms.string('siPixelRecHits'),
173  skipClusters = cms.InputTag('mixedTripletStepClusters')
174  ),
175  TIB = dict(
176  matchedRecHits = cms.InputTag('siStripMatchedRecHits','matchedRecHit'),
177  TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight')),
178  skipClusters = cms.InputTag('mixedTripletStepClusters')
179  )
180 )
181 trackingLowPU.toModify(mixedTripletStepSeedLayersB,
182  layerList = ['BPix2+BPix3+TIB1', 'BPix2+BPix3+TIB2'],
183  TIB = dict(clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')),
184 )
185 trackingPhase1.toModify(mixedTripletStepSeedLayersB, layerList = ['BPix3+BPix4+TIB1'])
186 
187 # TrackingRegion
188 mixedTripletStepTrackingRegionsB = _mixedTripletStepTrackingRegionsCommon.clone(RegionPSet = dict(ptMin=0.6, originHalfLength=10.0))
189 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(mixedTripletStepTrackingRegionsB,
190  _mixedTripletStepTrackingRegionsCommon_pp_on_HI.clone(RegionPSet=dict(
191  fixedError = 2.5,
192  ptMin = 0.6,)
193  )
194 )
195 highBetaStar_2018.toReplaceWith(mixedTripletStepTrackingRegionsB, _mixedTripletStepTrackingRegionsCommon.clone())
196 
197 # seeding
198 mixedTripletStepHitDoubletsB = mixedTripletStepHitDoubletsA.clone(
199  seedingLayers = 'mixedTripletStepSeedLayersB',
200  trackingRegions = 'mixedTripletStepTrackingRegionsB',
201 )
202 mixedTripletStepHitTripletsB = mixedTripletStepHitTripletsA.clone(doublets = 'mixedTripletStepHitDoubletsB')
203 mixedTripletStepSeedsB = _mixedTripletStepSeedsACommon.clone(seedingHitSets = 'mixedTripletStepHitTripletsB')
204 #fastsim
205 _fastSim_mixedTripletStepSeedsB = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
206  trackingRegions = 'mixedTripletStepTrackingRegionsB',
207  hitMasks = cms.InputTag('mixedTripletStepMasks'),
208  seedFinderSelector = dict(pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(mixedTripletStepHitTripletsB),
209  layerList = mixedTripletStepSeedLayersB.layerList.value())
210 )
211 fastSim.toReplaceWith(mixedTripletStepSeedsB,_fastSim_mixedTripletStepSeedsB)
212 
213 
215 mixedTripletStepSeeds = RecoTracker.TkSeedGenerator.GlobalCombinedSeeds_cfi.globalCombinedSeeds.clone(
216  seedCollections = ['mixedTripletStepSeedsA',
217  'mixedTripletStepSeedsB']
218 )
219 # QUALITY CUTS DURING TRACK BUILDING
221 _mixedTripletStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
222 # maxLostHits = 0,
223  minimumNumberOfHits = 3,
224  minPt = 0.1
225 )
226 highBetaStar_2018.toModify(_mixedTripletStepTrajectoryFilterBase,minPt = 0.05)
227 
228 mixedTripletStepTrajectoryFilter = _mixedTripletStepTrajectoryFilterBase.clone(
229  constantValueForLostHitsFractionFilter = 1.4,
230 )
231 trackingLowPU.toReplaceWith(mixedTripletStepTrajectoryFilter, _mixedTripletStepTrajectoryFilterBase.clone(
232  maxLostHits = 0,
233 ))
234 
235 (pp_on_XeXe_2017 | pp_on_AA).toModify(mixedTripletStepTrajectoryFilter, minPt=0.4)
236 
237 # Propagator taking into account momentum uncertainty in multiple scattering calculation.
240 mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone(
241 #mixedTripletStepPropagator = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.MaterialPropagatorParabolicMF.clone(
242  ComponentName = 'mixedTripletStepPropagator',
243  ptMin = 0.1
244 )
245 for e in [pp_on_XeXe_2017, pp_on_AA]:
246  e.toModify(mixedTripletStepPropagator, ptMin=0.4)
247 highBetaStar_2018.toModify(mixedTripletStepPropagator,ptMin = 0.05)
248 
250 mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi.OppositeMaterialPropagator.clone(
251 #mixedTripletStepPropagatorOpposite = TrackingTools.MaterialEffects.MaterialPropagatorParabolicMf_cff.OppositeMaterialPropagatorParabolicMF.clone(
252  ComponentName = 'mixedTripletStepPropagatorOpposite',
253  ptMin = 0.1
254 )
255 for e in [pp_on_XeXe_2017, pp_on_AA]:
256  e.toModify(mixedTripletStepPropagatorOpposite, ptMin=0.4)
257 highBetaStar_2018.toModify(mixedTripletStepPropagatorOpposite,ptMin = 0.05)
258 
259 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
260 mixedTripletStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
261  ComponentName = 'mixedTripletStepChi2Est',
262  nSigma = 3.0,
263  MaxChi2 = 16.0,
264  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutTight'))
265 )
266 trackingLowPU.toModify(mixedTripletStepChi2Est,
267  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny')
268 )
269 
270 # TRACK BUILDING
272 mixedTripletStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
273  MeasurementTrackerName = '',
274  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('mixedTripletStepTrajectoryFilter')),
275  propagatorAlong = 'mixedTripletStepPropagator',
276  propagatorOpposite = 'mixedTripletStepPropagatorOpposite',
277  maxCand = 2,
278  estimator = 'mixedTripletStepChi2Est',
279  maxDPhiForLooperReconstruction = cms.double(2.0),
280  maxPtForLooperReconstruction = cms.double(0.7)
281 )
282 trackingNoLoopers.toModify(mixedTripletStepTrajectoryBuilder,
283  maxPtForLooperReconstruction = 0.0)
284 # MAKING OF TRACK CANDIDATES
286 # Give handle for CKF for HI
287 _mixedTripletStepTrackCandidatesCkf = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
288  src = 'mixedTripletStepSeeds',
289  clustersToSkip = cms.InputTag('mixedTripletStepClusters'),
290  ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
291  numHitsForSeedCleaner = cms.int32(50),
292  #onlyPixelHitsForSeedCleaner = cms.bool(True),
293 
294  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('mixedTripletStepTrajectoryBuilder')),
295  doSeedingRegionRebuilding = True,
296  useHitsSplitting = True,
297  TrajectoryCleaner = 'mixedTripletStepTrajectoryCleanerBySharedHits'
298 )
299 mixedTripletStepTrackCandidates = _mixedTripletStepTrackCandidatesCkf.clone()
300 
301 from Configuration.ProcessModifiers.trackingMkFitMixedTripletStep_cff import trackingMkFitMixedTripletStep
302 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
303 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
304 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
305 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
306 mixedTripletStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
307  seeds = 'mixedTripletStepSeeds',
308 )
309 mixedTripletStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
310  ComponentName = 'mixedTripletStepTrackCandidatesMkFitConfig',
311  config = 'RecoTracker/MkFit/data/mkfit-phase1-mixedTripletStep.json',
312 )
313 mixedTripletStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
314  seeds = 'mixedTripletStepTrackCandidatesMkFitSeeds',
315  config = ('', 'mixedTripletStepTrackCandidatesMkFitConfig'),
316  clustersToSkip = 'mixedTripletStepClusters',
317 )
318 trackingMkFitMixedTripletStep.toReplaceWith(mixedTripletStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
319  seeds = 'mixedTripletStepSeeds',
320  mkFitSeeds = 'mixedTripletStepTrackCandidatesMkFitSeeds',
321  tracks = 'mixedTripletStepTrackCandidatesMkFit',
322 ))
323 
324 import FastSimulation.Tracking.TrackCandidateProducer_cfi
325 fastSim.toReplaceWith(mixedTripletStepTrackCandidates,
326  FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
327  src = 'mixedTripletStepSeeds',
328  MinNumberOfCrossedLayers = 3,
329  hitMasks = cms.InputTag('mixedTripletStepMasks'),
330  )
331 )
332 
333 
334 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits
335 mixedTripletStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone(
336  ComponentName = 'mixedTripletStepTrajectoryCleanerBySharedHits',
337  fractionShared = 0.11,
338  allowSharedFirstHit = True
339 )
340 trackingLowPU.toModify(mixedTripletStepTrajectoryCleanerBySharedHits, fractionShared = 0.19)
341 
342 
343 # TRACK FITTING
345 mixedTripletStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
346  AlgorithmName = 'mixedTripletStep',
347  src = 'mixedTripletStepTrackCandidates',
348  Fitter = 'FlexibleKFFittingSmoother'
349 )
350 fastSim.toModify(mixedTripletStepTracks, TTRHBuilder = 'WithoutRefit')
351 
352 # TRACK SELECTION AND QUALITY FLAG SETTING.
355 mixedTripletStepClassifier1 = TrackMVAClassifierDetached.clone(
356  src = 'mixedTripletStepTracks',
357  mva = dict(GBRForestLabel = 'MVASelectorIter4_13TeV'),
358  qualityCuts = [-0.5,0.0,0.5]
359 )
360 fastSim.toModify(mixedTripletStepClassifier1, vertices = 'firstStepPrimaryVerticesBeforeMixing')
361 
362 mixedTripletStepClassifier2 = TrackMVAClassifierPrompt.clone(
363  src = 'mixedTripletStepTracks',
364  mva = dict(GBRForestLabel = 'MVASelectorIter0_13TeV'),
365  qualityCuts = [-0.2,-0.2,-0.2]
366 )
367 fastSim.toModify(mixedTripletStepClassifier2,vertices = 'firstStepPrimaryVerticesBeforeMixing')
368 
370 mixedTripletStep = ClassifierMerger.clone(
371  inputClassifiers=['mixedTripletStepClassifier1','mixedTripletStepClassifier2']
372 )
373 trackingPhase1.toReplaceWith(mixedTripletStep, mixedTripletStepClassifier1.clone(
374  mva = dict(GBRForestLabel = 'MVASelectorMixedTripletStep_Phase1'),
375  qualityCuts = [-0.5,0.0,0.5]
376 ))
377 
381 trackdnn.toReplaceWith(mixedTripletStep, trackTfClassifier.clone(
382  src = 'mixedTripletStepTracks',
383  qualityCuts = qualityCutDictionary.MixedTripletStep.value()
384 ))
385 (trackdnn & fastSim).toModify(mixedTripletStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
386 
387 highBetaStar_2018.toModify(mixedTripletStep,qualityCuts = [-0.7,0.0,0.5])
388 pp_on_AA.toModify(mixedTripletStep, qualityCuts = [-0.5,0.0,0.9])
389 
390 # For LowPU
391 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
392 mixedTripletStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
393  src = 'mixedTripletStepTracks',
394  useAnyMVA = cms.bool(False),
395  GBRForestLabel = cms.string('MVASelectorIter4'),
396  trackSelectors = [
397  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
398  name = 'mixedTripletStepVtxLoose',
399  chi2n_par = 1.2,
400  res_par = ( 0.003, 0.001 ),
401  minNumberLayers = 3,
402  maxNumberLostLayers = 1,
403  minNumber3DLayers = 2,
404  d0_par1 = ( 1.2, 3.0 ),
405  dz_par1 = ( 1.2, 3.0 ),
406  d0_par2 = ( 1.3, 3.0 ),
407  dz_par2 = ( 1.3, 3.0 )
408  ),
409  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
410  name = 'mixedTripletStepTrkLoose',
411  chi2n_par = 0.6,
412  res_par = ( 0.003, 0.001 ),
413  minNumberLayers = 4,
414  maxNumberLostLayers = 1,
415  minNumber3DLayers = 3,
416  d0_par1 = ( 1.2, 4.0 ),
417  dz_par1 = ( 1.2, 4.0 ),
418  d0_par2 = ( 1.2, 4.0 ),
419  dz_par2 = ( 1.2, 4.0 )
420  ),
421  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
422  name = 'mixedTripletStepVtxTight',
423  preFilterName = 'mixedTripletStepVtxLoose',
424  chi2n_par = 0.6,
425  res_par = ( 0.003, 0.001 ),
426  minNumberLayers = 3,
427  maxNumberLostLayers = 1,
428  minNumber3DLayers = 3,
429  d0_par1 = ( 1.1, 3.0 ),
430  dz_par1 = ( 1.1, 3.0 ),
431  d0_par2 = ( 1.2, 3.0 ),
432  dz_par2 = ( 1.2, 3.0 )
433  ),
434  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
435  name = 'mixedTripletStepTrkTight',
436  preFilterName = 'mixedTripletStepTrkLoose',
437  chi2n_par = 0.4,
438  res_par = ( 0.003, 0.001 ),
439  minNumberLayers = 5,
440  maxNumberLostLayers = 1,
441  minNumber3DLayers = 4,
442  d0_par1 = ( 1.1, 4.0 ),
443  dz_par1 = ( 1.1, 4.0 ),
444  d0_par2 = ( 1.1, 4.0 ),
445  dz_par2 = ( 1.1, 4.0 )
446  ),
447  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
448  name = 'mixedTripletStepVtx',
449  preFilterName = 'mixedTripletStepVtxTight',
450  chi2n_par = 0.4,
451  res_par = ( 0.003, 0.001 ),
452  minNumberLayers = 3,
453  maxNumberLostLayers = 1,
454  minNumber3DLayers = 3,
455  d0_par1 = ( 1.1, 3.0 ),
456  dz_par1 = ( 1.1, 3.0 ),
457  d0_par2 = ( 1.2, 3.0 ),
458  dz_par2 = ( 1.2, 3.0 )
459  ),
460  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
461  name = 'mixedTripletStepTrk',
462  preFilterName = 'mixedTripletStepTrkTight',
463  chi2n_par = 0.3,
464  res_par = ( 0.003, 0.001 ),
465  minNumberLayers = 5,
466  maxNumberLostLayers = 0,
467  minNumber3DLayers = 4,
468  d0_par1 = ( 0.9, 4.0 ),
469  dz_par1 = ( 0.9, 4.0 ),
470  d0_par2 = ( 0.9, 4.0 ),
471  dz_par2 = ( 0.9, 4.0 )
472  )
473  ] #end of vpset
474 ) #end of clone
475 
476 
477 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
479 _trackListMergerBase = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
480  TrackProducers = ['mixedTripletStepTracks',
481  'mixedTripletStepTracks'],
482  hasSelector = [1,1],
483  selectedTrackQuals = ['mixedTripletStepSelector:mixedTripletStepVtx',
484  'mixedTripletStepSelector:mixedTripletStepTrk'],
485  setsToMerge = [cms.PSet( tLists=cms.vint32(0,1), pQual=cms.bool(True) )],
486  writeOnlyTrkQuals = True
487 )
488 trackingLowPU.toReplaceWith(mixedTripletStep, _trackListMergerBase)
489 
490 
491 
492 MixedTripletStepTask = cms.Task(chargeCut2069Clusters,mixedTripletStepClusters,
493  mixedTripletStepSeedLayersA,
494  mixedTripletStepTrackingRegionsA,
495  mixedTripletStepHitDoubletsA,
496  mixedTripletStepHitTripletsA,
497  mixedTripletStepSeedsA,
498  mixedTripletStepSeedLayersB,
499  mixedTripletStepTrackingRegionsB,
500  mixedTripletStepHitDoubletsB,
501  mixedTripletStepHitTripletsB,
502  mixedTripletStepSeedsB,
503  mixedTripletStepSeeds,
504  mixedTripletStepTrackCandidates,
505  mixedTripletStepTracks,
506  mixedTripletStepClassifier1,mixedTripletStepClassifier2,
507  mixedTripletStep)
508 MixedTripletStep = cms.Sequence(MixedTripletStepTask)
509 
510 _MixedTripletStepTask_trackingMkFit = MixedTripletStepTask.copy()
511 _MixedTripletStepTask_trackingMkFit.add(mixedTripletStepTrackCandidatesMkFitSeeds, mixedTripletStepTrackCandidatesMkFit, mixedTripletStepTrackCandidatesMkFitConfig)
512 trackingMkFitMixedTripletStep.toReplaceWith(MixedTripletStepTask, _MixedTripletStepTask_trackingMkFit)
513 
514 _MixedTripletStepTask_LowPU = MixedTripletStepTask.copyAndExclude([chargeCut2069Clusters, mixedTripletStepClassifier1])
515 _MixedTripletStepTask_LowPU.replace(mixedTripletStepClassifier2, mixedTripletStepSelector)
516 trackingLowPU.toReplaceWith(MixedTripletStepTask, _MixedTripletStepTask_LowPU)
517 
518 #fastsim
519 import FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi
520 mixedTripletStepMasks = FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi.maskProducerFromClusterRemover(mixedTripletStepClusters)
521 mixedTripletStepMasks.oldHitRemovalInfo = cms.InputTag('pixelPairStepMasks')
522 
523 fastSim.toReplaceWith(MixedTripletStepTask,
524  cms.Task(mixedTripletStepMasks
525  ,mixedTripletStepTrackingRegionsA
526  ,mixedTripletStepSeedsA
527  ,mixedTripletStepTrackingRegionsB
528  ,mixedTripletStepSeedsB
529  ,mixedTripletStepSeeds
530  ,mixedTripletStepTrackCandidates
531  ,mixedTripletStepTracks
532  ,mixedTripletStepClassifier1,mixedTripletStepClassifier2
533  ,mixedTripletStep
534  )
535 )