Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-24 04:45:08

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 RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff import (
0020     egamma8XObjectUpdateModifier,
0021     egamma9X105XUpdateModifier,
0022 )
0023 from RecoEgamma.ElectronIdentification.heepIdVarValueMapProducer_cfi import heepIDVarValueMaps
0024 
0025 heepIDVarValueMapsAOD = heepIDVarValueMaps.copy()
0026 heepIDVarValueMapsAOD.dataFormat = 1
0027 
0028 gsfElectron8XObjectUpdateModifier = egamma8XObjectUpdateModifier.clone(
0029     ecalRecHitsEB="reducedEcalRecHitsEB", ecalRecHitsEE="reducedEcalRecHitsEE"
0030 )
0031 gsfElectron9X105XUpdateModifier = egamma9X105XUpdateModifier.clone(
0032     eleCollVMsAreKeyedTo="gedGsfElectrons",
0033     eleTrkIso="heepIDVarValueMapsAOD:eleTrkPtIso",
0034     eleTrkIso04="heepIDVarValueMapsAOD:eleTrkPtIso04",
0035     conversions="allConversions",
0036     ecalRecHitsEB="reducedEcalRecHitsEB",
0037     ecalRecHitsEE="reducedEcalRecHitsEE",
0038 )
0039 
0040 # we have dataformat changes to 106X so to read older releases we use egamma updators
0041 gedGsfElectronsFrom80XTo106X = cms.EDProducer(
0042     "ModifiedGsfElectronProducer",
0043     src=cms.InputTag("gedGsfElectrons"),
0044     modifierConfig=cms.PSet(
0045         modifications=cms.VPSet(gsfElectron8XObjectUpdateModifier, gsfElectron9X105XUpdateModifier)
0046     ),
0047 )
0048 
0049 gedGsfElectronsFrom80XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom80XTo106X)
0050 
0051 gedGsfElectronsFrom94XTo106X = cms.EDProducer(
0052     "ModifiedGsfElectronProducer",
0053     src=cms.InputTag("gedGsfElectrons"),
0054     modifierConfig=cms.PSet(
0055         modifications=cms.VPSet(gsfElectron9X105XUpdateModifier)
0056     ),
0057 )
0058 
0059 gedGsfElectronsFrom94XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom94XTo106X)