CMS 3D CMS Logo

gedGsfElectronsTo106X_cff.py
Go to the documentation of this file.
1 #
2 # While reducing the AOD data tier produced in 80X to miniAOD, the electron
3 # MVAs are computed before slimming. However, the object updators in
4 # egammaObjectModificationsInMiniAOD_cff are written for pat::Electrons.
5 # Therefore, we must adapt the object modifiers to the AOD level such that the
6 # MVA producer can run on electrons that are updated and correctly store the
7 # conversion rejection variables.
8 #
9 # Little annoyance: updating the object also requires computing the HEEP value
10 # maps for the gedGsfElectrons, even though they are recomputed later from the
11 # reducedEgamma collections. Unfortunately we can't use these HEEP value maps
12 # that already exists, because reducedEgamma in turn depends on the
13 # electronMVAValueMap producer. Hence, this is a problem of circular
14 # dependency.
15 #
16 
17 import FWCore.ParameterSet.Config as cms
18 
19 from RecoEgamma.EgammaTools.egammaObjectModificationsInMiniAOD_cff import (
20  egamma8XObjectUpdateModifier,
21  egamma9X105XUpdateModifier,
22 )
23 from RecoEgamma.ElectronIdentification.heepIdVarValueMapProducer_cfi import heepIDVarValueMaps
24 
25 heepIDVarValueMapsAOD = heepIDVarValueMaps.copy()
26 heepIDVarValueMapsAOD.dataFormat = 1
27 
28 gsfElectron8XObjectUpdateModifier = egamma8XObjectUpdateModifier.clone(
29  ecalRecHitsEB="reducedEcalRecHitsEB", ecalRecHitsEE="reducedEcalRecHitsEE"
30 )
31 gsfElectron9X105XUpdateModifier = egamma9X105XUpdateModifier.clone(
32  eleCollVMsAreKeyedTo="gedGsfElectrons",
33  eleTrkIso="heepIDVarValueMapsAOD:eleTrkPtIso",
34  eleTrkIso04="heepIDVarValueMapsAOD:eleTrkPtIso04",
35  conversions="allConversions",
36  ecalRecHitsEB="reducedEcalRecHitsEB",
37  ecalRecHitsEE="reducedEcalRecHitsEE",
38 )
39 
40 # we have dataformat changes to 106X so to read older releases we use egamma updators
41 gedGsfElectronsFrom80XTo106X = cms.EDProducer(
42  "ModifiedGsfElectronProducer",
43  src=cms.InputTag("gedGsfElectrons"),
44  modifierConfig=cms.PSet(
45  modifications=cms.VPSet(gsfElectron8XObjectUpdateModifier, gsfElectron9X105XUpdateModifier)
46  ),
47 )
48 
49 gedGsfElectronsFrom80XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom80XTo106X)
50 
51 gedGsfElectronsFrom94XTo106X = cms.EDProducer(
52  "ModifiedGsfElectronProducer",
53  src=cms.InputTag("gedGsfElectrons"),
54  modifierConfig=cms.PSet(
55  modifications=cms.VPSet(gsfElectron9X105XUpdateModifier)
56  ),
57 )
58 
59 gedGsfElectronsFrom94XTo106XTask = cms.Task(heepIDVarValueMapsAOD, gedGsfElectronsFrom94XTo106X)