1 import FWCore.ParameterSet.Config
as cms
3 from PhysicsTools.SelectorUtils.tools.DataFormat
import DataFormat
6 process.load(
"RecoEgamma.PhotonIdentification.egmPhotonIDs_cfi")
7 from PhysicsTools.SelectorUtils.centralIDRegistry
import central_id_registry
11 process.load(
"RecoEgamma.PhotonIdentification.photonIDValueMapProducer_cff")
14 process.load(
"RecoEgamma.PhotonIdentification.PhotonMVAValueMapProducer_cfi")
17 process.egmPhotonIDTask = cms.Task()
19 if dataFormat== DataFormat.AOD:
20 process.load(
"RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationAOD_cff")
22 if not hasattr(process,
"particleFlowTmpPtrs"):
23 process.particleFlowTmpPtrs = cms.EDProducer(
"PFCandidateFwdPtrProducer",
24 src = cms.InputTag(
'particleFlow')
26 process.egmPhotonIDTask.add(process.particleFlowTmpPtrs,
27 process.egmPhotonIsolationAODTask)
29 process.egmPhotonIDTask.add(process.egmPhotonIsolationAODTask)
31 elif dataFormat== DataFormat.MiniAOD:
32 process.load(
"RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationMiniAOD_cff")
33 process.egmPhotonIDTask.add(process.egmPhotonIsolationMiniAODTask)
35 raise Exception(
'InvalidVIDDataFormat',
'The requested data format is different from AOD or MiniAOD')
37 process.egmPhotonIDTask.add(process.photonIDValueMapProducer,
38 process.photonMVAValueMapProducer,
40 process.egmPhotonIDSequence = cms.Sequence(process.egmPhotonIDTask)
def loadEgmIdSequence(process, dataFormat)