CMS 3D CMS Logo

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