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!
11 from RecoEgamma.EgammaIsolationAlgos.particleBasedIsoProducer_cfi import particleBasedIsolation as _particleBasedIsolation
12 from RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationAOD_cff import egmPhotonIsolationAOD as _egmPhotonIsolationAOD
13 from RecoEgamma.EgammaIsolationAlgos.egmGedGsfElectronPFIsolation_cff import egmGedGsfElectronPFNoPileUpIsolationMapBasedVeto as _egmElectronIsolationCITK
14 from RecoEgamma.EgammaIsolationAlgos.egmGedGsfElectronPFIsolation_cff import egmGedGsfElectronPFPileUpIsolationMapBasedVeto as _egmElectronIsolationCITKPileUp
15 
16 
17 from CommonTools.ParticleFlow.pfNoPileUpIso_cff import pfPileUpIso, pfNoPileUpIso, pfNoPileUpIsoSequence
18 from CommonTools.ParticleFlow.ParticleSelectors.pfSortByType_cff import pfPileUpAllChargedParticles
20 from RecoEgamma.EgammaIsolationAlgos.egmIsoConeDefinitions_cfi import IsoConeDefinitions
21 
22 particleBasedIsolationTmp = _particleBasedIsolation.clone()
23 particleBasedIsolationTmp.photonProducer = cms.InputTag("gedPhotonsTmp")
24 particleBasedIsolationTmp.electronProducer = cms.InputTag("gedGsfElectronsTmp")
25 particleBasedIsolationTmp.pfCandidates = cms.InputTag("particleFlowTmp")
26 particleBasedIsolationTmp.valueMapPhoPFblockIso = cms.string("gedPhotonsTmp")
27 particleBasedIsolationTmp.valueMapElePFblockIso = cms.string("gedGsfElectronsTmp")
28 
29 egmPhotonIsolationCITK = _egmPhotonIsolationAOD.clone()
30 egmElectronIsolationCITK = _egmElectronIsolationCITK.clone()
31 egmElectronIsolationPileUpCITK = _egmElectronIsolationCITKPileUp.clone()
32 
33 #change particleBasedIsolation object to tmp
34 IsoConeDefinitionsPhotonsTmp = copy.deepcopy(IsoConeDefinitions)
35 for iPSet in IsoConeDefinitionsPhotonsTmp:
36  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedPhotonsTmp")
37 
38 for iPSet in egmElectronIsolationCITK.isolationConeDefinitions:
39  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedGsfElectronsTmp")
40 
41 for iPSet in egmElectronIsolationPileUpCITK.isolationConeDefinitions:
42  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedGsfElectronsTmp")
43 
44 #photon isolation sums
45 egmPhotonIsolationCITK.srcToIsolate = cms.InputTag("gedPhotonsTmp")
46 egmPhotonIsolationCITK.srcForIsolationCone = cms.InputTag("pfNoPileUpCandidates")
47 egmPhotonIsolationCITK.isolationConeDefinitions = IsoConeDefinitionsPhotonsTmp
48 #electrons isolation sums
49 egmElectronIsolationCITK.srcToIsolate = cms.InputTag("gedGsfElectronsTmp")
50 egmElectronIsolationCITK.srcForIsolationCone = cms.InputTag("pfNoPileUpCandidates")
51 #electrons pileup isolation sum
52 egmElectronIsolationPileUpCITK.srcToIsolate = cms.InputTag("gedGsfElectronsTmp")
53 egmElectronIsolationPileUpCITK.srcForIsolationCone = cms.InputTag("pfPileUpAllChargedParticles")
54 
55 particleFlowEGammaFull = cms.Sequence(particleFlowEGamma*gedGsfElectronSequenceTmp*gedPhotonSequenceTmp)
56 particleFlowEGammaFinal = cms.Sequence(particleBasedIsolationTmp*pfNoPileUpIsoSequence*pfNoPileUpCandidates*pfPileUpAllChargedParticles*\
57 egmPhotonIsolationCITK*egmElectronIsolationCITK*egmElectronIsolationPileUpCITK*gedPhotonSequence*gedElectronPFIsoSequence)