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.
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  process.mix.digitizers.pixel.AddPixelInefficiency = cms.bool(True)
79 
80  process=customise_pixelMixing_PU(process)
81  return process
82 
83 
84 # DQM steps change
85 def customise_DQM(process,pileup):
86  # We cut down the number of iterative tracking steps
87  process.dqmoffline_step.remove(process.muonAnalyzer)
88  #process.dqmoffline_step.remove(process.jetMETAnalyzer)
89 
90  #put isUpgrade flag==true
91  process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
92  process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
93  process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
94  process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
95  process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
96  process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
97 
98  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
99  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
100 
101  if pileup>100:
103  else:
105  return process
106 
107 def customise_Validation(process):
108  process.validation_step.remove(process.PixelTrackingRecHitsValid)
109  # We don't run the HLT
110  process.validation_step.remove(process.HLTSusyExoVal)
111  process.validation_step.remove(process.hltHiggsValidator)
112  process.validation_step.remove(process.relvalMuonBits)
113  return process
114 
116 
117  #To allow Tracking to perform special tracking only validation
118  process.trackValidator.label=cms.VInputTag(cms.InputTag("cutsRecoTracksHp"))
119  process.tracksValidationSelectors = cms.Sequence(process.cutsRecoTracksHp)
120  process.globalValidation.remove(process.recoMuonValidation)
121  process.validation.remove(process.recoMuonValidation)
122  process.validation_preprod.remove(process.recoMuonValidation)
123  process.validation_step.remove(process.recoMuonValidation)
124  process.validation.remove(process.globalrechitsanalyze)
125  process.validation_prod.remove(process.globalrechitsanalyze)
126  process.validation_step.remove(process.globalrechitsanalyze)
127  process.validation.remove(process.stripRecHitsValid)
128  process.validation_step.remove(process.stripRecHitsValid)
129  process.validation_step.remove(process.StripTrackingRecHitsValid)
130  process.globalValidation.remove(process.vertexValidation)
131  process.validation.remove(process.vertexValidation)
132  process.validation_step.remove(process.vertexValidation)
133  process.mix.input.nbPileupEvents.averageNumber = cms.double(0.0)
134  process.mix.minBunch = cms.int32(0)
135  process.mix.maxBunch = cms.int32(0)
136  return process
137 
138 def customise_harvesting(process):
139  process.dqmHarvesting.remove(process.jetMETDQMOfflineClient)
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.MeasurementTracker.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.initialStepSelector)
222  process.reconstruction_fromRECO.remove(initialStepTrackCandidates)
223  process.reconstruction_fromRECO.remove(initialStepTracks)
224  process.reconstruction_fromRECO.remove(lowPtTripletStepClusters)
225  process.reconstruction_fromRECO.remove(lowPtTripletStepSeedLayers)
226  process.reconstruction_fromRECO.remove(lowPtTripletStepSeeds)
227  process.reconstruction_fromRECO.remove(lowPtTripletStepSelector)
228  process.reconstruction_fromRECO.remove(lowPtTripletStepTrackCandidates)
229  process.reconstruction_fromRECO.remove(lowPtTripletStepTracks)
230 
231  process.reconstruction_fromRECO.remove(mixedTripletStep)
232  process.reconstruction_fromRECO.remove(mixedTripletStepClusters)
233  process.reconstruction_fromRECO.remove(mixedTripletStepSeedLayersA)
234  process.reconstruction_fromRECO.remove(mixedTripletStepSeedLayersB)
235  process.reconstruction_fromRECO.remove(mixedTripletStepSeeds)
236  process.reconstruction_fromRECO.remove(mixedTripletStepSeedsA)
237  process.reconstruction_fromRECO.remove(mixedTripletStepSeedsB)
238  process.reconstruction_fromRECO.remove(mixedTripletStepSelector)
239  process.reconstruction_fromRECO.remove(mixedTripletStepTrackCandidates)
240  process.reconstruction_fromRECO.remove(mixedTripletStepTracks)
241 
242  process.reconstruction_fromRECO.remove(pixelPairStepClusters)
243  process.reconstruction_fromRECO.remove(pixelPairStepSeeds)
244  process.reconstruction_fromRECO.remove(pixelPairStepSeedLayers)
245  process.reconstruction_fromRECO.remove(pixelPairStepSelector)
246  process.reconstruction_fromRECO.remove(pixelPairStepTrackCandidates)
247  process.reconstruction_fromRECO.remove(pixelPairStepTracks)
248 
249  process.reconstruction_fromRECO.remove(tobTecStepClusters)
250  process.reconstruction_fromRECO.remove(tobTecStepSeeds)
251  #process.reconstruction_fromRECO.remove(tobTecStepSeedLayers)
252  process.reconstruction_fromRECO.remove(tobTecStepSelector)
253  process.reconstruction_fromRECO.remove(tobTecStepTrackCandidates)
254  process.reconstruction_fromRECO.remove(tobTecStepTracks)
255 
256  process.reconstruction_fromRECO.remove(process.convClusters)
257  process.reconstruction_fromRECO.remove(process.convLayerPairs)
258  process.reconstruction_fromRECO.remove(process.convStepSelector)
259  process.reconstruction_fromRECO.remove(process.convTrackCandidates)
260  process.reconstruction_fromRECO.remove(process.convStepTracks)
261  process.reconstruction_fromRECO.remove(process.photonConvTrajSeedFromSingleLeg)
262 
263  # Needed to make the loading of recoFromSimDigis_cff below to work
264  process.InitialStepPreSplitting.remove(siPixelClusters)
265 
266  del process.iterTracking
267  del process.ckftracks
268  del process.ckftracks_woBH
269  del process.ckftracks_wodEdX
270  del process.ckftracks_plus_pixelless
271  del process.trackingGlobalReco
272  del process.electronSeedsSeq
273  del process.InitialStep
274  del process.LowPtTripletStep
275  del process.PixelPairStep
276  del process.DetachedTripletStep
277  del process.MixedTripletStep
278  del process.PixelLessStep
279  del process.TobTecStep
280  del process.earlyGeneralTracks
281  del process.ConvStep
282  # add the correct tracking back in
283  process.load("RecoTracker.Configuration.RecoTrackerPhase1PU"+str(nPU)+"_cff")
284 
285  process.globalreco.insert(itIndex,process.trackingGlobalReco)
286  process.reconstruction.insert(grIndex,process.globalreco)
287  #Note process.reconstruction_fromRECO is broken
288 
289  # End of new tracking configuration which can be removed if new Reconstruction is used.
290 
291 
292  process.reconstruction.remove(process.castorreco)
293  process.reconstruction.remove(process.CastorTowerReco)
294  #process.reconstruction.remove(process.ak7BasicJets)
295  #process.reconstruction.remove(process.ak7CastorJetID)
296 
297  #the quadruplet merger configuration
298  process.load("RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff")
299  process.PixelSeedMergerQuadruplets.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
300  process.PixelSeedMergerQuadruplets.BPix.HitProducer = cms.string("siPixelRecHits" )
301  process.PixelSeedMergerQuadruplets.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
302  process.PixelSeedMergerQuadruplets.FPix.HitProducer = cms.string("siPixelRecHits" )
303 
304  # Need these until pixel templates are used
305  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
306  # PixelCPEGeneric #
307  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
308  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
309  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
310  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
311  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
312  process.PixelCPEGenericESProducer.DoCosmics = False
313  # CPE for other steps
314  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
315  # Turn of template use in tracking (iterative steps handled inside their configs)
316  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
317  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
318  process.muonSeededSeedsInOut.TrackerRecHitBuilder=cms.string('WithTrackAngle')
319  process.muonSeededTracksInOut.TTRHBuilder=cms.string('WithTrackAngle')
320  process.muonSeededTracksOutIn.TTRHBuilder=cms.string('WithTrackAngle')
321  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
322  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
323  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
324  # End of pixel template needed section
325 
326  # Remove, for now, the pre-cluster-splitting clustering step
327  # To be enabled later together with or after the jet core step is enabled
328  # This snippet must be after the loading of recoFromSimDigis_cff
329  process.pixeltrackerlocalreco = cms.Sequence(
330  process.siPixelClusters +
331  process.siPixelRecHits
332  )
333  process.clusterSummaryProducer.pixelClusters = "siPixelClusters"
334  process.reconstruction.replace(process.MeasurementTrackerEventPreSplitting, process.MeasurementTrackerEvent)
335  process.reconstruction.replace(process.siPixelClusterShapeCachePreSplitting, process.siPixelClusterShapeCache)
336 
337  # Enable, for now, pixel tracks and vertices
338  # To be removed later together with the cluster splitting
339  process.reconstruction.replace(process.standalonemuontracking,
340  process.standalonemuontracking+process.recopixelvertexing)
341  process.initialStepSelector.vertices = "pixelVertices"
342  process.highPtTripletStepSelector.vertices = "pixelVertices"
343  process.lowPtQuadStepSelector.vertices = "pixelVertices"
344  process.lowPtTripletStepSelector.vertices = "pixelVertices"
345  process.detachedQuadStepSelector.vertices = "pixelVertices"
346  process.mixedTripletStepSelector.vertices = "pixelVertices"
347  process.pixelPairStepSeeds.RegionFactoryPSet.RegionPSet.VertexCollection = "pixelVertices"
348  process.pixelPairStepSelector.vertices = "pixelVertices"
349  process.tobTecStepSelector.vertices = "pixelVertices"
350  process.muonSeededTracksInOutSelector.vertices = "pixelVertices"
351  process.muonSeededTracksOutInSelector.vertices = "pixelVertices"
352  process.duplicateTrackSelector.vertices = "pixelVertices"
353  process.convStepSelector.vertices = "pixelVertices"
354  process.ak4CaloJetsForTrk.srcPVs = "pixelVertices"
355 
356  # Make pixelTracks use quadruplets
357  process.pixelTracks.SeedMergerPSet = cms.PSet(
358  layerList = cms.PSet(refToPSet_ = cms.string('PixelSeedMergerQuadruplets')),
359  addRemainingTriplets = cms.bool(False),
360  mergeTriplets = cms.bool(True),
361  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
362  )
363  process.pixelTracks.FilterPSet.chi2 = cms.double(50.0)
364  process.pixelTracks.FilterPSet.tipMax = cms.double(0.05)
365  process.pixelTracks.RegionFactoryPSet.RegionPSet.originRadius = cms.double(0.02)
366 
367 
368 
369  return process
def customise_Validation_Trackingonly