1 import FWCore.ParameterSet.Config
as cms
10 cleanCollName=
"cleanMuonsPFCandidates",
14 sequence=cms.Sequence()
20 from RecoMET.METFilters.badGlobalMuonTaggersMiniAOD_cff
import badGlobalMuonTaggerMAOD, cloneGlobalMuonTaggerMAOD
22 badMuModule=badGlobalMuonTaggerMAOD
23 cloneMuModule=cloneGlobalMuonTaggerMAOD
25 from RecoMET.METFilters.badGlobalMuonTaggersAOD_cff
import badGlobalMuonTagger, cloneGlobalMuonTagger
26 badMuModule=badGlobalMuonTagger
27 cloneMuModule=cloneGlobalMuonTagger
30 if cleaningScheme
in [
"bad",
"all",
"computeAllApplyBad",
"computeAllApplyClone"]:
31 setattr(process,
'badGlobalMuonTagger'+typeFix+postfix, badMuModule.clone() )
32 sequence +=getattr(process,
"badGlobalMuonTagger"+typeFix+postfix)
33 if cleaningScheme
in [
"bad",
"computeAllApplyBad"]:
34 badMuonCollection =
'badGlobalMuonTagger'+typeFix+postfix+
':bad'
35 if cleaningScheme
in [
"clone",
"duplicated",
"all",
"computeAllApplyBad",
"computeAllApplyClone"]:
36 setattr(process,
'cloneGlobalMuonTagger'+typeFix+postfix, cloneMuModule.clone() )
37 sequence +=getattr(process,
"cloneGlobalMuonTagger"+typeFix+postfix)
38 if cleaningScheme
in [
"clone",
"duplicated",
"computeAllApplyClone"]:
39 badMuonCollection =
'cloneGlobalMuonTagger'+typeFix+postfix+
':bad'
41 if cleaningScheme==
"all":
42 badMuonCollection=
"badMuons"+postfix
43 badMuonProducer = cms.EDProducer(
46 cms.InputTag(
'badGlobalMuonTagger'+typeFix+postfix,
'bad'),
47 cms.InputTag(
'cloneGlobalMuonTagger'+typeFix+postfix,
'bad'),
50 setattr(process,badMuonCollection,badMuonProducer)
51 sequence +=getattr(process, badMuonCollection )
53 badMuonCollection=
"badMuons"+postfix
54 badMuonModule = cms.EDFilter(
"CandViewSelector",
55 src = cms.InputTag(muonCollection),
56 cut = cms.string(selection)
60 cleanedPFCandCollection=cleanCollName+postfix
62 cleanedPFCandProducer = cms.EDProducer(
"CandPtrProjector",
63 src = cms.InputTag(pfCandCollection),
64 veto = cms.InputTag(badMuonCollection)
67 cleanedPFCandProducer = cms.EDProducer(
"PFCandPtrProjector",
68 src = cms.InputTag(pfCandCollection),
69 veto = cms.InputTag(badMuonCollection)
88 setattr(process,cleanedPFCandCollection,cleanedPFCandProducer)
89 sequence +=getattr(process, cleanedPFCandCollection )