CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customise_phase1_hcal.py
Go to the documentation of this file.
2 
3 #common stuff here
4 def customise(process):
5  process.load("SLHCUpgradeSimulations.Geometry.recoFromSimDigis_cff")
6  process.load("SLHCUpgradeSimulations.Geometry.upgradeTracking_phase1_cff")
7 
8  process.ctfWithMaterialTracks.TTRHBuilder = 'WithTrackAngle'
9  process.PixelCPEGenericESProducer.UseErrorsFromTemplates = cms.bool(False)
10  process.PixelCPEGenericESProducer.TruncatePixelCharge = cms.bool(False)
11  process.PixelCPEGenericESProducer.LoadTemplatesFromDB = cms.bool(False)
12  process.PixelCPEGenericESProducer.Upgrade = cms.bool(True)
13  process.PixelCPEGenericESProducer.SmallPitch = False
14  process.PixelCPEGenericESProducer.IrradiationBiasCorrection = False
15  process.PixelCPEGenericESProducer.DoCosmics = False
16 
17  ## CPE for other steps
18  process.siPixelRecHits.CPE = cms.string('PixelCPEGeneric')
19  process.initialStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
20  process.lowPtTripletStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
21  process.pixelPairStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
22  process.detachedTripletStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
23  process.mixedTripletStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
24  process.pixelLessStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
25  process.tobTecStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
26  process.highPtTripletStepTracks.TTRHBuilder = cms.string('WithTrackAngle')
27 
28  # Need these lines to stop some errors about missing siStripDigis collections.
29  # should add them to fakeConditions_Phase1_cff
30  process.MeasurementTracker.inactiveStripDetectorLabels = cms.VInputTag()
31  process.MeasurementTracker.UseStripModuleQualityDB = cms.bool(False)
32  process.MeasurementTracker.UseStripAPVFiberQualityDB = cms.bool(False)
33  process.MeasurementTracker.UseStripStripQualityDB = cms.bool(False)
34  process.MeasurementTracker.UsePixelModuleQualityDB = cms.bool(False)
35  process.MeasurementTracker.UsePixelROCQualityDB = cms.bool(False)
36 
37  process.muons.TrackerKinkFinderParameters.TrackerRecHitBuilder = cms.string('WithTrackAngle')
38  # The SeedMergerPSet should be added to the following file for Phase 1
39  # RecoTracker/SpecialSeedGenerators/python/CombinatorialSeedGeneratorForCosmicsRegionalReconstruction_cfi.py
40  # but pixel layers are not used here for cosmic TODO: need Maria and Jan to do appropriate thing here
41  process.regionalCosmicTrackerSeeds.SeedMergerPSet = cms.PSet(
42  mergeTriplets = cms.bool(False),
43  ttrhBuilderLabel = cms.string( "PixelTTRHBuilderWithoutAngle" ),
44  addRemainingTriplets = cms.bool(False),
45  layerListName = cms.string( "PixelSeedMergerQuadruplets" )
46  )
47  process.regionalCosmicTracks.TTRHBuilder = cms.string('WithTrackAngle')
48 
49 
50  ### back to standard job commands ##################################################
51  process.DigiToRaw.remove(process.castorRawData)
52 
53  process.DigiToRaw.remove(process.siPixelRawData)
54  process.RawToDigi.remove(process.siPixelDigis)
55 
56 
57  if hasattr(process,'dqmoffline_step'):
58  process.dqmoffline_step.remove(process.SiPixelTrackResidualSource)
59  process.dqmoffline_step.remove(process.jetMETAnalyzer)
60  process.dqmoffline_step.remove(process.hltMonMuBits)
61  process.dqmoffline_step.remove(process.vbtfAnalyzer)
62  process.dqmoffline_step.remove(process.hltResults)
63  process.dqmoffline_step.remove(process.egHLTOffDQMSource)
64  process.dqmoffline_step.remove(process.globalAnalyzer)
65  process.dqmoffline_step.remove(process.jetMETHLTOfflineSource)
66  ##
67  process.dqmoffline_step.remove(process.TrackerCollisionTrackMon)
68  if hasattr(process,'validation_step'):
69  process.validation_step.remove(process.hltHITval)
70  process.validation_step.remove(process.HLTSusyExoVal)
71  process.validation_step.remove(process.relvalMuonBits)
72  process.validation_step.remove(process.hltMuonValidator)
73  #this takes forever - seems like an infinite loop that I didnt debug yet
74  process.validation_step.remove(process.pixelDigisValid)
75  else:
76  ## removing large memory usage module if we don't need it
77  process.pdigi.remove(process.mergedtruth)
78 
79 # HCAL Upgrade Geometry
80 
81  process.load("RecoLocalCalo.HcalRecProducers.HcalUpgradeReconstructor_cff")
82  process.load("RecoJets.Configuration.CaloTowersRec_cff")
83  process.load("RecoLocalCalo.HcalRecAlgos.hcalRecAlgoESProd_cfi")
84  process.load("RecoLocalCalo.Configuration.RecoLocalCalo_cff")
85 
86  process.ecalGlobalUncalibRecHit.EBdigiCollection = cms.InputTag("simEcalDigis","ebDigis")
87  process.ecalGlobalUncalibRecHit.EEdigiCollection = cms.InputTag("simEcalDigis","eeDigis")
88  process.ecalRecHit.ebDetIdToBeRecovered = cms.InputTag("","")
89  process.ecalRecHit.eeDetIdToBeRecovered = cms.InputTag("","")
90  process.ecalRecHit.eeFEToBeRecovered = cms.InputTag("","")
91  process.ecalRecHit.ebFEToBeRecovered = cms.InputTag("","")
92  process.ecalRecHit.recoverEBFE = cms.bool(False)
93  process.ecalRecHit.recoverEEFE = cms.bool(False)
94 
95  process.load("RecoLocalCalo.HcalRecProducers.HcalSimpleReconstructor_hbhe_cfi")
96  process.load("RecoLocalCalo.HcalRecProducers.HcalSimpleReconstructor_ho_cfi")
97  process.load("RecoLocalCalo.HcalRecProducers.HcalSimpleReconstructor_hf_cfi")
98 
99  process.hbheprereco.digiLabel = "simHcalUnsuppressedDigis"
100  process.horeco.digiLabel = "simHcalUnsuppressedDigis"
101  process.hfreco.digiLabel = "simHcalUnsuppressedDigis"
102  process.hcalupgradereco.digiLabel = "simHcalUnsuppressedDigis"
103 
104 ### Known alterations for Reco #####################################################
105  delattr(process,"hbhereco")
106  process.hbhereco = process.hbheprereco.clone()
107 
108  process.metrecoPlusHCALNoise.remove(process.BeamHaloSummary)
109  process.metrecoPlusHCALNoise.remove(process.GlobalHaloData)
110  process.metrecoPlusHCALNoise.remove(process.HcalHaloData)
111 
112  process.metrecoPlusHCALNoise.remove(process.hcalnoise)
113  process.jetGlobalReco = cms.Sequence(process.recoJets*process.recoTrackJets)
114  process.jetHighLevelReco = cms.Sequence(process.recoJetAssociations*process.recoPFJets*process.recoJPTJets)
115 
116 ### Place to add in the reco steps one by one ######################################
117  process.calolocalreco = cms.Sequence(process.ecalGlobalUncalibRecHit+
118  process.ecalDetIdToBeRecovered+
119  process.ecalRecHit+
120  process.ecalCompactTrigPrim+
121  process.ecalTPSkim+
122  process.ecalPreshowerRecHit+
123  #process.hbheprereco+
124  process.hbhereco+
125  process.horeco+process.hfreco+process.hcalupgradereco+process.towerMaker
126  #+process.zdcreco
127  )
128  process.localreco = cms.Sequence(process.trackerlocalreco+
129  process.muonlocalreco+
130  process.calolocalreco+
131  process.castorreco+
132  process.lumiProducer
133  )
134  process.globalreco = cms.Sequence(process.offlineBeamSpot
135  *process.recopixelvertexing
136  *process.trackingGlobalReco
137  #*process.hcalGlobalRecoSequence
138  *process.particleFlowCluster
139  *process.ecalClusters
140  *process.caloTowersRec
141  *process.vertexreco
142  *process.egammaGlobalReco
143  *process.pfTrackingGlobalReco
144  *process.jetGlobalReco
145  *process.muonrecoComplete
146  *process.muoncosmicreco
147  *process.CastorFullReco
148  )
149  process.highlevelreco = cms.Sequence(process.egammaHighLevelRecoPrePF
150  *process.particleFlowReco
151  *process.egammaHighLevelRecoPostPF
152  *process.jetHighLevelReco
153  *process.tautagging
154  *process.metrecoPlusHCALNoise
155  *process.btagging
156  *process.recoPFMET
157  *process.PFTau
158  *process.regionalCosmicTracksSeq
159  *process.muoncosmichighlevelreco
160  *process.reducedRecHits
161  )
162  process.reconstruction = cms.Sequence( process.localreco *
163  process.globalreco *
164  process.highlevelreco *
165  process.logErrorHarvester
166  )
167  # Clean out some unused sequences
168  process.hcalLocalRecoSequence=cms.Sequence()
169  process.hcalGlobalRecoSequence=cms.Sequence()
170 
171  return(process)
172 
173 
174 def customise_pu15_25ns(process):
175 
176  process=customise(process)
177 
178  process.load("SLHCUpgradeSimulations.Geometry.mixLowLumPU_Phase1_R30F12_HCal_cff")
179 
180 ### set the number of pileup
181  process.mix.input.nbPileupEvents = cms.PSet(
182  averageNumber = cms.double(15.0)
183  )
184  return (process)
185 
186 def customise_3bx(process):
187  process.mix.maxBunch=1
188  process.mix.minBunch=-1
189  return process
190 
192  process=customise_pu15_25ns(process)
193  process=customise_3bx(process)
194  return process
195 
196 #pileup specific stuff here
197 def customise_pu50_25ns(process):
198 
199  process=customise(process)
200 
201  process.load("SLHCUpgradeSimulations.Geometry.mixLowLumPU_Phase1_R30F12_HCal_cff")
202 
203 ### set the number of pileup
204  process.mix.input.nbPileupEvents = cms.PSet(
205  averageNumber = cms.double(50.0)
206  )
207 
208 ### if doing inefficiency at <PU>=50
209  process.simSiPixelDigis.AddPixelInefficiency = 20
210  ## also for strips TIB inefficiency if we want
211  ## TIB1,2 inefficiency at 20%
212  #process.simSiStripDigis.Inefficiency = 20
213  ## TIB1,2 inefficiency at 50%
214  #process.simSiStripDigis.Inefficiency = 30
215  ## TIB1,2 inefficiency at 99% (i.e. dead)
216  #process.simSiStripDigis.Inefficiency = 40
217 
218  return (process)
219 
221  process=customise_pu50_25ns(process)
222  process=customise_3bx(process)
223  return process
224 
225 def customise_wo_pairs(process):
226 
227  process=customise(process)
228 
229  process.generalTracks.TrackProducers = (cms.InputTag('initialStepTracks'),
230  cms.InputTag('highPtTripletStepTracks'),
231  cms.InputTag('lowPtTripletStepTracks'),
232  cms.InputTag('mixedTripletStepTracks'))
233  process.generalTracks.hasSelector=cms.vint32(1,1,1,1)
234  process.generalTracks.selectedTrackQuals = cms.VInputTag(cms.InputTag("initialStepSelector","initialStep"),
235  cms.InputTag("highPtTripletStepSelector","highPtTripletStep"),
236  cms.InputTag("lowPtTripletStepSelector","lowPtTripletStep"),
237  cms.InputTag("mixedTripletStep")
238  )
239  process.generalTracks.setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3), pQual=cms.bool(True) )
240  )
241 
242  process.newCombinedSeeds.seedCollections = cms.VInputTag(
243  cms.InputTag('initialStepSeeds'),
244  cms.InputTag('highPtTripletStepSeeds'),
245  cms.InputTag('lowPtTripletStepSeeds')
246  )
247 
248  process.mixedTripletStepClusters.oldClusterRemovalInfo = cms.InputTag("lowPtTripletStepClusters")
249  process.mixedTripletStepClusters.trajectories = cms.InputTag("lowPtTripletStepTracks")
250  process.mixedTripletStepClusters.overrideTrkQuals = cms.InputTag('lowPtTripletStepSelector','lowPtTripletStep')
251 
252  process.iterTracking.remove(process.PixelPairStep)
253  return (process)
254 
256  process.simHcalUnsuppressedDigis.HcalReLabel.RelabelRules.CorrectPhi = cms.untracked.bool(False)
257  process.HcalHardcodeGeometryEP.HcalReLabel.RelabelRules.CorrectPhi = cms.untracked.bool(False)
258  process.HcalReLabel.RelabelRules.CorrectPhi = cms.untracked.bool(False)
259  return (process)
260 
262 
263  process=customise_wo_pairs(process)
264 
265  process.load("SLHCUpgradeSimulations.Geometry.mixLowLumPU_Phase1_R30F12_HCal_cff")
266 
267 ### set the number of pileup
268  process.mix.input.nbPileupEvents = cms.PSet(
269  averageNumber = cms.double(15.0)
270  )
271  return (process)
272 
273 
274 #pileup specific stuff here
276 
277  process=customise_wo_pairs(process)
278 
279  process.load("SLHCUpgradeSimulations.Geometry.mixLowLumPU_Phase1_R30F12_HCal_cff")
280 
281 ### set the number of pileup
282  process.mix.input.nbPileupEvents = cms.PSet(
283  averageNumber = cms.double(50.0)
284  )
285 
286 
287 ### if doing inefficiency at <PU>=50
288  process.simSiPixelDigis.AddPixelInefficiency = 20
289  ## also for strips TIB inefficiency if we want
290  ## TIB1,2 inefficiency at 20%
291  #process.simSiStripDigis.Inefficiency = 20
292  ## TIB1,2 inefficiency at 50%
293  #process.simSiStripDigis.Inefficiency = 30
294  ## TIB1,2 inefficiency at 99% (i.e. dead)
295  #process.simSiStripDigis.Inefficiency = 40
296 
297  return (process)
298 
299 def saveAllProds(process):
300  keys=process.outputModules.keys()
301  for k in keys:
302  mod=getattr(process,k)
303  mod.outputCommands.extend(['keep *_simHcalUnsuppressedDigis_*_*',
304  'keep *_hcalupgradereco_*_*',
305  'keep *_hbhereco_*_*',
306  'keep recoPFRecHits_particleFlowRecHitPS_*_*',
307  'keep recoPFRecHits_particleFlowRecHitECAL_*_*',
308  'keep recoPFBlocks_particleFlowBlock_*_*',
309  'keep recoPFRecTracks_pfTrack_*_*',
310  'keep recoPFClusters_particleFlowClusterPS_*_*',
311  'keep recoPFClusters_particleFlowClusterECAL_*_*',
312  'keep recoPFDisplacedVertexCandidates_particleFlowDisplacedVertexCandidate_*_*',
313  'keep recoPFCandidates_particleFlow_*_*',
314  'keep recoPFClusters_particleFlowClusterHCAL_*_*',
315  'keep recoPFClusters_particleFlowClusterHCALUpgrade_*_*',
316  'keep recoPFClusters_particleFlowClusterHO_*_*',
317  'keep CaloTowersSorted_towerMakerPF_*_*',
318  'keep recoPFCandidates_pfNoPileUp_*_*',
319  'keep recoPFCandidates_pfAllPhotons_*_*',
320  'keep recoPFRecHits_particleFlowRecHitHCAL_*_*',
321  'keep recoPFRecHits_particleFlowRecHitHCALUpgrade_*_*',
322  'keep recoPFRecHits_particleFlowRecHitHO_*_*',
323  'keep recoPileUpPFCandidates_pfPileUp_*_*',
324  'keep recoGsfPFRecTracks_pfTrackElec_*_*',
325  'keep recoGsfPFRecTracks_pfTrackElec_Secondary_*',
326  'keep recoPFCandidates_pfAllNeutralHadrons_*_*',
327  'keep recoPFCandidates_pfAllChargedHadrons_*_*',
328  'keep recoPFCandidates_particleFlow_electrons_*',
329  'keep recoPFRecTracks_pfV0_*_*',
330  'keep recoJetedmRefToBaseProdrecoTracksrecoTrackrecoTracksTorecoTrackedmrefhelperFindUsingAdvanceedmRefVectorsAssociationVector_ak4PFJetTracksAssociatorAtVertex_*_*',
331  'keep recoPFRecTracks_pfConversions_*_*',
332  'keep recoPFCandidateElectronExtras_particleFlow_*_*',
333  'keep recoPFRecHits_particleFlowRecHitECAL_Cleaned_*',
334  'keep recoPFV0s_pfV0_*_*',
335  'keep recoPFCandidates_pfSelectedElectrons_*_*',
336  'keep recoPFDisplacedVertexs_particleFlowDisplacedVertex_*_*',
337  'keep recoPFRecTracks_pfDisplacedTrackerVertex_*_*',
338  'keep recoPFConversions_pfConversions_*_*',
339  'keep recoPFCandidates_particleFlow_CleanedPunchThroughNeutralHadrons_*',
340  'keep recoPFDisplacedTrackerVertexs_pfDisplacedTrackerVertex_*_*',
341  'keep recoPFCandidates_particleFlow_CleanedTrackerAndGlobalMuons_*',
342  'keep recoPFCandidates_particleFlow_CleanedPunchThroughMuons_*',
343  'keep recoPFCandidates_particleFlow_AddedMuonsAndHadrons_*',
344  'keep recoPFMETs_pfMet_*_*',
345  'keep recoPFCandidates_particleFlow_CleanedCosmicsMuons_*',
346  'keep recoPFRecHits_particleFlowClusterHFHAD_Cleaned_*',
347  'keep recoPFCandidates_particleFlow_CleanedFakeMuons_*',
348  'keep recoPFRecHits_particleFlowClusterECAL_Cleaned_*',
349  'keep recoPFRecHits_particleFlowClusterHFEM_Cleaned_*',
350  'keep recoPFRecHits_particleFlowClusterHCAL_Cleaned_*',
351  'keep recoPFRecHits_particleFlowRecHitHCAL_Cleaned_*',
352  'keep recoPFRecHits_particleFlowClusterHCALUpgrade_Cleaned_*',
353  'keep recoPFRecHits_particleFlowRecHitHCALUpgrade_Cleaned_*',
354  'keep recoPFRecHits_particleFlowClusterHO_Cleaned_*',
355  'keep recoPFRecHits_particleFlowRecHitHO_Cleaned_*',
356  'keep recoPFRecHits_particleFlowClusterPS_Cleaned_*',
357  'keep recoPFRecHits_particleFlowRecHitHCAL_HFHAD_*',
358  'keep recoPFRecHits_particleFlowRecHitPS_Cleaned_*',
359  'keep recoPFRecHits_particleFlowRecHitHCAL_HFEM_*',
360  'keep recoPFClusters_particleFlowClusterHFHAD_*_*',
361  'keep recoPFClusters_particleFlowClusterHFEM_*_*',
362  'keep recoPFCandidates_particleFlow_CleanedHF_*',
363  'keep recoPFCandidates_pfSelectedPhotons_*_*'])
364  return process
return((rh^lh)&mask)
def customise_pu50_25ns_3bx
if doing inefficiency at &lt;PU&gt;=50
def saveAllProds
if doing inefficiency at &lt;PU&gt;=50
def customise_pu15_25ns
Known alterations for Reco #####################################################. ...