CMS 3D CMS Logo

InitialStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016
3 from Configuration.Eras.Modifier_fastSim_cff import fastSim
4 
5 ### STEP 0 ###
6 
7 # hit building
10 
11 # SEEDING LAYERS
13 import RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi
14 initialStepSeedLayers = RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi.PixelLayerTriplets.clone()
15 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
16 trackingPhase1.toModify(initialStepSeedLayers,
17  layerList = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.layerList.value()
18 )
19 trackingPhase2PU140.toModify(initialStepSeedLayers,
20  layerList = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.layerList.value()
21 )
22 
23 # TrackingRegion
24 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
25 initialStepTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
26  ptMin = 0.6,
27  originRadius = 0.02,
28  nSigmaZ = 4.0
29 ))
30 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
31 trackingPhase1.toModify(initialStepTrackingRegions, RegionPSet = dict(ptMin = 0.5))
32 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
33 highBetaStar_2018.toModify(initialStepTrackingRegions,RegionPSet = dict(
34  ptMin = 0.05,
35  originRadius = 0.2
36 ))
37 trackingPhase2PU140.toModify(initialStepTrackingRegions, RegionPSet = dict(ptMin = 0.6,originRadius = 0.03))
38 
39 # seeding
40 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
41 initialStepHitDoublets = _hitPairEDProducer.clone(
42  seedingLayers = "initialStepSeedLayers",
43  trackingRegions = "initialStepTrackingRegions",
44  maxElement = 0,
45  produceIntermediateHitDoublets = True,
46 )
47 from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
49 import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
50 initialStepHitTriplets = _pixelTripletHLTEDProducer.clone(
51  doublets = "initialStepHitDoublets",
52  produceSeedingHitSets = True,
53  SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone()
54 )
55 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
56 initialStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
57  seedingHitSets = "initialStepHitTriplets",
58 )
59 from RecoPixelVertexing.PixelTriplets.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
60 _initialStepCAHitQuadruplets = _caHitQuadrupletEDProducer.clone(
61  doublets = "initialStepHitDoublets",
62  extraHitRPhitolerance = initialStepHitTriplets.extraHitRPhitolerance,
63  SeedComparitorPSet = initialStepHitTriplets.SeedComparitorPSet,
64  maxChi2 = dict(
65  pt1 = 0.7, pt2 = 2,
66  value1 = 200, value2 = 50,
67  ),
68  useBendingCorrection = True,
69  fitFastCircle = True,
70  fitFastCircleChi2Cut = True,
71  CAThetaCut = 0.0012,
72  CAPhiCut = 0.2,
73 )
74 highBetaStar_2018.toModify(_initialStepCAHitQuadruplets,
75  CAThetaCut = 0.0024,
76  CAPhiCut = 0.4
77 )
78 initialStepHitQuadruplets = _initialStepCAHitQuadruplets.clone()
79 
80 trackingPhase1.toModify(initialStepHitDoublets, layerPairs = [0,1,2]) # layer pairs (0,1), (1,2), (2,3)
81 
82 trackingPhase2PU140.toModify(initialStepHitDoublets, layerPairs = [0,1,2]) # layer pairs (0,1), (1,2), (2,3)
83 trackingPhase2PU140.toModify(initialStepHitQuadruplets,
84  CAThetaCut = 0.0010,
85  CAPhiCut = 0.175,
86 )
87 
88 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer_cff import seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer as _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer
89 _initialStepSeedsConsecutiveHitsTripletOnly = _seedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer.clone(
90  seedingHitSets = "initialStepHitTriplets",
91  SeedComparitorPSet = dict(# FIXME: is this defined in any cfi that could be imported instead of copy-paste?
92  ComponentName = 'PixelClusterShapeSeedComparitor',
93  FilterAtHelixStage = cms.bool(False),
94  FilterPixelHits = cms.bool(True),
95  FilterStripHits = cms.bool(False),
96  ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'),
97  ClusterShapeCacheSrc = cms.InputTag('siPixelClusterShapeCache')
98  ),
99 )
100 trackingPhase1.toReplaceWith(initialStepSeeds, _initialStepSeedsConsecutiveHitsTripletOnly.clone(
101  seedingHitSets = "initialStepHitQuadruplets"
102 ))
103 trackingPhase2PU140.toReplaceWith(initialStepSeeds, _initialStepSeedsConsecutiveHitsTripletOnly.clone(
104  seedingHitSets = "initialStepHitQuadruplets"
105 ))
106 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
107 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
108 _fastSim_initialStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
109  trackingRegions = "initialStepTrackingRegions",
110  seedFinderSelector = dict( pixelTripletGeneratorFactory = _hitSetProducerToFactoryPSet(initialStepHitTriplets),
111  layerList = initialStepSeedLayers.layerList.value())
112 )
113 _fastSim_initialStepSeeds.seedFinderSelector.pixelTripletGeneratorFactory.SeedComparitorPSet.ComponentName = "none"
114 #new for phase1
115 trackingPhase1.toModify(_fastSim_initialStepSeeds, seedFinderSelector = dict(
116  pixelTripletGeneratorFactory = None,
117  CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(initialStepHitQuadruplets).clone(SeedComparitorPSet = dict(ComponentName = "none")),
118  #new parameters required for phase1 seeding
119  BPix = dict(
120  TTRHBuilder = 'WithoutRefit',
121  HitProducer = 'TrackingRecHitProducer',
122  ),
123  FPix = dict(
124  TTRHBuilder = 'WithoutRefit',
125  HitProducer = 'TrackingRecHitProducer',
126  ),
127  layerPairs = initialStepHitDoublets.layerPairs.value()
128  )
129 )
130 
131 fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds)
132 
133 
134 # building
136 _initialStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
137  minimumNumberOfHits = 3,
138  minPt = 0.2,
139 )
140 initialStepTrajectoryFilterBase = _initialStepTrajectoryFilterBase.clone(
141  maxCCCLostHits = 0,
142  minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutLoose'))
143 )
144 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
145 _tracker_apv_vfp30_2016.toModify(initialStepTrajectoryFilterBase, maxCCCLostHits = 2)
146 
147 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
148 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
149 for e in [pp_on_XeXe_2017, pp_on_AA_2018]:
150  e.toModify(initialStepTrajectoryFilterBase, minPt=0.6)
151 highBetaStar_2018.toModify(initialStepTrajectoryFilterBase, minPt = 0.05)
152 
153 initialStepTrajectoryFilterInOut = initialStepTrajectoryFilterBase.clone(
154  minimumNumberOfHits = 4,
155  seedExtension = 1,
156  strictSeedExtension = True, # don't allow inactive
157  pixelSeedExtension = True,
158 )
159 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
160 trackingLowPU.toReplaceWith(initialStepTrajectoryFilterBase, _initialStepTrajectoryFilterBase)
161 trackingPhase2PU140.toReplaceWith(initialStepTrajectoryFilterBase, _initialStepTrajectoryFilterBase)
162 
163 import RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeTrajectoryFilter_cfi
164 initialStepTrajectoryFilterShape = RecoPixelVertexing.PixelLowPtUtilities.StripSubClusterShapeTrajectoryFilter_cfi.StripSubClusterShapeTrajectoryFilterTIX12.clone()
165 initialStepTrajectoryFilter = cms.PSet(
166  ComponentType = cms.string('CompositeTrajectoryFilter'),
167  filters = cms.VPSet(
168  cms.PSet( refToPSet_ = cms.string('initialStepTrajectoryFilterBase')),
169  # cms.PSet( refToPSet_ = cms.string('initialStepTrajectoryFilterShape'))
170  ),
171 )
172 
173 trackingPhase2PU140.toReplaceWith(initialStepTrajectoryFilter, TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
174  minimumNumberOfHits = 3,
175  minPt = 0.2
176  )
177 )
178 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
179 initialStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
180  ComponentName = cms.string('initialStepChi2Est'),
181  nSigma = cms.double(3.0),
182  MaxChi2 = cms.double(30.0),
183  clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutLoose')),
184  pTChargeCutThreshold = cms.double(15.)
185 )
186 _tracker_apv_vfp30_2016.toModify(initialStepChi2Est,
187  clusterChargeCut = dict(refToPSet_ = "SiStripClusterChargeCutTiny")
188 )
189 trackingPhase2PU140.toModify(initialStepChi2Est,
190  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone'),
191 )
192 
193 
195 initialStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
196  trajectoryFilter = cms.PSet(refToPSet_ = cms.string('initialStepTrajectoryFilter')),
197  alwaysUseInvalidHits = True,
198  maxCand = 3,
199  estimator = cms.string('initialStepChi2Est'),
200  maxDPhiForLooperReconstruction = cms.double(2.0),
201  maxPtForLooperReconstruction = cms.double(0.7)
202  )
203 trackingLowPU.toModify(initialStepTrajectoryBuilder, maxCand = 5)
204 trackingPhase1.toModify(initialStepTrajectoryBuilder,
205  minNrOfHitsForRebuild = 1,
206  keepOriginalIfRebuildFails = True,
207 )
208 trackingPhase2PU140.toModify(initialStepTrajectoryBuilder,
209  minNrOfHitsForRebuild = 1,
210  keepOriginalIfRebuildFails = True,
211 )
212 
214 initialStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
215  src = cms.InputTag('initialStepSeeds'),
216  ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
217  numHitsForSeedCleaner = cms.int32(50),
218  onlyPixelHitsForSeedCleaner = cms.bool(True),
219  TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('initialStepTrajectoryBuilder')),
220  doSeedingRegionRebuilding = True,
221  useHitsSplitting = True
222  )
223 
224 import FastSimulation.Tracking.TrackCandidateProducer_cfi
225 fastSim.toReplaceWith(initialStepTrackCandidates,
226  FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
227  src = cms.InputTag("initialStepSeeds"),
228  MinNumberOfCrossedLayers = 3
229  ))
230 
231 
232 # fitting
234 initialStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
235  src = 'initialStepTrackCandidates',
236  AlgorithmName = cms.string('initialStep'),
237  Fitter = cms.string('FlexibleKFFittingSmoother')
238  )
239 fastSim.toModify(initialStepTracks, TTRHBuilder = 'WithoutRefit')
240 
241 #vertices
242 from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices as _offlinePrimaryVertices
243 firstStepPrimaryVerticesUnsorted = _offlinePrimaryVertices.clone()
244 firstStepPrimaryVerticesUnsorted.TrackLabel = cms.InputTag("initialStepTracks")
245 firstStepPrimaryVerticesUnsorted.vertexCollections = [_offlinePrimaryVertices.vertexCollections[0].clone()]
246 
247 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
248 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
249 (pp_on_XeXe_2017 | pp_on_AA_2018).toModify(firstStepPrimaryVerticesUnsorted, TkFilterParameters = dict(trackQuality = "any"))
250 
251 # we need a replacment for the firstStepPrimaryVerticesUnsorted
252 # that includes tracker information of signal and pile up
253 # after mixing there is no such thing as initialStepTracks,
254 # so we replace the input collection for firstStepPrimaryVerticesUnsorted with generalTracks
255 firstStepPrimaryVerticesBeforeMixing = firstStepPrimaryVerticesUnsorted.clone()
256 fastSim.toModify(firstStepPrimaryVerticesUnsorted, TrackLabel = "generalTracks")
257 
258 
259 from RecoJets.JetProducers.TracksForJets_cff import trackRefsForJets
260 initialStepTrackRefsForJets = trackRefsForJets.clone(src = cms.InputTag('initialStepTracks'))
261 fastSim.toModify(initialStepTrackRefsForJets, src = "generalTracks")
263 from CommonTools.RecoAlgos.sortedPrimaryVertices_cfi import sortedPrimaryVertices as _sortedPrimaryVertices
264 firstStepPrimaryVertices = _sortedPrimaryVertices.clone(
265  vertices = "firstStepPrimaryVerticesUnsorted",
266  particles = "initialStepTrackRefsForJets",
267 )
268 
269 
270 # Final selection
273 
274 
275 initialStepClassifier1 = TrackMVAClassifierPrompt.clone()
276 initialStepClassifier1.src = 'initialStepTracks'
277 initialStepClassifier1.mva.GBRForestLabel = 'MVASelectorIter0_13TeV'
278 initialStepClassifier1.qualityCuts = [-0.9,-0.8,-0.7]
279 fastSim.toModify(initialStepClassifier1,vertices = "firstStepPrimaryVerticesBeforeMixing")
280 
281 from RecoTracker.IterativeTracking.DetachedTripletStep_cff import detachedTripletStepClassifier1
282 from RecoTracker.IterativeTracking.LowPtTripletStep_cff import lowPtTripletStep
283 initialStepClassifier2 = detachedTripletStepClassifier1.clone()
284 initialStepClassifier2.src = 'initialStepTracks'
285 fastSim.toModify(initialStepClassifier2,vertices = "firstStepPrimaryVerticesBeforeMixing")
286 initialStepClassifier3 = lowPtTripletStep.clone()
287 initialStepClassifier3.src = 'initialStepTracks'
288 fastSim.toModify(initialStepClassifier3,vertices = "firstStepPrimaryVerticesBeforeMixing")
289 
291 initialStep = ClassifierMerger.clone()
292 initialStep.inputClassifiers=['initialStepClassifier1','initialStepClassifier2','initialStepClassifier3']
293 
294 trackingPhase1.toReplaceWith(initialStep, initialStepClassifier1.clone(
295  mva = dict(GBRForestLabel = 'MVASelectorInitialStep_Phase1'),
296  qualityCuts = [-0.95,-0.85,-0.75],
297 ))
298 
299 pp_on_AA_2018.toModify(initialStep,
300  mva = dict(GBRForestLabel = 'HIMVASelectorInitialStep_Phase1'),
301  qualityCuts = [-0.9, -0.5, 0.2],
302 )
303 
304 # For LowPU and Phase2PU140
305 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
306 initialStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
307  src = 'initialStepTracks',
308  useAnyMVA = cms.bool(False),
309  GBRForestLabel = cms.string('MVASelectorIter0'),
310  trackSelectors = [
311  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
312  name = 'initialStepLoose',
313  ), #end of pset
314  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
315  name = 'initialStepTight',
316  preFilterName = 'initialStepLoose',
317  ),
318  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
319  name = 'QualityMasks',
320  preFilterName = 'initialStepTight',
321  ),
322  ] #end of vpset
323 ) #end of clone
324 trackingPhase2PU140.toModify(initialStepSelector,
325  useAnyMVA = None,
326  GBRForestLabel = None,
327  trackSelectors= cms.VPSet(
328  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
329  name = 'initialStepLoose',
330  chi2n_par = 2.0,
331  res_par = ( 0.003, 0.002 ),
332  minNumberLayers = 3,
333  maxNumberLostLayers = 3,
334  minNumber3DLayers = 3,
335  d0_par1 = ( 0.8, 4.0 ),
336  dz_par1 = ( 0.9, 4.0 ),
337  d0_par2 = ( 0.6, 4.0 ),
338  dz_par2 = ( 0.8, 4.0 )
339  ), #end of pset
340  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
341  name = 'initialStepTight',
342  preFilterName = 'initialStepLoose',
343  chi2n_par = 1.4,
344  res_par = ( 0.003, 0.002 ),
345  minNumberLayers = 3,
346  maxNumberLostLayers = 2,
347  minNumber3DLayers = 3,
348  d0_par1 = ( 0.7, 4.0 ),
349  dz_par1 = ( 0.8, 4.0 ),
350  d0_par2 = ( 0.5, 4.0 ),
351  dz_par2 = ( 0.7, 4.0 )
352  ),
353  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
354  name = 'initialStep',
355  preFilterName = 'initialStepTight',
356  chi2n_par = 1.2,
357  res_par = ( 0.003, 0.001 ),
358  minNumberLayers = 3,
359  maxNumberLostLayers = 2,
360  minNumber3DLayers = 3,
361  d0_par1 = ( 0.6, 4.0 ),
362  dz_par1 = ( 0.7, 4.0 ),
363  d0_par2 = ( 0.45, 4.0 ),
364  dz_par2 = ( 0.55, 4.0 )
365  ),
366  ), #end of vpset
367 ) #end of clone
368 
369 
370 
371 # Final sequence
372 InitialStepTask = cms.Task(initialStepSeedLayers,
373  initialStepTrackingRegions,
374  initialStepHitDoublets,
375  initialStepHitTriplets,
376  initialStepSeeds,
377  initialStepTrackCandidates,
378  initialStepTracks,
379  firstStepPrimaryVerticesUnsorted,
380  initialStepTrackRefsForJets,
381  firstStepPrimaryVertices,
382  initialStepClassifier1,initialStepClassifier2,initialStepClassifier3,
383  initialStep,caloJetsForTrkTask)
384 InitialStep = cms.Sequence(InitialStepTask)
385 
386 _InitialStepTask_LowPU = InitialStepTask.copyAndExclude([firstStepPrimaryVerticesUnsorted, initialStepTrackRefsForJets, caloJetsForTrkTask, firstStepPrimaryVertices, initialStepClassifier1, initialStepClassifier2, initialStepClassifier3])
387 _InitialStepTask_LowPU.replace(initialStep, initialStepSelector)
388 trackingLowPU.toReplaceWith(InitialStepTask, _InitialStepTask_LowPU)
389 
390 _InitialStepTask_Phase1 = InitialStepTask.copyAndExclude([initialStepClassifier2, initialStepClassifier3])
391 _InitialStepTask_Phase1.replace(initialStepHitTriplets, initialStepHitQuadruplets)
392 trackingPhase1.toReplaceWith(InitialStepTask, _InitialStepTask_Phase1)
393 
394 _InitialStepTask_trackingPhase2 = InitialStepTask.copyAndExclude([initialStepClassifier1, initialStepClassifier2, initialStepClassifier3])
395 _InitialStepTask_trackingPhase2.replace(initialStepHitTriplets, initialStepHitQuadruplets)
396 _InitialStepTask_trackingPhase2.replace(initialStep, initialStepSelector)
397 trackingPhase2PU140.toReplaceWith(InitialStepTask, _InitialStepTask_trackingPhase2)
398 
399 from Configuration.Eras.Modifier_fastSim_cff import fastSim
400 _InitialStepTask_fastSim = cms.Task(initialStepTrackingRegions
401  ,initialStepSeeds
402  ,initialStepTrackCandidates
403  ,initialStepTracks
404  ,firstStepPrimaryVerticesBeforeMixing
405  ,initialStepClassifier1,initialStepClassifier2,initialStepClassifier3
406  ,initialStep
407  )
408 fastSim.toReplaceWith(InitialStepTask, _InitialStepTask_fastSim)
COSMIC RUN SETTING.
def _hitSetProducerToFactoryPSet(producer)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135