CMS 3D CMS Logo

particleFlowEGamma_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import copy
3 #Geometry
4 # include used for track reconstruction
5 # note that tracking is redone since we need updated hits and they
6 # are not stored in the event!
12 from RecoEgamma.EgammaIsolationAlgos.particleBasedIsoProducer_cfi import particleBasedIsolation as _particleBasedIsolation
13 from RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationAOD_cff import egmPhotonIsolation as _egmPhotonIsolationAOD
14 from RecoEgamma.EgammaIsolationAlgos.egmGedGsfElectronPFIsolation_cff import egmGedGsfElectronPFNoPileUpIsolationMapBasedVeto as _egmElectronIsolationCITK
15 from RecoEgamma.EgammaIsolationAlgos.egmGedGsfElectronPFIsolation_cff import egmGedGsfElectronPFPileUpIsolationMapBasedVeto as _egmElectronIsolationCITKPileUp
16 
17 
18 from CommonTools.ParticleFlow.pfNoPileUpIso_cff import pfPileUpIso, pfNoPileUpIso, pfNoPileUpIsoSequence
19 from CommonTools.ParticleFlow.ParticleSelectors.pfSortByType_cff import pfPileUpAllChargedParticles
21 from RecoEgamma.EgammaIsolationAlgos.egmIsoConeDefinitions_cfi import IsoConeDefinitions
22 
23 particleBasedIsolationTmp = _particleBasedIsolation.clone(
24  photonProducer = "gedPhotonsTmp",
25  electronProducer = "gedGsfElectronsTmp",
26  pfCandidates = "particleFlowTmp",
27  valueMapPhoPFblockIso = "gedPhotonsTmp",
28  valueMapElePFblockIso = "gedGsfElectronsTmp"
29 )
30 #change particleBasedIsolation object to tmp
31 IsoConeDefinitionsPhotonsTmp = copy.deepcopy(IsoConeDefinitions)
32 for iPSet in IsoConeDefinitionsPhotonsTmp:
33  iPSet.particleBasedIsolation = "particleBasedIsolationTmp:gedPhotonsTmp"
34 
35 #photon isolation sums
36 egmPhotonIsolationCITK = _egmPhotonIsolationAOD.clone(
37  srcToIsolate = "gedPhotonsTmp",
38  srcForIsolationCone = "pfNoPileUpCandidates",
39  isolationConeDefinitions = IsoConeDefinitionsPhotonsTmp
40 )
41 
42 #electrons isolation sums
43 egmElectronIsolationCITK = _egmElectronIsolationCITK.clone(
44  srcToIsolate = "gedGsfElectronsTmp",
45  srcForIsolationCone = "pfNoPileUpCandidates"
46 )
47 
48 for iPSet in egmElectronIsolationCITK.isolationConeDefinitions:
49  iPSet.particleBasedIsolation = "particleBasedIsolationTmp:gedGsfElectronsTmp"
50 
51 #electrons pileup isolation sum
52 egmElectronIsolationPileUpCITK = _egmElectronIsolationCITKPileUp.clone(
53  srcToIsolate = "gedGsfElectronsTmp",
54  srcForIsolationCone = "pfPileUpAllChargedParticles"
55 )
56 
57 for iPSet in egmElectronIsolationPileUpCITK.isolationConeDefinitions:
58  iPSet.particleBasedIsolation = "particleBasedIsolationTmp:gedGsfElectronsTmp"
59 
60 photonIDValueMaps = cms.EDProducer(
61  "PhotonIDValueMapProducer",
62  ebReducedRecHitCollection = cms.InputTag("ecalRecHit","EcalRecHitsEB"),
63  eeReducedRecHitCollection = cms.InputTag("ecalRecHit","EcalRecHitsEE"),
64  esReducedRecHitCollection = cms.InputTag("ecalPreshowerRecHit","EcalRecHitsES"),
65  particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp","gedPhotonsTmp"),
66  pfCandidates = cms.InputTag("particleFlowTmp"),
67  src = cms.InputTag("gedPhotonsTmp"),
68  vertices = cms.InputTag("offlinePrimaryVertices"),
69  isAOD = cms.bool(True)
70  )
71 
72 
73 particleFlowEGammaFullTask = cms.Task(particleFlowEGamma, gedGsfElectronTaskTmp, gedPhotonTaskTmp, ootPhotonTask)
74 particleFlowEGammaFull = cms.Sequence(particleFlowEGammaFullTask)
75 particleFlowEGammaFinalTask = cms.Task(particleBasedIsolationTmp,
76  pfNoPileUpIsoTask,
77  pfNoPileUpCandidates,
78  pfPileUpAllChargedParticles,
79  egmPhotonIsolationCITK,
80  egmElectronIsolationCITK,
81  egmElectronIsolationPileUpCITK,
82  photonIDValueMaps,
83  gedPhotonTask,
84  gedElectronPFIsoTask)
85 particleFlowEGammaFinal = cms.Sequence(particleFlowEGammaFinalTask)
86 
87 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
88 pp_on_AA.toReplaceWith(particleFlowEGammaFullTask, particleFlowEGammaFullTask.copyAndExclude([ootPhotonTask]))
89 
gedGsfElectronSequence_cff
pfNoPileUpIso_cff
egmIsolationDefinitions_cff
particleBasedIsoProducer_cfi
pfBasedElectronIso_cff
pfSortByType_cff
gedPhotonSequence_cff
ootPhotonSequence_cff
For legacy reprocessing.
egmGedGsfElectronPFIsolation_cff
particleFlowEGamma_cfi