29 trackAssocParamsForMuonCleaning = TrackAssociatorParameterBlock.TrackAssociatorParameters
31 process.muonCaloEnergyDepositsAllCrossed = cms.EDProducer(
'MuonCaloCleanerAllCrossed',
32 trackAssociator = trackAssocParamsForMuonCleaning,
33 selectedMuons = process.customization_options.ZmumuCollection,
34 esRecHits = cms.InputTag(
"ecalPreshowerRecHit",
"EcalRecHitsES", inputProcess)
36 process.ProductionFilterSequence += process.muonCaloEnergyDepositsAllCrossed
38 recHitCaloCleanerAllCrossedConfig = cms.PSet(
39 srcEnergyDepositMapMuPlus = cms.InputTag(
"muonCaloEnergyDepositsAllCrossed",
"energyDepositsMuPlus"),
40 srcEnergyDepositMapMuMinus = cms.InputTag(
"muonCaloEnergyDepositsAllCrossed",
"energyDepositsMuMinus"),
41 typeEnergyDepositMap = cms.string(
"absolute"),
44 recHitCaloCleanerByDistanceConfig =
None
45 if process.customization_options.cleaningMode ==
'DEDX':
46 process.muonCaloEnergyDepositsByDistance = cms.EDProducer(
'MuonCaloCleanerByDistance',
47 muons = cms.InputTag(
"muonCaloDistances",
"muons"),
48 distanceMapMuPlus = cms.InputTag(
"muonCaloDistances",
"distancesMuPlus"),
49 distanceMapMuMinus = cms.InputTag(
"muonCaloDistances",
"distancesMuMinus"),
50 energyDepositCorrection = cms.PSet(
51 H_Ecal_EcalBarrel = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.9),
52 H_Ecal_EcalEndcap = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.9),
53 H_Hcal_HcalBarrel = cms.double(process.customization_options.muonCaloCleaningSF.value()*1.1),
54 H_Hcal_HcalOuter = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.8),
55 H_Hcal_HcalEndcap = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.9),
56 H_Hcal_HcalForward = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.000),
57 H_Hcal_HcalOther = cms.double(process.customization_options.muonCaloCleaningSF.value()*0.000)
59 verbosity = cms.int32(0)
61 process.ProductionFilterSequence += process.muonCaloEnergyDepositsByDistance
63 recHitCaloCleanerByDistanceConfig = cms.PSet(
64 srcEnergyDepositMapMuPlus = cms.InputTag(
"muonCaloEnergyDepositsByDistance",
"energyDepositsMuPlus"),
65 srcEnergyDepositMapMuMinus = cms.InputTag(
"muonCaloEnergyDepositsByDistance",
"energyDepositsMuMinus"),
66 typeEnergyDepositMap = cms.string(
"absolute"),
68 elif process.customization_options.cleaningMode ==
'PF':
70 process.pfMuonCaloEnergyDeposits = cms.EDProducer(
'PFMuonCaloCleaner',
71 selectedMuons = process.customization_options.ZmumuCollection,
72 pfCandidates = cms.InputTag(
"particleFlowForPFMuonCleaning"),
73 dRmatch = cms.double(0.3),
74 verbosity = cms.int32(0)
76 process.ProductionFilterSequence += process.pfMuonCaloEnergyDeposits
78 recHitCaloCleanerByDistanceConfig = cms.PSet(
79 srcEnergyDepositMapMuPlus = cms.InputTag(
"pfMuonCaloEnergyDeposits",
"energyDepositsMuPlus"),
80 srcEnergyDepositMapMuMinus = cms.InputTag(
"pfMuonCaloEnergyDeposits",
"energyDepositsMuMinus"),
81 typeEnergyDepositMap = cms.string(
"absolute"),
84 raise ValueError(
"Invalid Configuration parameter 'cleaningMode' = %s !!" % process.customization_options.cleaningMode)
92 if not process.customization_options.skipCaloRecHitMixing.value():
93 process.castorrecoORG = process.castorreco.clone()
94 process.castorreco = cms.EDProducer(
"CastorRecHitMixer",
95 recHitCaloCleanerAllCrossedConfig,
98 collection1 = cms.InputTag(
"castorrecoORG"),
99 collection2 = cms.InputTag(
"castorreco",
"", inputProcess),
100 killNegEnergyBeforeMixing1 = cms.bool(
False),
101 killNegEnergyBeforeMixing2 = cms.bool(
True),
102 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
103 killNegEnergyAfterMixing = cms.bool(
False)
106 verbosity = cms.int32(0)
110 print(
"WARNING: disabling mixing of CASTOR recHit collection, this setting should be used for DEBUGGING only !!")
118 if not process.customization_options.skipCaloRecHitMixing.value():
119 process.hfrecoORG = process.hfreco.clone()
120 process.hfreco = cms.EDProducer(
"HFRecHitMixer",
121 recHitCaloCleanerAllCrossedConfig,
124 collection1 = cms.InputTag(
"hfrecoORG"),
125 collection2 = cms.InputTag(
"hfreco",
"", inputProcess),
126 killNegEnergyBeforeMixing1 = cms.bool(
False),
127 killNegEnergyBeforeMixing2 = cms.bool(
True),
128 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
129 killNegEnergyAfterMixing = cms.bool(
False)
132 verbosity = cms.int32(0)
136 print(
"WARNING: disabling mixing of HF recHit collection, this setting should be used for DEBUGGING only !!")
139 if not process.customization_options.skipCaloRecHitMixing.value():
140 process.ecalPreshowerRecHitORG = process.ecalPreshowerRecHit.clone()
141 process.ecalPreshowerRecHit = cms.EDProducer(
"EcalRecHitMixer",
142 recHitCaloCleanerAllCrossedConfig,
145 collection1 = cms.InputTag(
"ecalPreshowerRecHitORG",
"EcalRecHitsES"),
146 collection2 = cms.InputTag(
"ecalPreshowerRecHit",
"EcalRecHitsES", inputProcess),
147 killNegEnergyBeforeMixing1 = cms.bool(
False),
148 killNegEnergyBeforeMixing2 = cms.bool(
True),
149 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
150 killNegEnergyAfterMixing = cms.bool(
False)
153 verbosity = cms.int32(0)
155 replaceModule_or_Sequence(process, process.ecalPreshowerRecHit, process.ecalPreshowerRecHitORG*process.ecalPreshowerRecHit)
157 print(
"WARNING: disabling mixing of ES recHit collection, this setting should be used for DEBUGGING only !!")
160 if not process.customization_options.skipCaloRecHitMixing.value():
161 print "Mixing ECAL recHit collections"
162 process.ecalRecHitORG = process.ecalRecHit.clone()
163 process.ecalRecHit = cms.EDProducer(
"EcalRecHitMixer",
164 recHitCaloCleanerByDistanceConfig,
167 collection1 = cms.InputTag(
"ecalRecHitORG",
"EcalRecHitsEB"),
168 collection2 = cms.InputTag(
"ecalRecHit",
"EcalRecHitsEB", inputProcess),
169 killNegEnergyBeforeMixing1 = cms.bool(
False),
170 killNegEnergyBeforeMixing2 = cms.bool(
True),
171 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
172 killNegEnergyAfterMixing = cms.bool(
False)
175 collection1 = cms.InputTag(
"ecalRecHitORG",
"EcalRecHitsEE"),
176 collection2 = cms.InputTag(
"ecalRecHit",
"EcalRecHitsEE", inputProcess),
177 killNegEnergyBeforeMixing1 = cms.bool(
False),
178 killNegEnergyBeforeMixing2 = cms.bool(
True),
179 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
180 killNegEnergyAfterMixing = cms.bool(
False)
183 verbosity = cms.int32(0)
187 print(
"WARNING: disabling mixing of EB and EE recHit collections, this setting should be used for DEBUGGING only !!")
190 if not process.customization_options.skipCaloRecHitMixing.value():
191 print "Mixing HCAL recHit collection"
192 process.hbherecoORG = process.hbhereco.clone()
193 process.hbhereco = cms.EDProducer(
"HBHERecHitMixer",
194 recHitCaloCleanerByDistanceConfig,
197 collection1 = cms.InputTag(
"hbherecoORG",
""),
198 collection2 = cms.InputTag(
"hbhereco",
"", inputProcess),
199 killNegEnergyBeforeMixing1 = cms.bool(
False),
200 killNegEnergyBeforeMixing2 = cms.bool(
True),
201 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
202 killNegEnergyAfterMixing = cms.bool(
False)
205 verbosity = cms.int32(0)
209 process.horecoORG = process.horeco.clone()
210 process.horeco = cms.EDProducer(
"HORecHitMixer",
211 recHitCaloCleanerByDistanceConfig,
214 collection1 = cms.InputTag(
"horecoORG",
""),
215 collection2 = cms.InputTag(
"horeco",
"", inputProcess),
216 killNegEnergyBeforeMixing1 = cms.bool(
False),
217 killNegEnergyBeforeMixing2 = cms.bool(
True),
218 muonEnSutractionMode = cms.string(
"subtractFromCollection2BeforeMixing"),
219 killNegEnergyAfterMixing = cms.bool(
False)
222 verbosity = cms.int32(0)
226 print(
"WARNING: disabling mixing of HB, HE and HO recHit collections, this setting should be used for DEBUGGING only !!")
229 process.muonDetHits = cms.EDProducer(
'MuonDetCleaner',
230 trackAssociator = trackAssocParamsForMuonCleaning,
231 selectedMuons = process.customization_options.ZmumuCollection,
232 verbosity = cms.int32(0)
234 if process.customization_options.replaceGenOrRecMuonMomenta.value() ==
"gen":
235 process.muonDetHits.trackAssociator.muonMaxDistanceX = cms.double(1.e+3)
236 process.muonDetHits.trackAssociator.muonMaxDistanceX = cms.double(1.e+3)
237 process.muonDetHits.trackAssociator.dRMuonPreselection = cms.double(0.5)
238 process.ProductionFilterSequence += process.muonDetHits
240 recHitMuonDetCleanerConfig = cms.PSet(
241 srcHitMapMuPlus = cms.InputTag(
"muonDetHits",
"hitsMuPlus"),
242 srcHitMapMuMinus = cms.InputTag(
"muonDetHits",
"hitsMuMinus"),
243 verbosity = cms.int32(0)
246 if process.customization_options.muonMixingMode.value() == 2:
248 configtools.cloneProcessingSnippet(process, process.muonlocalreco,
"ORG")
249 process.reconstruction_step.replace(process.dt1DRecHits, process.muonlocalrecoORG*process.dt1DRecHits)
251 if process.customization_options.muonMixingMode.value() == 1
or \
252 process.customization_options.muonMixingMode.value() == 2:
254 print "Mixing CSC recHit collection"
255 process.csc2DRecHitsORG = process.csc2DRecHits.clone()
256 process.csc2DRecHits = cms.EDProducer(
"CSCRecHitMixer",
257 recHitMuonDetCleanerConfig,
260 collection1 = cms.InputTag(
"csc2DRecHitsORG",
""),
261 cleanCollection1 = cms.bool(
False),
262 collection2 = cms.InputTag(
"csc2DRecHits",
"", inputProcess),
263 cleanCollection2 = cms.bool(
True)
270 print "Mixing DT recHit collection"
271 process.dt1DRecHitsORG = process.dt1DRecHits.clone()
272 process.dt1DRecHits = cms.EDProducer(
"DTRecHitMixer",
273 recHitMuonDetCleanerConfig,
276 collection1 = cms.InputTag(
"dt1DRecHitsORG",
""),
277 cleanCollection1 = cms.bool(
False),
278 collection2 = cms.InputTag(
"dt1DRecHits",
"", inputProcess),
279 cleanCollection2 = cms.bool(
True)
286 print "Mixing RPC recHit collection"
287 process.rpcRecHitsORG = process.rpcRecHits.clone()
288 process.rpcRecHits = cms.EDProducer(
"RPCRecHitMixer",
289 recHitMuonDetCleanerConfig,
292 collection1 = cms.InputTag(
"rpcRecHitsORG",
""),
293 cleanCollection1 = cms.bool(
False),
294 collection2 = cms.InputTag(
"rpcRecHits",
"", inputProcess),
295 cleanCollection2 = cms.bool(
True)
301 if process.customization_options.muonMixingMode.value() == 2
or \
302 process.customization_options.muonMixingMode.value() == 3:
306 process.MuonTransientTrackingRecHitBuilderESProducerFromDisk = process.MuonTransientTrackingRecHitBuilderESProducer.clone(
307 ComponentName = cms.string(
'MuonRecHitBuilderFromDisk'),
308 ComputeCoarseLocalPositionFromDisk = cms.bool(
True)
310 process.ttrhbwrFromDisk = process.ttrhbwr.clone(
311 ComponentName = cms.string(
'WithTrackAngleFromDisk'),
312 ComputeCoarseLocalPositionFromDisk = cms.bool(
True)
314 process.glbTrackQual.RefitterParameters.MuonRecHitBuilder = cms.string(
'MuonRecHitBuilderFromDisk')
315 process.glbTrackQual.RefitterParameters.TrackerRecHitBuilder = cms.string(
'WithTrackAngleFromDisk')
317 process.globalMuonsORG = process.globalMuons.clone()
318 process.cleanedGlobalMuons = cms.EDProducer(
"GlobalMuonTrackCleaner",
319 selectedMuons = process.customization_options.ZmumuCollection,
320 tracks = cms.VInputTag(
"globalMuons"),
321 dRmatch = cms.double(3.e-1),
322 removeDuplicates = cms.bool(
True),
323 type = cms.string(
"links"),
324 srcMuons = cms.InputTag(
"muons"),
325 verbosity = cms.int32(0)
327 process.globalMuons = cms.EDProducer(
"GlobalMuonTrackMixer",
330 collection1 = cms.InputTag(
"globalMuonsORG",
"",
"EmbeddedRECO"),
331 collection2 = cms.InputTag(
"cleanedGlobalMuons"),
334 verbosity = cms.int32(0)
336 replaceModule_or_Sequence(process, process.globalMuons, process.cleanedGlobalMuons*process.globalMuonsORG*process.globalMuons)
338 process.standAloneMuonsORG = process.standAloneMuons.clone()
339 process.cleanedStandAloneMuons = process.cleanedGeneralTracks.clone(
340 tracks = cms.VInputTag(
341 cms.InputTag(
"standAloneMuons" ,
""),
342 cms.InputTag(
"standAloneMuons",
"UpdatedAtVtx"),
344 type = cms.string(
"outer tracks"),
345 verbosity = cms.int32(0)
347 process.standAloneMuons = cms.EDProducer(
"TrackMixer",
350 collection1 = cms.InputTag(
"standAloneMuonsORG",
"",
"EmbeddedRECO"),
351 collection2 = cms.InputTag(
"cleanedStandAloneMuons",
"")
354 collection1 = cms.InputTag(
"standAloneMuonsORG",
"UpdatedAtVtx",
"EmbeddedRECO"),
355 collection2 = cms.InputTag(
"cleanedStandAloneMuons",
"UpdatedAtVtx")
358 verbosity = cms.int32(0)
360 replaceModule_or_Sequence(process, process.standAloneMuons, process.cleanedStandAloneMuons*process.standAloneMuonsORG*process.standAloneMuons)
362 process.tevMuonsORG = process.tevMuons.clone()
363 if not process.customization_options.skipMuonDetRecHitMixing.value():
364 process.tevMuonsORG.RefitterParameters.CSCRecSegmentLabel = cms.InputTag(
"csc2DRecHitsORG")
365 process.tevMuonsORG.RefitterParameters.DTRecSegmentLabel = cms.InputTag(
"dt1DRecHitsORG")
366 process.tevMuonsORG.RefitterParameters.RPCRecSegmentLabel = cms.InputTag(
"rpcRecHitsORG")
367 process.tevMuonsORG.MuonCollectionLabel = cms.InputTag(
"globalMuonsORG")
368 process.cleanedTeVMuons = cms.EDProducer(
"TeVMuonTrackCleaner",
369 selectedMuons = process.customization_options.ZmumuCollection,
370 tracks = cms.VInputTag(
371 cms.InputTag(
"tevMuons",
"default"),
372 cms.InputTag(
"tevMuons",
"dyt"),
373 cms.InputTag(
"tevMuons",
"firstHit"),
374 cms.InputTag(
"tevMuons",
"picky")
376 dRmatch = cms.double(3.e-1),
377 removeDuplicates = cms.bool(
True),
378 type = cms.string(
"tev"),
379 srcGlobalMuons_cleaned = cms.InputTag(
"cleanedGlobalMuons"),
380 verbosity = cms.int32(0)
382 process.tevMuons = cms.EDProducer(
"TeVMuonTrackMixer",
385 collection1 = cms.InputTag(
"tevMuonsORG",
"default",
"EmbeddedRECO"),
386 collection2 = cms.InputTag(
"cleanedTeVMuons",
"default")
389 collection1 = cms.InputTag(
"tevMuonsORG",
"dyt",
"EmbeddedRECO"),
390 collection2 = cms.InputTag(
"cleanedTeVMuons",
"dyt")
393 collection1 = cms.InputTag(
"tevMuonsORG",
"firstHit",
"EmbeddedRECO"),
394 collection2 = cms.InputTag(
"cleanedTeVMuons",
"firstHit")
397 collection1 = cms.InputTag(
"tevMuonsORG",
"picky",
"EmbeddedRECO"),
398 collection2 = cms.InputTag(
"cleanedTeVMuons",
"picky")
401 srcGlobalMuons_cleaned = cms.InputTag(
"cleanedGlobalMuons"),
402 verbosity = cms.int32(0)
def replaceModule_or_Sequence
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.