1 import FWCore.ParameterSet.Config
as cms
4 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv1_cff
import run2_nanoAOD_94XMiniAODv1
5 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff
import run2_nanoAOD_94XMiniAODv2
8 metTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
9 src = cms.InputTag(
"slimmedMETs"),
10 name = cms.string(
"MET"),
11 doc = cms.string(
"slimmedMET, type-1 corrected PF MET"),
12 singleton = cms.bool(
True),
13 extension = cms.bool(
False),
14 variables = cms.PSet(PTVars,
15 sumEt =
Var(
"sumEt()", float, doc=
"scalar sum of Et",precision=10),
16 covXX =
Var(
"getSignificanceMatrix().At(0,0)",float,doc=
"xx element of met covariance matrix", precision=8),
17 covXY =
Var(
"getSignificanceMatrix().At(0,1)",float,doc=
"xy element of met covariance matrix", precision=8),
18 covYY =
Var(
"getSignificanceMatrix().At(1,1)",float,doc=
"yy element of met covariance matrix", precision=8),
19 significance =
Var(
"metSignificance()", float, doc=
"MET significance",precision=10),
20 sumPtUnclustered =
Var(
"metSumPtUnclustered()", float, doc=
"sumPt used for MET significance",precision=10),
21 MetUnclustEnUpDeltaX =
Var(
"shiftedPx('UnclusteredEnUp')-px()", float, doc=
"Delta (METx_mod-METx) Unclustered Energy Up",precision=10),
22 MetUnclustEnUpDeltaY =
Var(
"shiftedPy('UnclusteredEnUp')-py()", float, doc=
"Delta (METy_mod-METy) Unclustered Energy Up",precision=10),
28 rawMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
30 name = cms.string(
"RawMET"),
31 doc = cms.string(
"raw PF MET"),
32 singleton = cms.bool(
True),
33 extension = cms.bool(
False),
35 pt =
Var(
"uncorPt", float, doc=
"pt", precision=10),
36 phi =
Var(
"uncorPhi", float, doc=
"phi", precision=10),
37 sumEt =
Var(
"uncorSumEt", float, doc=
"scalar sum of Et", precision=10),
42 caloMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
44 name = cms.string(
"CaloMET"),
45 doc = cms.string(
"Offline CaloMET (muon corrected)"),
46 singleton = cms.bool(
True),
47 extension = cms.bool(
False),
49 pt =
Var(
"caloMETPt", float, doc=
"pt", precision=10),
50 phi =
Var(
"caloMETPhi", float, doc=
"phi", precision=10),
51 sumEt =
Var(
"caloMETSumEt", float, doc=
"scalar sum of Et", precision=10),
55 puppiMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
56 src = cms.InputTag(
"slimmedMETsPuppi"),
57 name = cms.string(
"PuppiMET"),
58 doc = cms.string(
"PUPPI MET"),
59 singleton = cms.bool(
True),
60 extension = cms.bool(
False),
61 variables = cms.PSet(PTVars,
62 sumEt =
Var(
"sumEt()", float, doc=
"scalar sum of Et",precision=10),
63 ptJERUp =
Var(
"shiftedPt('JetResUp')", float, doc=
"JER up pt",precision=10),
64 ptJERDown =
Var(
"shiftedPt('JetResDown')", float, doc=
"JER down pt",precision=10),
65 phiJERUp =
Var(
"shiftedPhi('JetResUp')", float, doc=
"JER up phi",precision=10),
66 phiJERDown =
Var(
"shiftedPhi('JetResDown')", float, doc=
"JER down phi",precision=10),
67 ptJESUp =
Var(
"shiftedPt('JetEnUp')", float, doc=
"JES up pt",precision=10),
68 ptJESDown =
Var(
"shiftedPt('JetEnDown')", float, doc=
"JES down pt",precision=10),
69 phiJESUp =
Var(
"shiftedPhi('JetEnUp')", float, doc=
"JES up phi",precision=10),
70 phiJESDown =
Var(
"shiftedPhi('JetEnDown')", float, doc=
"JES down phi",precision=10),
71 ptUnclusteredUp =
Var(
"shiftedPt('UnclusteredEnUp')", float, doc=
"Unclustered up pt",precision=10),
72 ptUnclusteredDown =
Var(
"shiftedPt('UnclusteredEnDown')", float, doc=
"Unclustered down pt",precision=10),
73 phiUnclusteredUp =
Var(
"shiftedPhi('UnclusteredEnUp')", float, doc=
"Unclustered up phi",precision=10),
74 phiUnclusteredDown =
Var(
"shiftedPhi('UnclusteredEnDown')", float, doc=
"Unclustered down phi",precision=10),
78 rawPuppiMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
79 src = puppiMetTable.src,
80 name = cms.string(
"RawPuppiMET"),
81 doc = cms.string(
"raw Puppi MET"),
82 singleton = cms.bool(
True),
83 extension = cms.bool(
False),
85 pt =
Var(
"uncorPt", float, doc=
"pt", precision=10),
86 phi =
Var(
"uncorPhi", float, doc=
"phi", precision=10),
87 sumEt =
Var(
"uncorSumEt", float, doc=
"scalar sum of Et", precision=10),
91 tkMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
93 name = cms.string(
"TkMET"),
94 doc = cms.string(
"Track MET computed with tracks from PV0 ( pvAssociationQuality()>=4 ) "),
95 singleton = cms.bool(
True),
96 extension = cms.bool(
False),
98 pt =
Var(
"corPt('RawTrk')", float, doc=
"raw track MET pt",precision=10),
99 phi =
Var(
"corPhi('RawTrk')", float, doc=
"raw track MET phi",precision=10),
100 sumEt =
Var(
"corSumEt('RawTrk')", float, doc=
"raw track scalar sum of Et",precision=10),
104 chsMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
106 name = cms.string(
"ChsMET"),
107 doc = cms.string(
"PF MET computed with CHS PF candidates"),
108 singleton = cms.bool(
True),
109 extension = cms.bool(
False),
110 variables = cms.PSet(
111 pt =
Var(
"corPt('RawChs')", float, doc=
"raw chs PF MET pt",precision=10),
112 phi =
Var(
"corPhi('RawChs')", float, doc=
"raw chs PF MET phi",precision=10),
113 sumEt =
Var(
"corSumEt('RawChs')", float, doc=
"raw chs PF scalar sum of Et",precision=10),
117 deepMetResolutionTuneTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
121 name = cms.string(
"DeepMETResolutionTune"),
122 doc = cms.string(
"Deep MET trained with resolution tune"),
123 singleton = cms.bool(
True),
124 extension = cms.bool(
False),
125 variables = cms.PSet(
126 pt =
Var(
"corPt('RawDeepResolutionTune')", float, doc=
"DeepMET ResolutionTune pt",precision=-1),
127 phi =
Var(
"corPhi('RawDeepResolutionTune')", float, doc=
"DeepmET ResolutionTune phi",precision=12),
131 deepMetResponseTuneTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
133 name = cms.string(
"DeepMETResponseTune"),
134 doc = cms.string(
"Deep MET trained with extra response tune"),
135 singleton = cms.bool(
True),
136 extension = cms.bool(
False),
137 variables = cms.PSet(
138 pt =
Var(
"corPt('RawDeepResponseTune')", float, doc=
"DeepMET ResponseTune pt",precision=-1),
139 phi =
Var(
"corPhi('RawDeepResponseTune')", float, doc=
"DeepMET ResponseTune phi",precision=12),
143 metFixEE2017Table = metTable.clone()
144 metFixEE2017Table.src = cms.InputTag(
"slimmedMETsFixEE2017")
145 metFixEE2017Table.name = cms.string(
"METFixEE2017")
146 metFixEE2017Table.doc = cms.string(
"Type-1 corrected PF MET, with fixEE2017 definition")
149 metMCTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
151 name = cms.string(
"GenMET"),
152 doc = cms.string(
"Gen MET"),
153 singleton = cms.bool(
True),
154 extension = cms.bool(
False),
155 variables = cms.PSet(
156 pt =
Var(
"genMET.pt", float, doc=
"pt", precision=10),
157 phi =
Var(
"genMET.phi", float, doc=
"phi", precision=10),
163 metTables = cms.Sequence( metTable + rawMetTable + caloMetTable + puppiMetTable + rawPuppiMetTable+ tkMetTable + chsMetTable)
164 deepMetTables = cms.Sequence( deepMetResolutionTuneTable + deepMetResponseTuneTable )
165 _withFixEE2017_sequence = cms.Sequence(metTables.copy() + metFixEE2017Table)
166 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
167 modifier.toReplaceWith(metTables,_withFixEE2017_sequence)
168 metMC = cms.Sequence( metMCTable )
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)