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 particleBasedIsolationTmp.photonProducer = cms.InputTag("gedPhotonsTmp")
25 particleBasedIsolationTmp.electronProducer = cms.InputTag("gedGsfElectronsTmp")
26 particleBasedIsolationTmp.pfCandidates = cms.InputTag("particleFlowTmp")
27 particleBasedIsolationTmp.valueMapPhoPFblockIso = cms.string("gedPhotonsTmp")
28 particleBasedIsolationTmp.valueMapElePFblockIso = cms.string("gedGsfElectronsTmp")
29 
30 egmPhotonIsolationCITK = _egmPhotonIsolationAOD.clone()
31 egmElectronIsolationCITK = _egmElectronIsolationCITK.clone()
32 egmElectronIsolationPileUpCITK = _egmElectronIsolationCITKPileUp.clone()
33 
34 #change particleBasedIsolation object to tmp
35 IsoConeDefinitionsPhotonsTmp = copy.deepcopy(IsoConeDefinitions)
36 for iPSet in IsoConeDefinitionsPhotonsTmp:
37  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedPhotonsTmp")
38 
39 for iPSet in egmElectronIsolationCITK.isolationConeDefinitions:
40  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedGsfElectronsTmp")
41 
42 for iPSet in egmElectronIsolationPileUpCITK.isolationConeDefinitions:
43  iPSet.particleBasedIsolation = cms.InputTag("particleBasedIsolationTmp", "gedGsfElectronsTmp")
44 
45 #photon isolation sums
46 egmPhotonIsolationCITK.srcToIsolate = cms.InputTag("gedPhotonsTmp")
47 egmPhotonIsolationCITK.srcForIsolationCone = cms.InputTag("pfNoPileUpCandidates")
48 egmPhotonIsolationCITK.isolationConeDefinitions = IsoConeDefinitionsPhotonsTmp
49 #electrons isolation sums
50 egmElectronIsolationCITK.srcToIsolate = cms.InputTag("gedGsfElectronsTmp")
51 egmElectronIsolationCITK.srcForIsolationCone = cms.InputTag("pfNoPileUpCandidates")
52 #electrons pileup isolation sum
53 egmElectronIsolationPileUpCITK.srcToIsolate = cms.InputTag("gedGsfElectronsTmp")
54 egmElectronIsolationPileUpCITK.srcForIsolationCone = cms.InputTag("pfPileUpAllChargedParticles")
55 
56 particleFlowEGammaFull = cms.Sequence(particleFlowEGamma*gedGsfElectronSequenceTmp*gedPhotonSequenceTmp*ootPhotonSequence)
57 particleFlowEGammaFinal = cms.Sequence(particleBasedIsolationTmp*\
58 pfNoPileUpIsoSequence*cms.ignore(pfNoPileUpCandidates)*cms.ignore(pfPileUpAllChargedParticles)*\
59 egmPhotonIsolationCITK*egmElectronIsolationCITK*egmElectronIsolationPileUpCITK*gedPhotonSequence*gedElectronPFIsoSequence)
60 
61 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
62 pp_on_AA_2018.toReplaceWith(particleFlowEGammaFull, particleFlowEGammaFull.copyAndExclude([ootPhotonSequence]))
For legacy reprocessing.