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  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
169  skipClusters = cms.InputTag("pixelPairStepClusters"),
170  )
171  process.regionalCosmicTrackerSeedingLayers.layerList = cms.vstring('BPix10+BPix9') # Optimize later
172  process.regionalCosmicTrackerSeedingLayers.BPix = cms.PSet(
173  HitProducer = cms.string('siPixelRecHits'),
174  TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelPairs'),
175  skipClusters = cms.InputTag("pixelPairStepClusters"),
176  )
177  from RecoPixelVertexing.PixelTriplets.quadrupletseedmerging_cff import PixelSeedMergerQuadruplets
178  process.pixelTracks.SeedMergerPSet = cms.PSet(
179  layerList = PixelSeedMergerQuadruplets,
180  addRemainingTriplets = cms.bool(False),
181  mergeTriplets = cms.bool(True),
182  ttrhBuilderLabel = cms.string('PixelTTRHBuilderWithoutAngle')
183  )
184  process.initialStepSeedClusterMask.oldClusterRemovalInfo=cms.InputTag("mixedTripletStepClusters")
185 
186  # Need this line to stop error about missing siPixelDigis.
187  process.MeasurementTracker.inactivePixelDetectorLabels = cms.VInputTag()
188  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
189  # Use with latest pixel geometry. Only used for seeds, so we can use the Phase1Tk file.
190  # We will need to turn it off for any steps that use the outer pixels as seeds.
191  process.ClusterShapeHitFilterESProducer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par')
192  # Now make sure we us CPE Generic
193  process.mergedDuplicateTracks.TTRHBuilder = 'WithTrackAngle'
194  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
195  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
196  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
197  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
198  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
199  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
200  process.PixelCPEGenericESProducer.DoCosmics = False
201  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
202  #the quadruplet merger configuration
203  # from this PSet the quadruplet merger uses only the layer list so these could probably be removed
204  PixelSeedMergerQuadruplets.BPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
205  PixelSeedMergerQuadruplets.BPix.HitProducer = cms.string("siPixelRecHits" )
206  PixelSeedMergerQuadruplets.FPix.TTRHBuilder = cms.string("PixelTTRHBuilderWithoutAngle" )
207  PixelSeedMergerQuadruplets.FPix.HitProducer = cms.string("siPixelRecHits" )
208 
209  process.highPtTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
210  process.detachedTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
211  process.initialStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
212  process.pixelPairStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
213  process.lowPtTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
214  process.convStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
215  process.mixedTripletStepTracks.TTRHBuilder=cms.string('WithTrackAngle')
216  process.muonSeededSeedsInOut.TrackerRecHitBuilder = cms.string('WithTrackAngle')
217  process.muonSeededTracksInOut.TTRHBuilder = cms.string('WithTrackAngle')
218  process.muons1stStep.TrackerKinkFinderParameters.TrackerRecHitBuilder=cms.string('WithTrackAngle')
219  process.regionalCosmicTracks.TTRHBuilder=cms.string('WithTrackAngle')
220  process.cosmicsVetoTracksRaw.TTRHBuilder=cms.string('WithTrackAngle')
221 
222  return process
223 
225  process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_BarrelEndcap_cff')
226  process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
227  process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
228  process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
229  process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
230  process.trackerTopologyConstants.pxb_layerMask = cms.uint32(15)
231  process.trackerTopologyConstants.pxb_ladderMask = cms.uint32(255)
232  process.trackerTopologyConstants.pxb_moduleMask = cms.uint32(1023)
233  process.trackerTopologyConstants.pxf_diskStartBit = cms.uint32(18)
234  process.trackerTopologyConstants.pxf_bladeStartBit = cms.uint32(12)
235  process.trackerTopologyConstants.pxf_panelStartBit = cms.uint32(10)
236  process.trackerTopologyConstants.pxf_moduleMask = cms.uint32(255)
237  return process
238 
239 
240 def l1EventContent(process):
241  #extend the event content
242 
243  alist=['RAWSIM','FEVTDEBUG','FEVTDEBUGHLT','GENRAW','RAWSIMHLT','FEVT']
244  for a in alist:
245  b=a+'output'
246  if hasattr(process,b):
247  getattr(process,b).outputCommands.append('keep PSimHits_g4SimHits_*_*')
248  getattr(process,b).outputCommands.append('keep SimTracks_g4SimHits_*_*')
249  getattr(process,b).outputCommands.append('keep SimVertexs_g4SimHits_*_*')
250  getattr(process,b).outputCommands.append('keep *_simSiPixelDigis_*_*')
251  getattr(process,b).outputCommands.append('keep *_genParticles_*_*')
252  getattr(process,b).outputCommands.append('keep *_L1TkBeams_*_*')
253  getattr(process,b).outputCommands.append('keep *_L1TkClustersFromPixelDigis_*_*')
254  getattr(process,b).outputCommands.append('keep *_L1TkClustersFromSimHits_*_*')
255  getattr(process,b).outputCommands.append('keep *_L1TkStubsFromPixelDigis_*_*')
256  getattr(process,b).outputCommands.append('keep *_L1TkStubsFromSimHits_*_*')
257  getattr(process,b).outputCommands.append('keep *_siPixelRecHits_*_*')
258  #drop some bigger collections we don't think we need
259  getattr(process,b).outputCommands.append('drop PSimHits_g4SimHits_EcalHitsEB_*')
260  getattr(process,b).outputCommands.append('drop PSimHits_g4SimHits_EcalHitsEE_*')
261  getattr(process,b).outputCommands.append('drop *_L1TkStubsFromSimHits_StubsFail_*')
262  return process
263 
264 def customise_DQM(process,pileup):
265  # We cut down the number of iterative tracking steps
266 # process.dqmoffline_step.remove(process.TrackMonStep3)
267 # process.dqmoffline_step.remove(process.TrackMonStep4)
268 # process.dqmoffline_step.remove(process.TrackMonStep5)
269 # process.dqmoffline_step.remove(process.TrackMonStep6)
270  #The following two steps were removed
271  #process.PixelLessStep*
272  #process.TobTecStep*
273  process.dqmoffline_step.remove(process.muonAnalyzer)
274  process.dqmoffline_step.remove(process.jetMETAnalyzer)
275 # process.dqmoffline_step.remove(process.TrackMonStep9)
276 # process.dqmoffline_step.remove(process.TrackMonStep10)
277 # process.dqmoffline_step.remove(process.PixelTrackingRecHitsValid)
278 
279  #put isUpgrade flag==true
280  process.SiPixelRawDataErrorSource.isUpgrade = cms.untracked.bool(True)
281  process.SiPixelDigiSource.isUpgrade = cms.untracked.bool(True)
282  process.SiPixelClusterSource.isUpgrade = cms.untracked.bool(True)
283  process.SiPixelRecHitSource.isUpgrade = cms.untracked.bool(True)
284  process.SiPixelTrackResidualSource.isUpgrade = cms.untracked.bool(True)
285  process.SiPixelHitEfficiencySource.isUpgrade = cms.untracked.bool(True)
286 
287  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU140
288  from DQM.TrackingMonitor.customizeTrackingMonitorSeedNumber import customise_trackMon_IterativeTracking_PHASE1PU70
289 
290  if pileup>100:
292  else:
294  process.dqmoffline_step.remove(process.Phase1Pu70TrackMonStep2)
295  process.dqmoffline_step.remove(process.Phase1Pu70TrackMonStep4)
296  process.globalrechitsanalyze.ROUList = cms.vstring(
297  'g4SimHitsTrackerHitsPixelBarrelLowTof',
298  'g4SimHitsTrackerHitsPixelBarrelHighTof',
299  'g4SimHitsTrackerHitsPixelEndcapLowTof',
300  'g4SimHitsTrackerHitsPixelEndcapHighTof')
301  return process
302 
303 def customise_Validation(process):
304  process.validation_step.remove(process.PixelTrackingRecHitsValid)
305  process.validation_step.remove(process.stripRecHitsValid)
306  process.validation_step.remove(process.StripTrackingRecHitsValid)
307  # We don't run the HLT
308  process.validation_step.remove(process.HLTSusyExoVal)
309  process.validation_step.remove(process.hltHiggsValidator)
310  process.validation_step.remove(process.relvalMuonBits)
311  return process
312 
313 def customise_harvesting(process):
314  process.dqmHarvesting.remove(process.dataCertificationJetMET)
315  process.dqmHarvesting.remove(process.sipixelEDAClient)
316  process.dqmHarvesting.remove(process.sipixelCertification)
317  return (process)
318