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")
15 process.load(
"RecoEgamma.PhotonIdentification.PhotonRegressionValueMapProducer_cfi")
18 process.egmPhotonIDTask = cms.Task()
20 if dataFormat== DataFormat.AOD:
21 process.load(
"RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationAOD_cff")
23 if not hasattr(process,
"particleFlowTmpPtrs"):
24 process.particleFlowTmpPtrs = cms.EDProducer(
"PFCandidateFwdPtrProducer",
25 src = cms.InputTag(
'particleFlow')
27 process.egmPhotonIDTask.add(process.particleFlowTmpPtrs,
28 process.egmPhotonIsolationAODTask)
30 process.egmPhotonIDTask.add(process.egmPhotonIsolationAODTask)
32 elif dataFormat== DataFormat.MiniAOD:
33 process.load(
"RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationMiniAOD_cff")
34 process.egmPhotonIDTask.add(process.egmPhotonIsolationMiniAODTask)
36 raise Exception(
'InvalidVIDDataFormat',
'The requested data format is different from AOD or MiniAOD')
38 process.egmPhotonIDTask.add(process.photonIDValueMapProducer,
39 process.photonMVAValueMapProducer,
41 process.photonRegressionValueMapProducer)
42 process.egmPhotonIDSequence = cms.Sequence(process.egmPhotonIDTask)
def loadEgmIdSequence(process, dataFormat)