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 # For LowPU and Phase2PU140
300 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
301 initialStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
302  src = 'initialStepTracks',
303  useAnyMVA = cms.bool(False),
304  GBRForestLabel = cms.string('MVASelectorIter0'),
305  trackSelectors = [
306  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
307  name = 'initialStepLoose',
308  ), #end of pset
309  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
310  name = 'initialStepTight',
311  preFilterName = 'initialStepLoose',
312  ),
313  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
314  name = 'QualityMasks',
315  preFilterName = 'initialStepTight',
316  ),
317  ] #end of vpset
318 ) #end of clone
319 trackingPhase2PU140.toModify(initialStepSelector,
320  useAnyMVA = None,
321  GBRForestLabel = None,
322  trackSelectors= cms.VPSet(
323  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
324  name = 'initialStepLoose',
325  chi2n_par = 2.0,
326  res_par = ( 0.003, 0.002 ),
327  minNumberLayers = 3,
328  maxNumberLostLayers = 3,
329  minNumber3DLayers = 3,
330  d0_par1 = ( 0.8, 4.0 ),
331  dz_par1 = ( 0.9, 4.0 ),
332  d0_par2 = ( 0.6, 4.0 ),
333  dz_par2 = ( 0.8, 4.0 )
334  ), #end of pset
335  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
336  name = 'initialStepTight',
337  preFilterName = 'initialStepLoose',
338  chi2n_par = 1.4,
339  res_par = ( 0.003, 0.002 ),
340  minNumberLayers = 3,
341  maxNumberLostLayers = 2,
342  minNumber3DLayers = 3,
343  d0_par1 = ( 0.7, 4.0 ),
344  dz_par1 = ( 0.8, 4.0 ),
345  d0_par2 = ( 0.5, 4.0 ),
346  dz_par2 = ( 0.7, 4.0 )
347  ),
348  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
349  name = 'initialStep',
350  preFilterName = 'initialStepTight',
351  chi2n_par = 1.2,
352  res_par = ( 0.003, 0.001 ),
353  minNumberLayers = 3,
354  maxNumberLostLayers = 2,
355  minNumber3DLayers = 3,
356  d0_par1 = ( 0.6, 4.0 ),
357  dz_par1 = ( 0.7, 4.0 ),
358  d0_par2 = ( 0.45, 4.0 ),
359  dz_par2 = ( 0.55, 4.0 )
360  ),
361  ), #end of vpset
362 ) #end of clone
363 
364 
365 
366 # Final sequence
367 InitialStepTask = cms.Task(initialStepSeedLayers,
368  initialStepTrackingRegions,
369  initialStepHitDoublets,
370  initialStepHitTriplets,
371  initialStepSeeds,
372  initialStepTrackCandidates,
373  initialStepTracks,
374  firstStepPrimaryVerticesUnsorted,
375  initialStepTrackRefsForJets,
376  firstStepPrimaryVertices,
377  initialStepClassifier1,initialStepClassifier2,initialStepClassifier3,
378  initialStep,caloJetsForTrkTask)
379 InitialStep = cms.Sequence(InitialStepTask)
380 
381 _InitialStepTask_LowPU = InitialStepTask.copyAndExclude([firstStepPrimaryVerticesUnsorted, initialStepTrackRefsForJets, caloJetsForTrkTask, firstStepPrimaryVertices, initialStepClassifier1, initialStepClassifier2, initialStepClassifier3])
382 _InitialStepTask_LowPU.replace(initialStep, initialStepSelector)
383 trackingLowPU.toReplaceWith(InitialStepTask, _InitialStepTask_LowPU)
384 
385 _InitialStepTask_Phase1 = InitialStepTask.copyAndExclude([initialStepClassifier2, initialStepClassifier3])
386 _InitialStepTask_Phase1.replace(initialStepHitTriplets, initialStepHitQuadruplets)
387 trackingPhase1.toReplaceWith(InitialStepTask, _InitialStepTask_Phase1)
388 
389 _InitialStepTask_trackingPhase2 = InitialStepTask.copyAndExclude([initialStepClassifier1, initialStepClassifier2, initialStepClassifier3])
390 _InitialStepTask_trackingPhase2.replace(initialStepHitTriplets, initialStepHitQuadruplets)
391 _InitialStepTask_trackingPhase2.replace(initialStep, initialStepSelector)
392 trackingPhase2PU140.toReplaceWith(InitialStepTask, _InitialStepTask_trackingPhase2)
393 
394 from Configuration.Eras.Modifier_fastSim_cff import fastSim
395 _InitialStepTask_fastSim = cms.Task(initialStepTrackingRegions
396  ,initialStepSeeds
397  ,initialStepTrackCandidates
398  ,initialStepTracks
399  ,firstStepPrimaryVerticesBeforeMixing
400  ,initialStepClassifier1,initialStepClassifier2,initialStepClassifier3
401  ,initialStep
402  )
403 fastSim.toReplaceWith(InitialStepTask, _InitialStepTask_fastSim)
COSMIC RUN SETTING.
def _hitSetProducerToFactoryPSet(producer)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135