1 import FWCore.ParameterSet.Config
as cms
12 cleanCollName="cleanMuonsPFCandidates",
18 sequence=cms.Sequence()
24 from RecoMET.METFilters.badGlobalMuonTaggersMiniAOD_cff
import badGlobalMuonTaggerMAOD, cloneGlobalMuonTaggerMAOD
26 badMuModule=badGlobalMuonTaggerMAOD
27 cloneMuModule=cloneGlobalMuonTaggerMAOD
29 from RecoMET.METFilters.badGlobalMuonTaggersAOD_cff
import badGlobalMuonTagger, cloneGlobalMuonTagger
30 badMuModule=badGlobalMuonTagger
31 cloneMuModule=cloneGlobalMuonTagger
34 if cleaningScheme
in [
"bad",
"all",
"computeAllApplyBad",
"computeAllApplyClone"]:
35 addToProcessAndTask(
'badGlobalMuonTagger'+typeFix+postfix, badMuModule.clone(), process, task )
36 sequence +=getattr(process,
"badGlobalMuonTagger"+typeFix+postfix)
37 if cleaningScheme
in [
"bad",
"computeAllApplyBad"]:
38 badMuonCollection =
'badGlobalMuonTagger'+typeFix+postfix+
':bad' 39 if cleaningScheme
in [
"clone",
"duplicated",
"all",
"computeAllApplyBad",
"computeAllApplyClone"]:
40 addToProcessAndTask(
'cloneGlobalMuonTagger'+typeFix+postfix, cloneMuModule.clone(), process, task )
41 sequence +=getattr(process,
"cloneGlobalMuonTagger"+typeFix+postfix)
42 if cleaningScheme
in [
"clone",
"duplicated",
"computeAllApplyClone"]:
43 badMuonCollection =
'cloneGlobalMuonTagger'+typeFix+postfix+
':bad' 45 if cleaningScheme==
"all":
46 badMuonCollection=
"badMuons"+postfix
47 badMuonProducer = cms.EDProducer(
50 cms.InputTag(
'badGlobalMuonTagger'+typeFix+postfix,
'bad'),
51 cms.InputTag(
'cloneGlobalMuonTagger'+typeFix+postfix,
'bad'),
55 sequence +=getattr(process, badMuonCollection )
57 badMuonCollection=
"badMuons"+postfix
58 badMuonModule = cms.EDFilter(
"CandViewSelector",
59 src = cms.InputTag(muonCollection),
60 cut = cms.string(selection)
64 cleanedPFCandCollection=cleanCollName+postfix
67 import CommonTools.CandAlgos.candPtrProjector_cfi
as _mod
68 cleanedPFCandProducer = _mod.candPtrProjector.clone(
69 src = pfCandCollection,
70 veto = badMuonCollection
73 cleanedPFCandProducer = cms.EDProducer(
"PFCandPtrProjector",
74 src = cms.InputTag(pfCandCollection),
75 veto = cms.InputTag(badMuonCollection)
79 sequence +=getattr(process, cleanedPFCandCollection )
def muonRecoMitigation(process, pfCandCollection, runOnMiniAOD, selection="", muonCollection="", cleanCollName="cleanMuonsPFCandidates", cleaningScheme="all", postfix="")
def addToProcessAndTask(label, module, process, task)
def getPatAlgosToolsTask(process)