Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:22

0001 #
0002 # While reducing the AOD data tier produced in 80X to miniAOD, the electron
0003 # MVAs are computed before slimming. However, the object updators in
0004 # egammaObjectModificationsInMiniAOD_cff are written for pat::Electrons.
0005 # Therefore, we must adapt the object modifiers to the AOD level such that the
0006 # MVA producer can run on electrons that are updated and correctly store the
0007 # conversion rejection variables.
0008 #
0009 # Little annoyance: updating the object also requires computing the HEEP value
0010 # maps for the gedGsfElectrons, even though they are recomputed later from the
0011 # reducedEgamma collections. Unfortunately we can't use these HEEP value maps
0012 # that already exists, because reducedEgamma in turn depends on the
0013 # electronMVAValueMap producer. Hence, this is a problem of circular
0014 # dependency.
0015 #
0016 
0017 import FWCore.ParameterSet.Config as cms
0018 
0019 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
0020 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff import (
0021     egamma8XObjectUpdateModifier,
0022     egamma9X105XUpdateModifier,
0023 )
0024 from RecoEgamma.ElectronIdentification.heepIdVarValueMapProducer_cfi import heepIDVarValueMaps
0025 
0026 heepIDVarValueMapsAOD = heepIDVarValueMaps.copy()
0027 heepIDVarValueMapsAOD.dataFormat = 1
0028 
0029 gsfElectron8XObjectUpdateModifier = egamma8XObjectUpdateModifier.clone(
0030     ecalRecHitsEB="reducedEcalRecHitsEB", ecalRecHitsEE="reducedEcalRecHitsEE"
0031 )
0032 gsfElectron9X105XUpdateModifier = egamma9X105XUpdateModifier.clone(
0033     eleCollVMsAreKeyedTo="gedGsfElectrons",
0034     eleTrkIso="heepIDVarValueMapsAOD:eleTrkPtIso",
0035     eleTrkIso04="heepIDVarValueMapsAOD:eleTrkPtIso04",
0036     conversions="allConversions",
0037     ecalRecHitsEB="reducedEcalRecHitsEB",
0038     ecalRecHitsEE="reducedEcalRecHitsEE",
0039 )
0040 
0041 # we have dataformat changes to 106X so to read older releases we use egamma updators
0042 gedGsfElectronsFrom80XTo106X = cms.EDProducer(
0043     "ModifiedGsfElectronProducer",
0044     src=cms.InputTag("gedGsfElectrons"),
0045     modifierConfig=cms.PSet(
0046         modifications=cms.VPSet(gsfElectron8XObjectUpdateModifier, gsfElectron9X105XUpdateModifier)
0047     ),
0048 )
0049 
0050 gedGsfElectronsFrom80XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom80XTo106X)
0051 
0052 gedGsfElectronsFrom94XTo106X = cms.EDProducer(
0053     "ModifiedGsfElectronProducer",
0054     src=cms.InputTag("gedGsfElectrons"),
0055     modifierConfig=cms.PSet(
0056         modifications=cms.VPSet(gsfElectron9X105XUpdateModifier)
0057     ),
0058 )
0059 
0060 gedGsfElectronsFrom94XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom94XTo106X)