CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
phase1TkCustoms.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
5 from SLHCUpgradeSimulations.Configuration.customise_mixing import customise_pixelMixing_PU
6 
7 def customise(process):
8  if hasattr(process,'DigiToRaw'):
9  process=customise_DigiToRaw(process)
10  if hasattr(process,'RawToDigi'):
11  process=customise_RawToDigi(process)
12  n=0
13  if hasattr(process,'reconstruction') or hasattr(process,'dqmoffline_step'):
14  if hasattr(process,'mix'):
15  if hasattr(process.mix,'input'):
16  n=process.mix.input.nbPileupEvents.averageNumber.value()
17  else:
18  print 'phase1TkCustoms requires a --pileup option to cmsDriver to run the reconstruction/dqm'
19  print 'Please provide one!'
20  sys.exit(1)
21  if hasattr(process,'reconstruction'):
22  process=customise_Reco(process,float(n))
23 
24  if hasattr(process,'digitisation_step'):
25  process=customise_Digi(process)
26  if hasattr(process,'dqmoffline_step'):
27  process=customise_DQM(process,n)
28  if hasattr(process,'dqmHarvesting'):
29  process=customise_harvesting(process)
30  if hasattr(process,'validation_step'):
31  process=customise_Validation(process)
32  process=customise_condOverRides(process)
33 
34  return process
35 
36 def customise_DigiToRaw(process):
37  process.digi2raw_step.remove(process.siPixelRawData)
38  process.digi2raw_step.remove(process.castorRawData)
39  return process
40 
41 def customise_RawToDigi(process):
42  process.raw2digi_step.remove(process.siPixelDigis)
43  process.raw2digi_step.remove(process.castorDigis)
44  return process
45 
46 def customise_Digi(process):
47  process.mix.digitizers.pixel.MissCalibrate = False
48  process.mix.digitizers.pixel.LorentzAngle_DB = False
49  process.mix.digitizers.pixel.killModules = False
50  process.mix.digitizers.pixel.useDB = False
51  process.mix.digitizers.pixel.DeadModules_DB = False
52  process.mix.digitizers.pixel.NumPixelBarrel = cms.int32(4)
53  process.mix.digitizers.pixel.NumPixelEndcap = cms.int32(3)
54  process.mix.digitizers.pixel.ThresholdInElectrons_FPix = cms.double(2000.0)
55  process.mix.digitizers.pixel.ThresholdInElectrons_BPix = cms.double(2000.0)
56  process.mix.digitizers.pixel.ThresholdInElectrons_BPix_L1 = cms.double(2000.0)
57  process.mix.digitizers.pixel.thePixelColEfficiency_BPix1 = cms.double(0.999)
58  process.mix.digitizers.pixel.thePixelColEfficiency_BPix2 = cms.double(0.999)
59  process.mix.digitizers.pixel.thePixelColEfficiency_BPix3 = cms.double(0.999)
60  process.mix.digitizers.pixel.thePixelColEfficiency_BPix4 = cms.double(0.999)
61  process.mix.digitizers.pixel.thePixelEfficiency_BPix1 = cms.double(0.999)
62  process.mix.digitizers.pixel.thePixelEfficiency_BPix2 = cms.double(0.999)
63  process.mix.digitizers.pixel.thePixelEfficiency_BPix3 = cms.double(0.999)
64  process.mix.digitizers.pixel.thePixelEfficiency_BPix4 = cms.double(0.999)
65  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix1 = cms.double(0.999)
66  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix2 = cms.double(0.999)
67  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix3 = cms.double(0.999)
68  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix4 = cms.double(0.999)
69  process.mix.digitizers.pixel.thePixelColEfficiency_FPix1 = cms.double(0.999)
70  process.mix.digitizers.pixel.thePixelColEfficiency_FPix2 = cms.double(0.999)
71  process.mix.digitizers.pixel.thePixelColEfficiency_FPix3 = cms.double(0.999)
72  process.mix.digitizers.pixel.thePixelEfficiency_FPix1 = cms.double(0.999)
73  process.mix.digitizers.pixel.thePixelEfficiency_FPix2 = cms.double(0.999)
74  process.mix.digitizers.pixel.thePixelEfficiency_FPix3 = cms.double(0.999)
75  process.mix.digitizers.pixel.thePixelChipEfficiency_FPix1 = cms.double(0.999)
76  process.mix.digitizers.pixel.thePixelChipEfficiency_FPix2 = cms.double(0.999)
77  process.mix.digitizers.pixel.thePixelChipEfficiency_FPix3 = cms.double(0.999)
78 # something broken in the configs above - turn off for now
79  process.mix.digitizers.pixel.AddPixelInefficiency = cms.bool(False)
80 
81  process=customise_pixelMixing_PU(process)
82  return process
83 
84 
85 # DQM steps change
86 def customise_DQM(process,pileup):
87  # We cut down the number of iterative tracking steps
88  process.dqmoffline_step.remove(process.muonAnalyzer)
89  #process.dqmoffline_step.remove(process.jetMETAnalyzer)
90 
91  #put isUpgrade flag==true
92  process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
93  process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
94  process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
95  process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
96  process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
97  process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
98 
99  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
100  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
101 
102  if pileup>100:
104  else:
106  return process
107 
108 def customise_Validation(process):
109  process.validation_step.remove(process.PixelTrackingRecHitsValid)
110  # We don't run the HLT
111  process.validation_step.remove(process.HLTSusyExoVal)
112  process.validation_step.remove(process.hltHiggsValidator)
113  process.validation_step.remove(process.relvalMuonBits)
114  return process
115 
117 
118  #To allow Tracking to perform special tracking only validation
119  process.trackValidator.label=cms.VInputTag(cms.InputTag("cutsRecoTracksHp"))
120  process.tracksValidationSelectors = cms.Sequence(process.cutsRecoTracksHp)
121  process.globalValidation.remove(process.recoMuonValidation)
122  process.validation.remove(process.recoMuonValidation)
123  process.validation_preprod.remove(process.recoMuonValidation)
124  process.validation_step.remove(process.recoMuonValidation)
125  process.validation.remove(process.globalrechitsanalyze)
126  process.validation_prod.remove(process.globalrechitsanalyze)
127  process.validation_step.remove(process.globalrechitsanalyze)
128  process.validation.remove(process.stripRecHitsValid)
129  process.validation_step.remove(process.stripRecHitsValid)
130  process.validation_step.remove(process.StripTrackingRecHitsValid)
131  process.globalValidation.remove(process.vertexValidation)
132  process.validation.remove(process.vertexValidation)
133  process.validation_step.remove(process.vertexValidation)
134  process.mix.input.nbPileupEvents.averageNumber = cms.double(0.0)
135  process.mix.minBunch = cms.int32(0)
136  process.mix.maxBunch = cms.int32(0)
137  return process
138 
139 def customise_harvesting(process):
140  process.dqmHarvesting.remove(process.dataCertificationJetMET)
141  #######process.dqmHarvesting.remove(process.sipixelEDAClient)
142  process.sipixelEDAClient.isUpgrade = cms.untracked.bool(True)
143  process.dqmHarvesting.remove(process.sipixelCertification)
144  return (process)
145 
147 # process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
148 # process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
149 # process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
150 # process.trackerTopologyConstants.pxb_layerMask = cms.uint32(15)
151 # process.trackerTopologyConstants.pxb_ladderMask = cms.uint32(255)
152 # process.trackerTopologyConstants.pxb_moduleMask = cms.uint32(1023)
153 # process.trackerTopologyConstants.pxf_diskStartBit = cms.uint32(18)
154 # process.trackerTopologyConstants.pxf_bladeStartBit = cms.uint32(12)
155 # process.trackerTopologyConstants.pxf_panelStartBit = cms.uint32(10)
156 # process.trackerTopologyConstants.pxf_moduleMask = cms.uint32(255)
157  process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_Phase1_cff')
158  return process
159 
161  #enable modOn
162  process.SiPixelRawDataErrorSource.modOn = cms.untracked.bool(True)
163  process.SiPixelDigiSource.modOn = cms.untracked.bool(True)
164  process.SiPixelClusterSource.modOn = cms.untracked.bool(True)
165  process.SiPixelRecHitSource.modOn = cms.untracked.bool(True)
166  process.SiPixelTrackResidualSource.modOn = cms.untracked.bool(True)
167  process.SiPixelHitEfficiencySource.modOn = cms.untracked.bool(True)
168 
169  return process
170 
171 
172 def remove_pixel_ineff(process):
173  if hasattr(process,'mix'):
174  process.mix.digitizers.pixel.AddPixelInefficiency = cms.bool(False)
175 
176  return process
177 
178 
179 def customise_Reco(process,pileup):
180 
181  #this code supports either 70 or 140 pileup configurations - should fix as to support 0
182  nPU=70
183  if pileup>100: nPU=140
184 
185  #use with latest pixel geometry
186  process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
187  # Need this line to stop error about missing siPixelDigis.
188  process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag()
189 
190  # new layer list (3/4 pixel seeding) in InitialStep and pixelTracks
191  process.PixelLayerTriplets.layerList = cms.vstring( 'BPix1+BPix2+BPix3',
192  'BPix2+BPix3+BPix4',
193  'BPix1+BPix3+BPix4',
194  'BPix1+BPix2+BPix4',
195  'BPix2+BPix3+FPix1_pos',
196  'BPix2+BPix3+FPix1_neg',
197  'BPix1+BPix2+FPix1_pos',
198  'BPix1+BPix2+FPix1_neg',
199  'BPix2+FPix1_pos+FPix2_pos',
200  'BPix2+FPix1_neg+FPix2_neg',
201  'BPix1+FPix1_pos+FPix2_pos',
202  'BPix1+FPix1_neg+FPix2_neg',
203  'FPix1_pos+FPix2_pos+FPix3_pos',
204  'FPix1_neg+FPix2_neg+FPix3_neg' )
205 
206  # New tracking. This is really ugly because it redefines globalreco and reconstruction.
207  # It can be removed if change one line in Configuration/StandardSequences/python/Reconstruction_cff.py
208  # from RecoTracker_cff.py to RecoTrackerPhase1PU140_cff.py
209 
210  # remove all the tracking first
211  itIndex=process.globalreco.index(process.trackingGlobalReco)
212  grIndex=process.reconstruction.index(process.globalreco)
213 
214  process.reconstruction.remove(process.globalreco)
215  process.globalreco.remove(process.iterTracking)
216  process.globalreco.remove(process.electronSeedsSeq)
217  process.reconstruction_fromRECO.remove(process.trackingGlobalReco)
218  process.reconstruction_fromRECO.remove(process.electronSeedsSeq)
219  process.reconstruction_fromRECO.remove(process.initialStepSeedLayers)
220  process.reconstruction_fromRECO.remove(process.initialStepSeeds)
221  process.reconstruction_fromRECO.remove(process.initialStepClassifier1)
222  process.reconstruction_fromRECO.remove(process.initialStepClassifier2)
223  process.reconstruction_fromRECO.remove(process.initialStepClassifier3)
224  process.reconstruction_fromRECO.remove(initialStepTrackCandidates)
225  process.reconstruction_fromRECO.remove(initialStepTracks)
226  process.reconstruction_fromRECO.remove(lowPtTripletStepClusters)
227  process.reconstruction_fromRECO.remove(lowPtTripletStepSeedLayers)
228  process.reconstruction_fromRECO.remove(lowPtTripletStepSeeds)
229  process.reconstruction_fromRECO.remove(lowPtTripletStep)
230  process.reconstruction_fromRECO.remove(lowPtTripletStepTrackCandidates)
231  process.reconstruction_fromRECO.remove(lowPtTripletStepTracks)
232 
233  process.reconstruction_fromRECO.remove(mixedTripletStep)
234  process.reconstruction_fromRECO.remove(mixedTripletStepClusters)
235  process.reconstruction_fromRECO.remove(mixedTripletStepSeedLayersA)
236  process.reconstruction_fromRECO.remove(mixedTripletStepSeedLayersB)
237  process.reconstruction_fromRECO.remove(mixedTripletStepSeeds)
238  process.reconstruction_fromRECO.remove(mixedTripletStepSeedsA)
239  process.reconstruction_fromRECO.remove(mixedTripletStepSeedsB)
240  process.reconstruction_fromRECO.remove(mixedTripletStepClassifier1)
241  process.reconstruction_fromRECO.remove(mixedTripletStepClassifier2)
242  process.reconstruction_fromRECO.remove(mixedTripletStepTrackCandidates)
243  process.reconstruction_fromRECO.remove(mixedTripletStepTracks)
244 
245  process.reconstruction_fromRECO.remove(pixelPairStepClusters)
246  process.reconstruction_fromRECO.remove(pixelPairStepSeeds)
247  process.reconstruction_fromRECO.remove(pixelPairStepSeedLayers)
248  process.reconstruction_fromRECO.remove(pixelPairStep)
249  process.reconstruction_fromRECO.remove(pixelPairStepTrackCandidates)
250  process.reconstruction_fromRECO.remove(pixelPairStepTracks)
251 
252  process.reconstruction_fromRECO.remove(tobTecStepClusters)
253  process.reconstruction_fromRECO.remove(tobTecStepSeeds)
254  #process.reconstruction_fromRECO.remove(tobTecStepSeedLayers)
255  process.reconstruction_fromRECO.remove(tobTecStepClassifier1)
256  process.reconstruction_fromRECO.remove(tobTecStepClassifier2)
257  process.reconstruction_fromRECO.remove(tobTecStep)
258  process.reconstruction_fromRECO.remove(tobTecStepTrackCandidates)
259  process.reconstruction_fromRECO.remove(tobTecStepTracks)
260 
261  # Yes, needs to be done twice for InOut...
262  process.reconstruction_fromRECO.remove(process.muonSeededSeedsInOut)
263  process.reconstruction_fromRECO.remove(process.muonSeededSeedsInOut)
264  process.reconstruction_fromRECO.remove(process.muonSeededTrackCandidatesInOut)
265  process.reconstruction_fromRECO.remove(process.muonSeededTrackCandidatesInOut)
266  process.reconstruction_fromRECO.remove(process.muonSeededTracksInOut)
267  process.reconstruction_fromRECO.remove(process.muonSeededTracksInOut)
268  process.reconstruction_fromRECO.remove(process.muonSeededSeedsOutIn)
269  process.reconstruction_fromRECO.remove(process.muonSeededTrackCandidatesOutIn)
270  process.reconstruction_fromRECO.remove(process.muonSeededTracksOutIn)
271  # Why are these modules in this sequence (isn't iterTracking enough)?
272  process.muonSeededStepCoreDisplaced.remove(process.muonSeededSeedsInOut)
273  process.muonSeededStepCoreDisplaced.remove(process.muonSeededTrackCandidatesInOut)
274  process.muonSeededStepCoreDisplaced.remove(process.muonSeededTracksInOut)
275  process.muonSeededStepCoreDisplaced.remove(process.muonSeededSeedsOutIn)
276  process.muonSeededStepExtraDisplaced.remove(process.muonSeededTracksInOutClassifier)
277 
278  process.reconstruction_fromRECO.remove(process.convClusters)
279  process.reconstruction_fromRECO.remove(process.convLayerPairs)
280  process.reconstruction_fromRECO.remove(process.convStepSelector)
281  process.reconstruction_fromRECO.remove(process.convTrackCandidates)
282  process.reconstruction_fromRECO.remove(process.convStepTracks)
283  process.reconstruction_fromRECO.remove(process.photonConvTrajSeedFromSingleLeg)
284 
285  process.reconstruction_fromRECO.remove(process.preDuplicateMergingGeneralTracks)
286 
287  # Needed to make the loading of recoFromSimDigis_cff below to work
288  process.InitialStepPreSplitting.remove(siPixelClusters)
289 
290  del process.iterTracking
291  del process.ckftracks
292  del process.ckftracks_woBH
293  del process.ckftracks_wodEdX
294  del process.ckftracks_plus_pixelless
295  del process.trackingGlobalReco
296  del process.electronSeedsSeq
297  del process.InitialStep
298  del process.LowPtTripletStep
299  del process.PixelPairStep
300  del process.DetachedTripletStep
301  del process.MixedTripletStep
302  del process.PixelLessStep
303  del process.TobTecStep
304  del process.earlyGeneralTracks
305  del process.muonSeededStep
306  del process.muonSeededStepCore
307  del process.muonSeededStepDebug
308  del process.muonSeededStepDebugDisplaced
309  del process.ConvStep
310  # add the correct tracking back in
311  process.load("RecoTracker.Configuration.RecoTrackerPhase1PU"+str(nPU)+"_cff")
312 
313  process.globalreco.insert(itIndex,process.trackingGlobalReco)
314  process.reconstruction.insert(grIndex,process.globalreco)
315  #Note process.reconstruction_fromRECO is broken
316 
317  # End of new tracking configuration which can be removed if new Reconstruction is used.
318 
319 
320  process.reconstruction.remove(process.castorreco)
321  process.reconstruction.remove(process.CastorTowerReco)
322  process.reconstruction.remove(process.ak5CastorJets)
323  process.reconstruction.remove(process.ak5CastorJetID)
324  process.reconstruction.remove(process.ak7CastorJets)
325  #process.reconstruction.remove(process.ak7BasicJets)
326  process.reconstruction.remove(process.ak7CastorJetID)
327 
328  #the quadruplet merger configuration
329  process.load("RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff")
330  process.PixelSeedMergerQuadruplets.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
331  process.PixelSeedMergerQuadruplets.BPix.HitProducer = cms.string("siPixelRecHits" )
332  process.PixelSeedMergerQuadruplets.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
333  process.PixelSeedMergerQuadruplets.FPix.HitProducer = cms.string("siPixelRecHits" )
334 
335  # Need these until pixel templates are used
336  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
337  # PixelCPEGeneric #
338  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
339  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
340  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
341  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
342  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
343  process.PixelCPEGenericESProducer.DoCosmics = False
344  # CPE for other steps
345  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
346  # Turn of template use in tracking (iterative steps handled inside their configs)
347  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
348  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
349  process.muonSeededSeedsInOut.TrackerRecHitBuilder=cms.string('WithTrackAngle')
350  process.muonSeededTracksInOut.TTRHBuilder=cms.string('WithTrackAngle')
351  process.muonSeededTracksOutIn.TTRHBuilder=cms.string('WithTrackAngle')
352  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
353  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
354  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
355  # End of pixel template needed section
356 
357  # Remove, for now, the pre-cluster-splitting clustering step
358  # To be enabled later together with or after the jet core step is enabled
359  # This snippet must be after the loading of recoFromSimDigis_cff
360  process.pixeltrackerlocalreco = cms.Sequence(
361  process.siPixelClusters +
362  process.siPixelRecHits
363  )
364  process.clusterSummaryProducer.pixelClusters = "siPixelClusters"
365  process.reconstruction.replace(process.MeasurementTrackerEventPreSplitting, process.MeasurementTrackerEvent)
366  process.reconstruction.replace(process.siPixelClusterShapeCachePreSplitting, process.siPixelClusterShapeCache)
367 
368  # Enable, for now, pixel tracks and vertices
369  # To be removed later together with the cluster splitting
370  process.reconstruction.replace(process.standalonemuontracking,
371  process.standalonemuontracking+process.recopixelvertexing)
372  process.initialStepSelector.vertices = "pixelVertices"
373  process.highPtTripletStepSelector.vertices = "pixelVertices"
374  process.lowPtQuadStepSelector.vertices = "pixelVertices"
375  process.lowPtTripletStepSelector.vertices = "pixelVertices"
376  process.detachedQuadStepSelector.vertices = "pixelVertices"
377  process.mixedTripletStepSelector.vertices = "pixelVertices"
378  process.pixelPairStepSeeds.RegionFactoryPSet.RegionPSet.VertexCollection = "pixelVertices"
379  process.pixelPairStepSelector.vertices = "pixelVertices"
380  process.tobTecStepSelector.vertices = "pixelVertices"
381  process.muonSeededTracksInOutSelector.vertices = "pixelVertices"
382  process.muonSeededTracksOutInSelector.vertices = "pixelVertices"
383  process.duplicateTrackClassifier.vertices = "pixelVertices"
384  process.convStepSelector.vertices = "pixelVertices"
385  process.ak4CaloJetsForTrk.srcPVs = "pixelVertices"
386  process.muonSeededTracksOutInDisplacedClassifier.vertices = "pixelVertices"
387  process.duplicateDisplacedTrackClassifier.vertices = "pixelVertices"
388 
389  # Make pixelTracks use quadruplets
390  process.pixelTracks.SeedMergerPSet = cms.PSet(
391  layerList = cms.PSet(refToPSet_ = cms.string('PixelSeedMergerQuadruplets')),
392  addRemainingTriplets = cms.bool(False),
393  mergeTriplets = cms.bool(True),
394  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
395  )
396  process.pixelTracks.FilterPSet.chi2 = cms.double(50.0)
397  process.pixelTracks.FilterPSet.tipMax = cms.double(0.05)
398  process.pixelTracks.RegionFactoryPSet.RegionPSet.originRadius = cms.double(0.02)
399  process.templates.DoLorentz=False
400  process.templates.LoadTemplatesFromDB = cms.bool(False)
401  process.PixelCPEGenericESProducer.useLAWidthFromDB = cms.bool(False)
402 
403  # This probably breaks badly the "displaced muon" reconstruction,
404  # but let's do it for now, until the upgrade tracking sequences
405  # are modernized
406  process.preDuplicateMergingDisplacedTracks.inputClassifiers.remove("muonSeededTracksInOutClassifier")
407  process.preDuplicateMergingDisplacedTracks.trackProducers.remove("muonSeededTracksInOut")
408 
409  return process
def customise_Validation_Trackingonly