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,float(n))
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_BPix4 = cms.double(0.999)
58  process.mix.digitizers.pixel.thePixelEfficiency_BPix4 = cms.double(0.999)
59  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix4 = cms.double(0.999)
60  process.mix.digitizers.pixel.thePixelColEfficiency_FPix3 = cms.double(0.999)
61  process.mix.digitizers.pixel.thePixelEfficiency_FPix3 = cms.double(0.999)
62  process.mix.digitizers.pixel.thePixelChipEfficiency_FPix3 = cms.double(0.999)
63  process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(True)
64 
65  process=customise_pixelMixing_PU(process)
66  return process
67 
68 
69 # DQM steps change
70 def customise_DQM(process,pileup):
71  # We cut down the number of iterative tracking steps
72 # process.dqmoffline_step.remove(process.TrackMonStep3)
73 # process.dqmoffline_step.remove(process.TrackMonStep4)
74 # process.dqmoffline_step.remove(process.TrackMonStep5)
75 # process.dqmoffline_step.remove(process.TrackMonStep6)
76  #
77  process.dqmoffline_step.remove(process.muonAnalyzer)
78  process.dqmoffline_step.remove(process.jetMETAnalyzer)
79 # process.dqmoffline_step.remove(process.TrackMonStep9)
80 # process.dqmoffline_step.remove(process.TrackMonStep10)
81 # process.dqmoffline_step.remove(process.PixelTrackingRecHitsValid)
82 
83  #put isUpgrade flag==true
84  process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
85  process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
86  process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
87  process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
88  process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
89  process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
90 
91  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
92  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
93 
94  if pileup>100:
96  else:
98  return process
99 
100 def customise_Validation(process,pileup):
101  process.validation_step.remove(process.PixelTrackingRecHitsValid)
102  # We don't run the HLT
103  process.validation_step.remove(process.HLTSusyExoVal)
104  process.validation_step.remove(process.hltHiggsValidator)
105  process.validation_step.remove(process.relvalMuonBits)
106  if pileup>30:
107  process.trackValidator.label=cms.VInputTag(cms.InputTag("cutsRecoTracksHp"))
108  process.tracksValidationSelectors = cms.Sequence(process.cutsRecoTracksHp)
109  process.globalValidation.remove(process.recoMuonValidation)
110  process.validation.remove(process.recoMuonValidation)
111  process.validation_preprod.remove(process.recoMuonValidation)
112  process.validation_step.remove(process.recoMuonValidation)
113  process.validation.remove(process.globalrechitsanalyze)
114  process.validation_prod.remove(process.globalrechitsanalyze)
115  process.validation_step.remove(process.globalrechitsanalyze)
116  process.validation.remove(process.stripRecHitsValid)
117  process.validation_step.remove(process.stripRecHitsValid)
118  process.validation_step.remove(process.StripTrackingRecHitsValid)
119  process.globalValidation.remove(process.vertexValidation)
120  process.validation.remove(process.vertexValidation)
121  process.validation_step.remove(process.vertexValidation)
122  process.mix.input.nbPileupEvents.averageNumber = cms.double(0.0)
123  process.mix.minBunch = cms.int32(0)
124  process.mix.maxBunch = cms.int32(0)
125 
126  return process
127 
128 def customise_harvesting(process):
129  process.dqmHarvesting.remove(process.jetMETDQMOfflineClient)
130  process.dqmHarvesting.remove(process.dataCertificationJetMET)
131  process.dqmHarvesting.remove(process.sipixelEDAClient)
132  process.dqmHarvesting.remove(process.sipixelCertification)
133  return (process)
134 
136 # process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_Phase1_R30F12_cff')
137  process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
138  process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
139  process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
140  process.trackerTopologyConstants.pxb_layerMask = cms.uint32(15)
141  process.trackerTopologyConstants.pxb_ladderMask = cms.uint32(255)
142  process.trackerTopologyConstants.pxb_moduleMask = cms.uint32(1023)
143  process.trackerTopologyConstants.pxf_diskStartBit = cms.uint32(18)
144  process.trackerTopologyConstants.pxf_bladeStartBit = cms.uint32(12)
145  process.trackerTopologyConstants.pxf_panelStartBit = cms.uint32(10)
146  process.trackerTopologyConstants.pxf_moduleMask = cms.uint32(255)
147  return process
148 
150  #enable modOn
151  process.SiPixelRawDataErrorSource.modOn = cms.untracked.bool(True)
152  process.SiPixelDigiSource.modOn = cms.untracked.bool(True)
153  process.SiPixelClusterSource.modOn = cms.untracked.bool(True)
154  process.SiPixelRecHitSource.modOn = cms.untracked.bool(True)
155  process.SiPixelTrackResidualSource.modOn = cms.untracked.bool(True)
156  process.SiPixelHitEfficiencySource.modOn = cms.untracked.bool(True)
157 
158  return process
159 
160 
161 def remove_pixel_ineff(process):
162  if hasattr(process,'mix'):
163  process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(False)
164 
165  return process
166 
167 
168 def customise_Reco(process,pileup):
169 
170  #this code supports either 70 or 140 pileup configurations - should fix as to support 0
171  nPU=70
172  if pileup>100: nPU=140
173 
174  #use with latest pixel geometry
175  process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
176  # Need this line to stop error about missing siPixelDigis.
177  process.MeasurementTracker.inactivePixelDetectorLabels = cms.VInputTag()
178 
179  # new layer list (3/4 pixel seeding) in InitialStep and pixelTracks
180  process.PixelLayerTriplets.layerList = cms.vstring( 'BPix1+BPix2+BPix3',
181  'BPix2+BPix3+BPix4',
182  'BPix1+BPix3+BPix4',
183  'BPix1+BPix2+BPix4',
184  'BPix2+BPix3+FPix1_pos',
185  'BPix2+BPix3+FPix1_neg',
186  'BPix1+BPix2+FPix1_pos',
187  'BPix1+BPix2+FPix1_neg',
188  'BPix2+FPix1_pos+FPix2_pos',
189  'BPix2+FPix1_neg+FPix2_neg',
190  'BPix1+FPix1_pos+FPix2_pos',
191  'BPix1+FPix1_neg+FPix2_neg',
192  'FPix1_pos+FPix2_pos+FPix3_pos',
193  'FPix1_neg+FPix2_neg+FPix3_neg' )
194 
195  # New tracking. This is really ugly because it redefines globalreco and reconstruction.
196  # It can be removed if change one line in Configuration/StandardSequences/python/Reconstruction_cff.py
197  # from RecoTracker_cff.py to RecoTrackerPhase1PU140_cff.py
198 
199  # remove all the tracking first
200  itIndex=process.globalreco.index(process.trackingGlobalReco)
201  grIndex=process.reconstruction.index(process.globalreco)
202 
203  process.reconstruction.remove(process.globalreco)
204  process.globalreco.remove(process.iterTracking)
205  process.globalreco.remove(process.electronSeedsSeq)
206  process.reconstruction_fromRECO.remove(process.trackingGlobalReco)
207  del process.iterTracking
208  del process.ckftracks
209  del process.ckftracks_woBH
210  del process.ckftracks_wodEdX
211  del process.ckftracks_plus_pixelless
212  del process.trackingGlobalReco
213  del process.electronSeedsSeq
214  del process.InitialStep
215  del process.LowPtTripletStep
216  del process.PixelPairStep
217  del process.DetachedTripletStep
218  del process.MixedTripletStep
219  del process.PixelLessStep
220  del process.TobTecStep
221  del process.earlyGeneralTracks
222  del process.ConvStep
223  # add the correct tracking back in
224  process.load("RecoTracker.Configuration.RecoTrackerPhase1PU"+str(nPU)+"_cff")
225 
226  process.globalreco.insert(itIndex,process.trackingGlobalReco)
227  process.reconstruction.insert(grIndex,process.globalreco)
228  #Note process.reconstruction_fromRECO is broken
229 
230  # End of new tracking configuration which can be removed if new Reconstruction is used.
231 
232 
233  process.reconstruction.remove(process.castorreco)
234  process.reconstruction.remove(process.CastorTowerReco)
235  process.reconstruction.remove(process.ak7BasicJets)
236  process.reconstruction.remove(process.ak7CastorJetID)
237 
238  #the quadruplet merger configuration
239  # from this PSet the quadruplet merger uses only the layer list so these could probably be removed
240  from RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff import PixelSeedMergerQuadruplets
241  PixelSeedMergerQuadruplets.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
242  PixelSeedMergerQuadruplets.BPix.HitProducer = cms.string("siPixelRecHits" )
243  PixelSeedMergerQuadruplets.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
244  PixelSeedMergerQuadruplets.FPix.HitProducer = cms.string("siPixelRecHits" )
245 
246  # Need these until pixel templates are used
247  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
248  # PixelCPEGeneric #
249  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
250  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
251  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
252  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
253  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
254  process.PixelCPEGenericESProducer.DoCosmics = False
255  # CPE for other steps
256  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
257  # Turn of template use in tracking (iterative steps handled inside their configs)
258  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
259  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
260  process.muonSeededSeedsInOut.TrackerRecHitBuilder=cms.string('WithTrackAngle')
261  process.muonSeededTracksInOut.TTRHBuilder=cms.string('WithTrackAngle')
262  process.muonSeededTracksOutIn.TTRHBuilder=cms.string('WithTrackAngle')
263  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
264  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
265  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
266  # End of pixel template needed section
267 
268  # Make pixelTracks use quadruplets
269  process.pixelTracks.SeedMergerPSet = cms.PSet(
270  layerList = PixelSeedMergerQuadruplets,
271  addRemainingTriplets = cms.bool(False),
272  mergeTriplets = cms.bool(True),
273  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
274  )
275  process.pixelTracks.FilterPSet.chi2 = cms.double(50.0)
276  process.pixelTracks.FilterPSet.tipMax = cms.double(0.05)
277  process.pixelTracks.RegionFactoryPSet.RegionPSet.originRadius = cms.double(0.02)
278 
279 
280 
281  return process