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.dataCertificationJetMET)
130  ###process.dqmHarvesting.remove(process.sipixelEDAClient)
131  process.sipixelEDAClient.isUpgrade = cms.untracked.bool(True)
132  process.dqmHarvesting.remove(process.sipixelCertification)
133  return (process)
134 
136 # process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_Phase1_R30F12_cff')
137  return process
138 
140  #enable modOn
141  process.SiPixelRawDataErrorSource.modOn = cms.untracked.bool(True)
142  process.SiPixelDigiSource.modOn = cms.untracked.bool(True)
143  process.SiPixelClusterSource.modOn = cms.untracked.bool(True)
144  process.SiPixelRecHitSource.modOn = cms.untracked.bool(True)
145  process.SiPixelTrackResidualSource.modOn = cms.untracked.bool(True)
146  process.SiPixelHitEfficiencySource.modOn = cms.untracked.bool(True)
147 
148  return process
149 
150 
151 def remove_pixel_ineff(process):
152  if hasattr(process,'mix'):
153  process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(False)
154 
155  return process
156 
157 
158 def customise_Reco(process,pileup):
159 
160  #this code supports either 70 or 140 pileup configurations - should fix as to support 0
161  nPU=70
162  if pileup>100: nPU=140
163 
164  #use with latest pixel geometry
165  process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
166  # Need this line to stop error about missing siPixelDigis.
167  process.MeasurementTracker.inactivePixelDetectorLabels = cms.VInputTag()
168 
169  # new layer list (3/4 pixel seeding) in InitialStep and pixelTracks
170  process.PixelLayerTriplets.layerList = cms.vstring( 'BPix1+BPix2+BPix3',
171  'BPix2+BPix3+BPix4',
172  'BPix1+BPix3+BPix4',
173  'BPix1+BPix2+BPix4',
174  'BPix2+BPix3+FPix1_pos',
175  'BPix2+BPix3+FPix1_neg',
176  'BPix1+BPix2+FPix1_pos',
177  'BPix1+BPix2+FPix1_neg',
178  'BPix2+FPix1_pos+FPix2_pos',
179  'BPix2+FPix1_neg+FPix2_neg',
180  'BPix1+FPix1_pos+FPix2_pos',
181  'BPix1+FPix1_neg+FPix2_neg',
182  'FPix1_pos+FPix2_pos+FPix3_pos',
183  'FPix1_neg+FPix2_neg+FPix3_neg' )
184 
185  # New tracking. This is really ugly because it redefines globalreco and reconstruction.
186  # It can be removed if change one line in Configuration/StandardSequences/python/Reconstruction_cff.py
187  # from RecoTracker_cff.py to RecoTrackerPhase1PU140_cff.py
188 
189  # remove all the tracking first
190  itIndex=process.globalreco.index(process.trackingGlobalReco)
191  grIndex=process.reconstruction.index(process.globalreco)
192 
193  process.reconstruction.remove(process.globalreco)
194  process.globalreco.remove(process.iterTracking)
195  process.globalreco.remove(process.electronSeedsSeq)
196  process.reconstruction_fromRECO.remove(process.trackingGlobalReco)
197  del process.iterTracking
198  del process.ckftracks
199  del process.ckftracks_woBH
200  del process.ckftracks_wodEdX
201  del process.ckftracks_plus_pixelless
202  del process.trackingGlobalReco
203  del process.electronSeedsSeq
204  del process.InitialStep
205  del process.LowPtTripletStep
206  del process.PixelPairStep
207  del process.DetachedTripletStep
208  del process.MixedTripletStep
209  del process.PixelLessStep
210  del process.TobTecStep
211  del process.earlyGeneralTracks
212  del process.ConvStep
213  # add the correct tracking back in
214  process.load("RecoTracker.Configuration.RecoTrackerPhase1PU"+str(nPU)+"_cff")
215 
216  process.globalreco.insert(itIndex,process.trackingGlobalReco)
217  process.reconstruction.insert(grIndex,process.globalreco)
218  #Note process.reconstruction_fromRECO is broken
219 
220  # End of new tracking configuration which can be removed if new Reconstruction is used.
221 
222 
223  process.reconstruction.remove(process.castorreco)
224  process.reconstruction.remove(process.CastorTowerReco)
225  process.reconstruction.remove(process.ak7CastorJets)
226  process.reconstruction.remove(process.ak7CastorJetID)
227 
228  #the quadruplet merger configuration
229  # from this PSet the quadruplet merger uses only the layer list so these could probably be removed
230  from RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff import PixelSeedMergerQuadruplets
231  PixelSeedMergerQuadruplets.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
232  PixelSeedMergerQuadruplets.BPix.HitProducer = cms.string("siPixelRecHits" )
233  PixelSeedMergerQuadruplets.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
234  PixelSeedMergerQuadruplets.FPix.HitProducer = cms.string("siPixelRecHits" )
235 
236  # Need these until pixel templates are used
237  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
238  # PixelCPEGeneric #
239  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
240  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
241  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
242  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
243  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
244  process.PixelCPEGenericESProducer.DoCosmics = False
245  # CPE for other steps
246  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
247  # Turn of template use in tracking (iterative steps handled inside their configs)
248  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
249  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
250  process.muonSeededSeedsInOut.TrackerRecHitBuilder=cms.string('WithTrackAngle')
251  process.muonSeededTracksInOut.TTRHBuilder=cms.string('WithTrackAngle')
252  process.muonSeededTracksOutIn.TTRHBuilder=cms.string('WithTrackAngle')
253  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
254  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
255  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
256  # End of pixel template needed section
257 
258  # Make pixelTracks use quadruplets
259  process.pixelTracks.SeedMergerPSet = cms.PSet(
260  layerList = PixelSeedMergerQuadruplets,
261  addRemainingTriplets = cms.bool(False),
262  mergeTriplets = cms.bool(True),
263  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
264  )
265  process.pixelTracks.FilterPSet.chi2 = cms.double(50.0)
266  process.pixelTracks.FilterPSet.tipMax = cms.double(0.05)
267  process.pixelTracks.RegionFactoryPSet.RegionPSet.originRadius = cms.double(0.02)
268 
269 
270 
271  return process