CMS 3D CMS Logo

reducedEgamma_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 
5 reducedEgamma = cms.EDProducer("ReducedEGProducer",
6  keepPhotons = cms.string("hadTowOverEm()<0.15 && pt>10 && (pt>14 || chargedHadronIso()<10)"), #keep in output
7  slimRelinkPhotons = cms.string("hadTowOverEm()<0.15 && pt>10 && (pt>14 || chargedHadronIso()<10)"), #keep only slimmed SuperCluster plus seed cluster
8  relinkPhotons = cms.string("(r9()>0.8 || chargedHadronIso()<20 || chargedHadronIso()<0.3*pt())"), #keep all associated clusters/rechits/conversions
9  keepOOTPhotons = cms.string("pt>10"), #keep in output
10  slimRelinkOOTPhotons = cms.string("pt>10"), #keep only slimmed SuperCluster plus seed cluster
11  relinkOOTPhotons = cms.string("(r9()>0.8)"), #keep all associated clusters/rechits/conversions
12  keepGsfElectrons = cms.string(""), #keep in output
13  slimRelinkGsfElectrons = cms.string(""), #keep only slimmed SuperCluster plus seed cluster
14  relinkGsfElectrons = cms.string("pt>5"), #keep all associated clusters/rechits/conversions
15  photons = cms.InputTag("gedPhotons"),
16  ootPhotons = cms.InputTag("ootPhotons"),
17  gsfElectrons = cms.InputTag("gedGsfElectrons"),
18  conversions = cms.InputTag("allConversions"),
19  gsfTracks = cms.InputTag("electronGsfTracks"),
20  singleConversions = cms.InputTag("particleFlowEGamma"),
21  barrelEcalHits = cms.InputTag("reducedEcalRecHitsEB"),
22  endcapEcalHits = cms.InputTag("reducedEcalRecHitsEE"),
23  preshowerEcalHits = cms.InputTag("reducedEcalRecHitsES"),
24  hbheHits= cms.InputTag("reducedHcalRecHits","hbhereco"),
25  photonsPFValMap = cms.InputTag("particleBasedIsolation","gedPhotons"),
26  gsfElectronsPFValMap = cms.InputTag("particleBasedIsolation","gedGsfElectrons"),
27  photonIDSources = cms.VInputTag(),
28  photonIDOutput = cms.vstring(),
29  gsfElectronIDSources = cms.VInputTag(),
30  gsfElectronIDOutput = cms.vstring(),
31  photonFloatValueMapSources = cms.VInputTag(),
32  photonFloatValueMapOutput = cms.vstring(),
33  ootPhotonFloatValueMapSources = cms.VInputTag(),
34  ootPhotonFloatValueMapOutput = cms.vstring(),
35  hiPhotonIsolationMapInput = cms.InputTag(""),
36  hiPhotonIsolationMapOutput = cms.string(""),
37  gsfElectronFloatValueMapSources = cms.VInputTag(),
38  gsfElectronFloatValueMapOutput = cms.vstring(),
39  applyPhotonCalibOnData = cms.bool(False),
40  applyPhotonCalibOnMC = cms.bool(False),
41  applyGsfElectronCalibOnData = cms.bool(False),
42  applyGsfElectronCalibOnMC = cms.bool(False),
43  photonCalibEnergySource = cms.InputTag(""),
44  photonCalibEnergyErrSource = cms.InputTag(""),
45  gsfElectronCalibEnergySource = cms.InputTag(""),
46  gsfElectronCalibEnergyErrSource = cms.InputTag(""),
47  gsfElectronCalibEcalEnergySource = cms.InputTag(""),
48  gsfElectronCalibEcalEnergyErrSource = cms.InputTag(""),
49  hcalHitSel = interestingEgammaIsoHCALSel
50 )
51 
52 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
53 phase2_common.toModify(reducedEgamma,
54  preshowerEcalHits = "",
55 )
56 
57 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
58 run2_miniAOD_80XLegacy.toModify(
59  reducedEgamma,
60  photonFloatValueMapSources = ["photonEcalPFClusterIsolationProducer",
61  "photonHcalPFClusterIsolationProducer"],
62  photonFloatValueMapOutput = ["phoEcalPFClusIso",
63  "phoHcalPFClusIso"],
64  ootPhotonFloatValueMapSources = ["ootPhotonEcalPFClusterIsolationProducer"],
65  ootPhotonFloatValueMapOutput = ["ootPhoEcalPFClusIso"],
66  gsfElectronFloatValueMapSources = ["electronEcalPFClusterIsolationProducer",
67  "electronHcalPFClusterIsolationProducer"],
68  gsfElectronFloatValueMapOutput = ["eleEcalPFClusIso",
69  "eleHcalPFClusIso"]
70 )
71 
72 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
73 run2_miniAOD_94XFall17.toModify(
74  reducedEgamma,
75  photonFloatValueMapSources = ["photonEcalPFClusterIsolationProducer",
76  "photonHcalPFClusterIsolationProducer"],
77  photonFloatValueMapOutput = ["phoEcalPFClusIso",
78  "phoHcalPFClusIso"],
79  ootPhotonFloatValueMapSources = ["ootPhotonEcalPFClusterIsolationProducer",
80  "ootPhotonHcalPFClusterIsolationProducer"],
81  ootPhotonFloatValueMapOutput = ["ootPhoEcalPFClusIso",
82  "ootPhoHcalPFClusIso"],
83  gsfElectronFloatValueMapSources = ["electronEcalPFClusterIsolationProducer",
84  "electronHcalPFClusterIsolationProducer"],
85  gsfElectronFloatValueMapOutput = ["eleEcalPFClusIso",
86  "eleHcalPFClusIso"],
87 )
88 
89 from RecoEgamma.EgammaPhotonProducers.reducedEgamma_tools import calibrateReducedEgamma
90 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
91 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
92 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
93 modifyReducedEGammaRun2MiniAOD = (
94  run2_miniAOD_94XFall17 | run2_miniAOD_80XLegacy | run2_miniAOD_UL).makeProcessModifier(calibrateReducedEgamma)
95 
96 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
97 
98 pp_on_AA.toModify(
99  reducedEgamma,
100  ootPhotons = "",
101  keepPhotons = "pt>15 && abs(eta)<2.5",
102  slimRelinkPhotons = "pt>15 && abs(eta)<2.5",
103  relinkPhotons = "pt>15 && abs(eta)<2.5",
104  hiPhotonIsolationMapInput = "photonIsolationHIProducerppGED",
105  hiPhotonIsolationMapOutput = "photonIsolationHIProducerppGED"
106 )
107 
108 from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X
109 run2_miniAOD_pp_on_AA_103X.toModify(
110  reducedEgamma,
111  photonsPFValMap = "pfEGammaToCandidateRemapperCleaned:photons",
112  gsfElectronsPFValMap = "pfEGammaToCandidateRemapperCleaned:electrons"
113 )