12 corElectronCollection,
16 pfCandidateCollection="",
17 #correctAlreadyExistingMET,
18 corMetName="corEGSlimmedMET",
24 process.load(
"PhysicsTools.PatAlgos.cleaningLayer1.photonCleaner_cfi")
25 task.add(process.cleanPatPhotons)
27 cleanedPhotonCollection=
"cleanedPhotons"+postfix
28 cleanPhotonProducer = getattr(process,
"cleanPatPhotons").
clone(
29 src = photonCollection,
32 cleanPhotonProducer.checkOverlaps.electrons.src = electronCollection
33 cleanPhotonProducer.checkOverlaps.electrons.requireNoOverlaps=cms.bool(
True)
36 cleanedCorPhotonCollection=
"cleanedCorPhotons"+postfix
37 cleanCorPhotonProducer = getattr(process,
"cleanPatPhotons").
clone(
38 src = corPhotonCollection
40 cleanCorPhotonProducer.checkOverlaps.electrons.src = corElectronCollection
41 cleanCorPhotonProducer.checkOverlaps.electrons.requireNoOverlaps=cms.bool(
True)
45 matchPhotonCollection=
"matchedPhotons"+postfix
46 matchPhotonProducer=cms.EDProducer(
"PFMatchedCandidateRefExtractor",
47 col1=cms.InputTag(cleanedPhotonCollection),
48 col2=cms.InputTag(cleanedCorPhotonCollection),
49 pfCandCollection=cms.InputTag(pfCandidateCollection),
50 extractPFCandidates=cms.bool(pfCandMatching) )
52 matchElectronCollection=
"matchedElectrons"+postfix
53 matchElectronProducer=cms.EDProducer(
"PFMatchedCandidateRefExtractor",
54 col1=cms.InputTag(electronCollection),
55 col2=cms.InputTag(corElectronCollection),
56 pfCandCollection=cms.InputTag(pfCandidateCollection),
57 extractPFCandidates=cms.bool(pfCandMatching) )
61 tag1=
"pfCandCol1" if pfCandMatching
else "col1"
62 tag2=
"pfCandCol2" if pfCandMatching
else "col2"
63 correctionPhoton=
"corMETPhoton"+postfix
64 corMETPhoton = cms.EDProducer(
"ShiftedParticleMETcorrInputProducer",
65 srcOriginal = cms.InputTag(matchPhotonCollection,tag1),
66 srcShifted = cms.InputTag(matchPhotonCollection,tag2),
67 srcWeights = cms.InputTag(
"")
69 correctionElectron=
"corMETElectron"+postfix
70 corMETElectron=cms.EDProducer(
"ShiftedParticleMETcorrInputProducer",
71 srcOriginal=cms.InputTag(matchElectronCollection,tag1),
72 srcShifted=cms.InputTag(matchElectronCollection,tag2),
73 srcWeights = cms.InputTag(
"")
84 sequence=cms.Sequence()
85 sequence+=getattr(process,cleanedPhotonCollection)
86 sequence+=getattr(process,cleanedCorPhotonCollection)
87 sequence+=getattr(process,correctionPhoton)
88 sequence+=getattr(process,correctionElectron)
93 for metCollection
in metCollections:
95 if not hasattr(process, metCollection+postfix):
98 inputMetCollection=metCollection.replace(
"Raw",
"",1)
99 corMETModuleName=corMetName+postfix
100 corMETModule = cms.EDProducer(
"CorrectedPATMETProducer",
101 src = cms.InputTag( inputMetCollection ),
103 srcCorrections = cms.VInputTag( cms.InputTag(correctionPhoton),
104 cms.InputTag(correctionElectron),
108 sequence+=getattr(process,metCollection+postfix)
111 getattr(process,metCollection).srcCorrections.append(cms.InputTag(correctionPhoton))
112 getattr(process,metCollection).srcCorrections.append(cms.InputTag(correctionElectron))