CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
phase2TkCustomsBE.py
Go to the documentation of this file.
2 #GEN-SIM so far...
3 def customise(process):
4  if hasattr(process,'DigiToRaw'):
5  process=customise_DigiToRaw(process)
6  if hasattr(process,'RawToDigi'):
7  process=customise_RawToDigi(process)
8  n=0
9  if hasattr(process,'reconstruction') or hasattr(process,'dqmoffline_step'):
10  if hasattr(process,'mix'):
11  if hasattr(process.mix,'input'):
12  n=process.mix.input.nbPileupEvents.averageNumber.value()
13  else:
14  print 'phase1TkCustoms requires a --pileup option to cmsDriver to run the reconstruction/dqm'
15  print 'Please provide one!'
16  sys.exit(1)
17  if hasattr(process,'reconstruction'):
18  process=customise_Reco(process,float(n))
19  if hasattr(process,'digitisation_step'):
20  process=customise_Digi(process)
21  if hasattr(process,'dqmoffline_step'):
22  process=customise_DQM(process,n)
23  if hasattr(process,'dqmHarvesting'):
24  process=customise_harvesting(process)
25  if hasattr(process,'validation_step'):
26  process=customise_Validation(process)
27  process=customise_condOverRides(process)
28 
29  return process
30 
31 def customise_Digi(process):
32  process.mix.digitizers.pixel.MissCalibrate = False
33  process.mix.digitizers.pixel.LorentzAngle_DB = False
34  process.mix.digitizers.pixel.killModules = False
35  process.mix.digitizers.pixel.useDB = False
36  process.mix.digitizers.pixel.DeadModules_DB = False
37  process.mix.digitizers.pixel.NumPixelBarrel = cms.int32(10)
38  process.mix.digitizers.pixel.NumPixelEndcap = cms.int32(10)
39  process.mix.digitizers.pixel.ThresholdInElectrons_FPix = cms.double(2000.0)
40  process.mix.digitizers.pixel.ThresholdInElectrons_BPix = cms.double(2000.0)
41  process.mix.digitizers.pixel.ThresholdInElectrons_BPix_L1 = cms.double(2000.0)
42  process.mix.digitizers.pixel.thePixelColEfficiency_BPix4 = cms.double(0.999)
43  process.mix.digitizers.pixel.thePixelEfficiency_BPix4 = cms.double(0.999)
44  process.mix.digitizers.pixel.thePixelChipEfficiency_BPix4 = cms.double(0.999)
45  process.mix.digitizers.pixel.thePixelColEfficiency_FPix3 = cms.double(0.999)
46  process.mix.digitizers.pixel.thePixelEfficiency_FPix3 = cms.double(0.999)
47  process.mix.digitizers.pixel.thePixelChipEfficiency_FPix3 = cms.double(0.999)
48  process.mix.digitizers.pixel.AddPixelInefficiencyFromPython = cms.bool(False)
49  process.mix.digitizers.strip.ROUList = cms.vstring("g4SimHitsTrackerHitsPixelBarrelLowTof",
50  'g4SimHitsTrackerHitsPixelEndcapLowTof')
51  process.digitisation_step.remove(process.simSiStripDigiSimLink)
52  process.mergedtruth.simHitCollections.tracker = []
53  return process
54 
55 
56 def customise_DigiToRaw(process):
57  process.digi2raw_step.remove(process.siPixelRawData)
58  process.digi2raw_step.remove(process.rpcpacker)
59  return process
60 
61 def customise_RawToDigi(process):
62  process.raw2digi_step.remove(process.siPixelDigis)
63  return process
64 
65 def customise_Reco(process,pileup):
66  #this may be a trimmed out process with only local reco
67  #if so, don't use the customize stuff
68  ## need changes to mixedtriplets step to use for imcreasing high eta efficiency
69  process.reconstruction.remove(process.pixelLessStepSeedClusterMask)
70  process.reconstruction.remove(process.castorreco)
71  process.reconstruction.remove(process.CastorTowerReco)
72  process.reconstruction.remove(process.ak7BasicJets)
73  process.reconstruction.remove(process.ak7CastorJetID)
74  #process.iterTracking.remove(process.PixelLessStep)
75  #process.iterTracking.remove(process.TobTecStep)
76  process.MixedTripletStep.remove(process.mixedTripletStepSeedsB)
77  process.mixedTripletStepSeeds = cms.EDProducer("SeedCombiner",
78  seedCollections = cms.VInputTag(cms.InputTag("mixedTripletStepSeedsA"))
79  )
80  process.load("RecoTracker.IterativeTracking.HighPtTripletStep_cff")
81  from RecoTracker.IterativeTracking.HighPtTripletStep_cff import HighPtTripletStep
82  process.iterTracking = cms.Sequence(process.InitialStep*
83  process.HighPtTripletStep*
84  process.LowPtTripletStep*
85  process.PixelPairStep*
86  process.DetachedTripletStep*
87  process.MixedTripletStep*
88  #process.PixelLessStep*
89  #process.TobTecStep*
90  process.earlyGeneralTracks*
91  process.muonSeededStep*
92  process.preDuplicateMergingGeneralTracks*
93  process.generalTracksSequence*
94  process.ConvStep*
95  process.conversionStepTracks
96  )
97 
98 
99 
100 
101  process.convClusters.oldClusterRemovalInfo=cms.InputTag("mixedTripletStepClusters")
102  process.convClusters.trajectories=cms.InputTag("mixedTripletStepTracks")
103  process.convClusters.overrideTrkQuals= cms.InputTag("mixedTripletStep")
104  process.pixellayertriplets.layerList = cms.vstring( 'BPix1+BPix2+BPix3',
105  'BPix2+BPix3+BPix4',
106  'BPix1+BPix3+BPix4',
107  'BPix1+BPix2+BPix4',
108  'BPix2+BPix3+FPix1_pos',
109  'BPix2+BPix3+FPix1_neg',
110  'BPix1+BPix2+FPix1_pos',
111  'BPix1+BPix2+FPix1_neg',
112  'BPix2+FPix1_pos+FPix2_pos',
113  'BPix2+FPix1_neg+FPix2_neg',
114  'BPix1+FPix1_pos+FPix2_pos',
115  'BPix1+FPix1_neg+FPix2_neg',
116  'FPix1_pos+FPix2_pos+FPix3_pos',
117  'FPix1_neg+FPix2_neg+FPix3_neg' )
118  process.MeasurementTracker.UsePixelROCQualityDB = cms.bool(False)
119  process.MeasurementTracker.UsePixelModuleQualityDB = cms.bool(False)
120  process.mixedTripletStepSeedLayersA.layerList = cms.vstring('BPix1+BPix2+BPix3',
121  'BPix1+BPix2+FPix1_pos',
122  'BPix1+BPix2+FPix1_neg',
123  'BPix1+FPix1_pos+FPix2_pos',
124  'BPix1+FPix1_neg+FPix2_neg',
125  'BPix2+FPix1_pos+FPix2_pos',
126  'BPix2+FPix1_neg+FPix2_neg')
127  process.convLayerPairs.layerList = cms.vstring('BPix1+BPix2',
128  'BPix2+BPix3',
129  'BPix2+FPix1_pos',
130  'BPix2+FPix1_neg',
131  'BPix2+FPix2_pos',
132  'BPix2+FPix2_neg',
133  'FPix1_pos+FPix2_pos',
134  'FPix1_neg+FPix2_neg')
135 
136  process.earlyGeneralTracks.setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4), pQual=cms.bool(True) ))
137  process.earlyGeneralTracks.hasSelector=cms.vint32(1,1,1,1,1)
138  process.earlyGeneralTracks.selectedTrackQuals = cms.VInputTag(
139  cms.InputTag("initialStepSelector","initialStep"),
140  cms.InputTag("highPtTripletStepSelector","highPtTripletStep"),
141  cms.InputTag("lowPtTripletStepSelector","lowPtTripletStep"),
142  cms.InputTag("pixelPairStepSelector","pixelPairStep"),
143  cms.InputTag("mixedTripletStep")
144  )
145  process.earlyGeneralTracks.TrackProducers = cms.VInputTag(
146  cms.InputTag("initialStepTracks"),
147  cms.InputTag("highPtTripletStepTracks"),
148  cms.InputTag("lowPtTripletStepTracks"),
149  cms.InputTag("pixelPairStepTracks"),
150  cms.InputTag("mixedTripletStepTracks")
151  )
152 
153  process.tripletElectronSeedLayers.BPix.skipClusters=cms.InputTag('mixedTripletStepSeedClusterMask')
154  process.tripletElectronSeedLayers.FPix.skipClusters=cms.InputTag('mixedTripletStepSeedClusterMask')
155  process.tripletElectronClusterMask.oldClusterRemovalInfo=cms.InputTag('mixedTripletStepSeedClusterMask')
156 
157  process.initialStepSeedClusterMask.oldClusterRemovalInfo=cms.InputTag("mixedTripletStepClusters")
158  process.newCombinedSeeds.seedCollections = cms.VInputTag(cms.InputTag('initialStepSeeds'),
159  cms.InputTag("highPtTripletStepSeeds"),
160  cms.InputTag('pixelPairStepSeeds'),
161  cms.InputTag('mixedTripletStepSeeds'),
162  cms.InputTag('tripletElectronSeeds'),
163  cms.InputTag('pixelPairElectronSeeds'),
164  cms.InputTag('stripPairElectronSeeds') )
165  process.stripPairElectronSeedLayers.layerList = cms.vstring('BPix4+BPix5') # Optimize later
166  process.stripPairElectronSeedLayers.BPix = cms.PSet(
167  HitProducer = cms.string('siPixelRecHits'),
168  hitErrorRZ = cms.double(0.006),
169  useErrorsFromParam = cms.bool(True),
170  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
171  skipClusters = cms.InputTag("pixelPairStepClusters"),
172  hitErrorRPhi = cms.double(0.0027)
173  )
174  process.regionalCosmicTrackerSeeds.OrderedHitsFactoryPSet.LayerPSet.layerList = cms.vstring('BPix10+BPix9') # Optimize later
175  process.regionalCosmicTrackerSeeds.OrderedHitsFactoryPSet.LayerPSet.BPix = cms.PSet(
176  HitProducer = cms.string('siPixelRecHits'),
177  hitErrorRZ = cms.double(0.006),
178  useErrorsFromParam = cms.bool(True),
179  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
180  skipClusters = cms.InputTag("pixelPairStepClusters"),
181  hitErrorRPhi = cms.double(0.0027)
182  )
183  process.pixelTracks.SeedMergerPSet = cms.PSet(
184  layerListName = cms.string('PixelSeedMergerQuadruplets'),
185  addRemainingTriplets = cms.bool(False),
186  mergeTriplets = cms.bool(True),
187  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
188  )
189  process.initialStepSeedClusterMask.oldClusterRemovalInfo=cms.InputTag("mixedTripletStepClusters")
190 
191  # Need this line to stop error about missing siPixelDigis.
192  process.MeasurementTracker.inactivePixelDetectorLabels = cms.VInputTag()
193  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
194  # Use with latest pixel geometry. Only used for seeds, so we can use the Phase1Tk file.
195  # We will need to turn it off for any steps that use the outer pixels as seeds.
196  process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
197  # Now make sure we us CPE Generic
198  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
199  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
200  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
201  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
202  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
203  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
204  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
205  process.PixelCPEGenericESProducer.DoCosmics = False
206  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
207  #the quadruplet merger configuration
208  process.load("RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff")
209  process.pixelseedmergerlayers.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
210  process.pixelseedmergerlayers.BPix.HitProducer = cms.string("siPixelRecHits" )
211  process.pixelseedmergerlayers.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
212  process.pixelseedmergerlayers.FPix.HitProducer = cms.string("siPixelRecHits" )
213 
214  process.highPtTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
215  process.detachedTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
216  process.initialStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
217  process.pixelPairStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
218  process.lowPtTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
219  process.convStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
220  process.mixedTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
221  process.muonSeededSeedsInOut.TrackerRecHitBuilder = cms.string('WithTrackAngle')
222  process.muonSeededTracksInOut.TTRHBuilder = cms.string('WithTrackAngle')
223  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
224  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
225  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
226 
227  return process
228 
230  process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_BarrelEndcap_cff')
231  process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
232  process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
233  process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
234  process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
235  process.trackerTopologyConstants.pxb_layerMask = cms.uint32(15)
236  process.trackerTopologyConstants.pxb_ladderMask = cms.uint32(255)
237  process.trackerTopologyConstants.pxb_moduleMask = cms.uint32(1023)
238  process.trackerTopologyConstants.pxf_diskStartBit = cms.uint32(18)
239  process.trackerTopologyConstants.pxf_bladeStartBit = cms.uint32(12)
240  process.trackerTopologyConstants.pxf_panelStartBit = cms.uint32(10)
241  process.trackerTopologyConstants.pxf_moduleMask = cms.uint32(255)
242  return process
243 
244 
245 def l1EventContent(process):
246  #extend the event content
247 
248  alist=['RAWSIM','FEVTDEBUG','FEVTDEBUGHLT','GENRAW','RAWSIMHLT','FEVT']
249  for a in alist:
250  b=a+'output'
251  if hasattr(process,b):
252  getattr(process,b).outputCommands.append('keep PSimHits_g4SimHits_*_*')
253  getattr(process,b).outputCommands.append('keep SimTracks_g4SimHits_*_*')
254  getattr(process,b).outputCommands.append('keep SimVertexs_g4SimHits_*_*')
255  getattr(process,b).outputCommands.append('keep *_simSiPixelDigis_*_*')
256  getattr(process,b).outputCommands.append('keep *_genParticles_*_*')
257  getattr(process,b).outputCommands.append('keep *_L1TkBeams_*_*')
258  getattr(process,b).outputCommands.append('keep *_L1TkClustersFromPixelDigis_*_*')
259  getattr(process,b).outputCommands.append('keep *_L1TkClustersFromSimHits_*_*')
260  getattr(process,b).outputCommands.append('keep *_L1TkStubsFromPixelDigis_*_*')
261  getattr(process,b).outputCommands.append('keep *_L1TkStubsFromSimHits_*_*')
262  getattr(process,b).outputCommands.append('keep *_siPixelRecHits_*_*')
263  #drop some bigger collections we don't think we need
264  getattr(process,b).outputCommands.append('drop PSimHits_g4SimHits_EcalHitsEB_*')
265  getattr(process,b).outputCommands.append('drop PSimHits_g4SimHits_EcalHitsEE_*')
266  getattr(process,b).outputCommands.append('drop *_L1TkStubsFromSimHits_StubsFail_*')
267  return process
268 
269 def customise_DQM(process,pileup):
270  # We cut down the number of iterative tracking steps
271 # process.dqmoffline_step.remove(process.TrackMonStep3)
272 # process.dqmoffline_step.remove(process.TrackMonStep4)
273 # process.dqmoffline_step.remove(process.TrackMonStep5)
274 # process.dqmoffline_step.remove(process.TrackMonStep6)
275  #The following two steps were removed
276  #process.PixelLessStep*
277  #process.TobTecStep*
278  process.dqmoffline_step.remove(process.muonAnalyzer)
279  process.dqmoffline_step.remove(process.jetMETAnalyzer)
280 # process.dqmoffline_step.remove(process.TrackMonStep9)
281 # process.dqmoffline_step.remove(process.TrackMonStep10)
282 # process.dqmoffline_step.remove(process.PixelTrackingRecHitsValid)
283 
284  #put isUpgrade flag==true
285  process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
286  process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
287  process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
288  process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
289  process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
290  process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
291 
292  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
293  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
294 
295  if pileup>100:
297  else:
299  process.dqmoffline_step.remove(process.Phase1Pu70TrackMonStep2)
300  process.dqmoffline_step.remove(process.Phase1Pu70TrackMonStep4)
301  process.globalrechitsanalyze.ROUList = cms.vstring(
302  'g4SimHitsTrackerHitsPixelBarrelLowTof',
303  'g4SimHitsTrackerHitsPixelBarrelHighTof',
304  'g4SimHitsTrackerHitsPixelEndcapLowTof',
305  'g4SimHitsTrackerHitsPixelEndcapHighTof')
306  return process
307 
308 def customise_Validation(process):
309  process.validation_step.remove(process.PixelTrackingRecHitsValid)
310  process.validation_step.remove(process.stripRecHitsValid)
311  process.validation_step.remove(process.StripTrackingRecHitsValid)
312  # We don't run the HLT
313  process.validation_step.remove(process.HLTSusyExoVal)
314  process.validation_step.remove(process.hltHiggsValidator)
315  process.validation_step.remove(process.relvalMuonBits)
316  return process
317 
318 def customise_harvesting(process):
319  process.dqmHarvesting.remove(process.jetMETDQMOfflineClient)
320  process.dqmHarvesting.remove(process.dataCertificationJetMET)
321  process.dqmHarvesting.remove(process.sipixelEDAClient)
322  process.dqmHarvesting.remove(process.sipixelCertification)
323  return (process)
324