CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LowPtQuadStep_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg
3 from Configuration.Eras.Modifier_fastSim_cff import fastSim
4 
5 #for dnn classifier
6 from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
7 from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary
8 
9 # for no-loopers
10 from Configuration.ProcessModifiers.trackingNoLoopers_cff import trackingNoLoopers
11 
12 # NEW CLUSTERS (remove previously used clusters)
13 lowPtQuadStepClusters = _cfg.clusterRemoverForIter('LowPtQuadStep')
14 for _eraName, _postfix, _era in _cfg.nonDefaultEras():
15  _era.toReplaceWith(lowPtQuadStepClusters, _cfg.clusterRemoverForIter('LowPtQuadStep', _eraName, _postfix))
16 
17 
18 # SEEDING LAYERS
19 import RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi
20 lowPtQuadStepSeedLayers = RecoTracker.TkSeedingLayers.PixelLayerQuadruplets_cfi.PixelLayerQuadruplets.clone(
21  BPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters')),
22  FPix = dict(skipClusters = cms.InputTag('lowPtQuadStepClusters'))
23 )
24 
25 # TrackingRegion
26 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
27 lowPtQuadStepTrackingRegions = _globalTrackingRegionFromBeamSpot.clone(RegionPSet = dict(
28  ptMin = 0.15,
29  originRadius = 0.02,
30  nSigmaZ = 4.0 )
31 )
32 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
33 trackingPhase2PU140.toModify(lowPtQuadStepTrackingRegions, RegionPSet = dict(ptMin = 0.35,originRadius = 0.025))
34 
35 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
36 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
37 from RecoTracker.TkTrackingRegions.globalTrackingRegionWithVertices_cff import globalTrackingRegionWithVertices as _globalTrackingRegionWithVertices
38 (pp_on_XeXe_2017 | pp_on_AA).toReplaceWith(lowPtQuadStepTrackingRegions,
39  _globalTrackingRegionWithVertices.clone(RegionPSet=dict(
40  fixedError = 0.5,
41  ptMin = 0.49,
42  originRadius = 0.02 )
43  )
44 )
45 from Configuration.Eras.Modifier_highBetaStar_2018_cff import highBetaStar_2018
46 highBetaStar_2018.toModify(lowPtQuadStepTrackingRegions,RegionPSet = dict(
47  ptMin = 0.05,
48  originRadius = 0.2, )
49 )
50 
51 # seeding
52 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
53 lowPtQuadStepHitDoublets = _hitPairEDProducer.clone(
54  seedingLayers = 'lowPtQuadStepSeedLayers',
55  trackingRegions = 'lowPtQuadStepTrackingRegions',
56  layerPairs = [0,1,2], # layer pairs (0,1), (1,2), (2,3)
57  maxElement = 50000000,
58  produceIntermediateHitDoublets = True,
59 )
60 from RecoPixelVertexing.PixelTriplets.caHitQuadrupletEDProducer_cfi import caHitQuadrupletEDProducer as _caHitQuadrupletEDProducer
61 from RecoPixelVertexing.PixelTriplets.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
63 import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
64 lowPtQuadStepHitQuadruplets = _caHitQuadrupletEDProducer.clone(
65  doublets = 'lowPtQuadStepHitDoublets',
66  extraHitRPhitolerance = _pixelTripletHLTEDProducer.extraHitRPhitolerance,
67  SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(),
68  maxChi2 = dict(
69  pt1 = 0.7, pt2 = 2,
70  value1 = 1000, value2 = 150,
71  ),
72  useBendingCorrection = True,
73  fitFastCircle = True,
74  fitFastCircleChi2Cut = True,
75  CAThetaCut = 0.0017,
76  CAPhiCut = 0.3,
77 )
78 trackingPhase2PU140.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0015,CAPhiCut = 0.25)
79 highBetaStar_2018.toModify(lowPtQuadStepHitQuadruplets,CAThetaCut = 0.0034,CAPhiCut = 0.6)
80 
81 from RecoTracker.TkSeedGenerator.seedCreatorFromRegionConsecutiveHitsEDProducer_cff import seedCreatorFromRegionConsecutiveHitsEDProducer as _seedCreatorFromRegionConsecutiveHitsEDProducer
82 lowPtQuadStepSeeds = _seedCreatorFromRegionConsecutiveHitsEDProducer.clone(
83  seedingHitSets = 'lowPtQuadStepHitQuadruplets',
84 )
85 
86 #For FastSim phase1 tracking
87 import FastSimulation.Tracking.TrajectorySeedProducer_cfi
88 from FastSimulation.Tracking.SeedingMigration import _hitSetProducerToFactoryPSet
89 _fastSim_lowPtQuadStepSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
90  trackingRegions = 'lowPtQuadStepTrackingRegions',
91  hitMasks = cms.InputTag('lowPtQuadStepMasks'),
92  seedFinderSelector = dict( CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(lowPtQuadStepHitQuadruplets).clone(
93  SeedComparitorPSet = dict(ComponentName = 'none')),
94  layerList = lowPtQuadStepSeedLayers.layerList.value(),
95  #new parameters required for phase1 seeding
96  BPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
97  FPix = dict(TTRHBuilder = 'WithoutRefit', HitProducer = 'TrackingRecHitProducer',),
98  layerPairs = lowPtQuadStepHitDoublets.layerPairs.value()
99  )
100 )
101 fastSim.toReplaceWith(lowPtQuadStepSeeds,_fastSim_lowPtQuadStepSeeds)
102 
103 # QUALITY CUTS DURING TRACK BUILDING
104 import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff
105 _lowPtQuadStepTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
106  minimumNumberOfHits = 3,
107  minPt = 0.075,
108 )
109 lowPtQuadStepTrajectoryFilterBase = _lowPtQuadStepTrajectoryFilterBase.clone(
110  maxCCCLostHits = 0,
111  minGoodStripCharge = dict(refToPSet_ = 'SiStripClusterChargeCutLoose')
112 )
113 trackingPhase2PU140.toReplaceWith(lowPtQuadStepTrajectoryFilterBase, _lowPtQuadStepTrajectoryFilterBase)
114 
115 (pp_on_XeXe_2017 | pp_on_AA).toModify(lowPtQuadStepTrajectoryFilterBase, minPt=0.49)
116 
118 # Composite filter
119 lowPtQuadStepTrajectoryFilter = _TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone(
120  filters = [cms.PSet(refToPSet_ = cms.string('lowPtQuadStepTrajectoryFilterBase'))]
121 )
122 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryFilter,
123  filters = lowPtQuadStepTrajectoryFilter.filters.value() + [cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))]
124 )
125 
126 import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi
127 lowPtQuadStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone(
128  ComponentName = 'lowPtQuadStepChi2Est',
129  nSigma = 3.0,
130  MaxChi2 = 9.0,
131  clusterChargeCut = dict(refToPSet_ = ('SiStripClusterChargeCutTight')),
132 )
133 trackingPhase2PU140.toModify(lowPtQuadStepChi2Est,
134  MaxChi2 = 16.0,
135  clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone')
136 )
137 
138 # TRACK BUILDING
140 lowPtQuadStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
141  MeasurementTrackerName = '',
142  trajectoryFilter = dict(refToPSet_ = 'lowPtQuadStepTrajectoryFilter'),
143  maxCand = 4,
144  estimator = 'lowPtQuadStepChi2Est',
145  maxDPhiForLooperReconstruction = cms.double(2.0),
146  # 0.63 GeV is the maximum pT for a charged particle to loop within the 1.1m radius
147  # of the outermost Tracker barrel layer (with B=3.8T)
148  maxPtForLooperReconstruction = cms.double(0.7)
149 )
150 trackingNoLoopers.toModify(lowPtQuadStepTrajectoryBuilder,
151  maxPtForLooperReconstruction = 0.0)
152 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryBuilder,
153  minNrOfHitsForRebuild = 1,
154  keepOriginalIfRebuildFails = True,
155 )
156 
157 
158 # MAKING OF TRACK CANDIDATES
159 from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits as _trajectoryCleanerBySharedHits
160 lowPtQuadStepTrajectoryCleanerBySharedHits = _trajectoryCleanerBySharedHits.clone(
161  ComponentName = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
162  fractionShared = 0.16,
163  allowSharedFirstHit = True
164 )
165 trackingPhase2PU140.toModify(lowPtQuadStepTrajectoryCleanerBySharedHits, fractionShared = 0.09)
166 
168 lowPtQuadStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
169  src = 'lowPtQuadStepSeeds',
170  ### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
171  numHitsForSeedCleaner = cms.int32(50),
172  onlyPixelHitsForSeedCleaner = cms.bool(True),
173  TrajectoryBuilderPSet = dict(refToPSet_ = 'lowPtQuadStepTrajectoryBuilder'),
174  TrajectoryCleaner = 'lowPtQuadStepTrajectoryCleanerBySharedHits',
175  clustersToSkip = cms.InputTag('lowPtQuadStepClusters'),
176  doSeedingRegionRebuilding = True,
177  useHitsSplitting = True
178 )
179 trackingPhase2PU140.toModify(lowPtQuadStepTrackCandidates,
180  clustersToSkip = None,
181  phase2clustersToSkip = cms.InputTag('lowPtQuadStepClusters')
182 )
183 
184 from Configuration.ProcessModifiers.trackingMkFitLowPtQuadStep_cff import trackingMkFitLowPtQuadStep
185 import RecoTracker.MkFit.mkFitSeedConverter_cfi as mkFitSeedConverter_cfi
186 import RecoTracker.MkFit.mkFitIterationConfigESProducer_cfi as mkFitIterationConfigESProducer_cfi
187 import RecoTracker.MkFit.mkFitProducer_cfi as mkFitProducer_cfi
188 import RecoTracker.MkFit.mkFitOutputConverter_cfi as mkFitOutputConverter_cfi
189 lowPtQuadStepTrackCandidatesMkFitSeeds = mkFitSeedConverter_cfi.mkFitSeedConverter.clone(
190  seeds = 'lowPtQuadStepSeeds',
191 )
192 lowPtQuadStepTrackCandidatesMkFitConfig = mkFitIterationConfigESProducer_cfi.mkFitIterationConfigESProducer.clone(
193  ComponentName = 'lowPtQuadStepTrackCandidatesMkFitConfig',
194  config = 'RecoTracker/MkFit/data/mkfit-phase1-lowPtQuadStep.json',
195 )
196 lowPtQuadStepTrackCandidatesMkFit = mkFitProducer_cfi.mkFitProducer.clone(
197  seeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
198  config = ('', 'lowPtQuadStepTrackCandidatesMkFitConfig'),
199  clustersToSkip = 'lowPtQuadStepClusters',
200 )
201 trackingMkFitLowPtQuadStep.toReplaceWith(lowPtQuadStepTrackCandidates, mkFitOutputConverter_cfi.mkFitOutputConverter.clone(
202  seeds = 'lowPtQuadStepSeeds',
203  mkFitSeeds = 'lowPtQuadStepTrackCandidatesMkFitSeeds',
204  tracks = 'lowPtQuadStepTrackCandidatesMkFit',
205 ))
206 
207 #For FastSim phase1 tracking
208 import FastSimulation.Tracking.TrackCandidateProducer_cfi
209 _fastSim_lowPtQuadStepTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
210  src = 'lowPtQuadStepSeeds',
211  MinNumberOfCrossedLayers = 3,
212  hitMasks = cms.InputTag('lowPtQuadStepMasks')
213 )
214 fastSim.toReplaceWith(lowPtQuadStepTrackCandidates,_fastSim_lowPtQuadStepTrackCandidates)
215 
216 # TRACK FITTING
218 lowPtQuadStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
219  src = 'lowPtQuadStepTrackCandidates',
220  AlgorithmName = 'lowPtQuadStep',
221  Fitter = 'FlexibleKFFittingSmoother',
222 )
223 fastSim.toModify(lowPtQuadStepTracks,TTRHBuilder = 'WithoutRefit')
224 
225 
226 # Final selection
228 lowPtQuadStep = TrackMVAClassifierPrompt.clone(
229  mva = dict(GBRForestLabel = 'MVASelectorLowPtQuadStep_Phase1'),
230  src = 'lowPtQuadStepTracks',
231  qualityCuts = [-0.7,-0.35,-0.15]
232 )
233 
237 trackdnn.toReplaceWith(lowPtQuadStep, trackTfClassifier.clone(
238  src = 'lowPtQuadStepTracks',
239  qualityCuts = qualityCutDictionary.LowPtQuadStep.value()
240 ))
241 highBetaStar_2018.toModify(lowPtQuadStep,qualityCuts = [-0.9,-0.35,-0.15])
242 pp_on_AA.toModify(lowPtQuadStep,
243  mva = dict(GBRForestLabel = 'HIMVASelectorLowPtQuadStep_Phase1'),
244  qualityCuts = [-0.9, -0.4, 0.3],
245 )
246 fastSim.toModify(lowPtQuadStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
247 
248 # For Phase2PU140
249 import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
250 lowPtQuadStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
251  src = 'lowPtQuadStepTracks',
252  trackSelectors = [
253  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
254  name = 'lowPtQuadStepLoose',
255  chi2n_par = 2.0,
256  res_par = ( 0.003, 0.002 ),
257  minNumberLayers = 3,
258  maxNumberLostLayers = 2,
259  minNumber3DLayers = 3,
260  d0_par1 = ( 0.8, 4.0 ),
261  dz_par1 = ( 0.7, 4.0 ),
262  d0_par2 = ( 0.6, 4.0 ),
263  dz_par2 = ( 0.6, 4.0 )
264  ), #end of pset
265  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
266  name = 'lowPtQuadStepTight',
267  preFilterName = 'lowPtQuadStepLoose',
268  chi2n_par = 1.4,
269  res_par = ( 0.003, 0.002 ),
270  minNumberLayers = 3,
271  maxNumberLostLayers = 2,
272  minNumber3DLayers = 3,
273  d0_par1 = ( 0.7, 4.0 ),
274  dz_par1 = ( 0.6, 4.0 ),
275  d0_par2 = ( 0.5, 4.0 ),
276  dz_par2 = ( 0.5, 4.0 )
277  ),
278  RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
279  name = 'lowPtQuadStep',
280  preFilterName = 'lowPtQuadStepTight',
281  min_eta = -4.0,
282  max_eta = 4.0,
283  chi2n_par = 1.2,
284  res_par = ( 0.003, 0.001 ),
285  minNumberLayers = 3,
286  maxNumberLostLayers = 2,
287  minNumber3DLayers = 3,
288  d0_par1 = ( 0.5, 4.0 ),
289  dz_par1 = ( 0.5, 4.0 ),
290  d0_par2 = ( 0.45, 4.0 ),
291  dz_par2 = ( 0.45, 4.0 )
292  ),
293  ] #end of vpset
294 ) #end of clone
295 
296 
297 # Final sequence
298 LowPtQuadStepTask = cms.Task(lowPtQuadStepClusters,
299  lowPtQuadStepSeedLayers,
300  lowPtQuadStepTrackingRegions,
301  lowPtQuadStepHitDoublets,
302  lowPtQuadStepHitQuadruplets,
303  lowPtQuadStepSeeds,
304  lowPtQuadStepTrackCandidates,
305  lowPtQuadStepTracks,
306  lowPtQuadStep)
307 LowPtQuadStep = cms.Sequence(LowPtQuadStepTask)
308 
309 _LowPtQuadStepTask_trackingMkFit = LowPtQuadStepTask.copy()
310 _LowPtQuadStepTask_trackingMkFit.add(lowPtQuadStepTrackCandidatesMkFitSeeds, lowPtQuadStepTrackCandidatesMkFit, lowPtQuadStepTrackCandidatesMkFitConfig)
311 trackingMkFitLowPtQuadStep.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_trackingMkFit)
312 
313 _LowPtQuadStepTask_Phase2PU140 = LowPtQuadStepTask.copy()
314 _LowPtQuadStepTask_Phase2PU140.replace(lowPtQuadStep, lowPtQuadStepSelector)
315 trackingPhase2PU140.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_Phase2PU140)
316 
317 # fast tracking mask producer
318 from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover
319 lowPtQuadStepMasks = maskProducerFromClusterRemover(lowPtQuadStepClusters)
320 fastSim.toReplaceWith(LowPtQuadStepTask,
321  cms.Task(lowPtQuadStepMasks
322  ,lowPtQuadStepTrackingRegions
323  ,lowPtQuadStepSeeds
324  ,lowPtQuadStepTrackCandidates
325  ,lowPtQuadStepTracks
326  ,lowPtQuadStep
327  ) )
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135