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 MetUnclustEnUpDeltaX =
Var(
"shiftedPx('UnclusteredEnUp')-px()", float, doc=
"Delta (METx_mod-METx) Unclustered Energy Up",precision=10),
21 MetUnclustEnUpDeltaY =
Var(
"shiftedPy('UnclusteredEnUp')-py()", float, doc=
"Delta (METy_mod-METy) Unclustered Energy Up",precision=10),
27 rawMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
29 name = cms.string(
"RawMET"),
30 doc = cms.string(
"raw PF MET"),
31 singleton = cms.bool(
True),
32 extension = cms.bool(
False),
34 pt =
Var(
"uncorPt", float, doc=
"pt", precision=10),
35 phi =
Var(
"uncorPhi", float, doc=
"phi", precision=10),
36 sumEt =
Var(
"uncorSumEt", float, doc=
"scalar sum of Et", precision=10),
41 caloMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
43 name = cms.string(
"CaloMET"),
44 doc = cms.string(
"Offline CaloMET (muon corrected)"),
45 singleton = cms.bool(
True),
46 extension = cms.bool(
False),
48 pt =
Var(
"caloMETPt", float, doc=
"pt", precision=10),
49 phi =
Var(
"caloMETPhi", float, doc=
"phi", precision=10),
50 sumEt =
Var(
"caloMETSumEt", float, doc=
"scalar sum of Et", precision=10),
54 puppiMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
55 src = cms.InputTag(
"slimmedMETsPuppi"),
56 name = cms.string(
"PuppiMET"),
57 doc = cms.string(
"PUPPI MET"),
58 singleton = cms.bool(
True),
59 extension = cms.bool(
False),
60 variables = cms.PSet(PTVars,
61 sumEt =
Var(
"sumEt()", float, doc=
"scalar sum of Et",precision=10),
65 tkMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
67 name = cms.string(
"TkMET"),
68 doc = cms.string(
"Track MET computed with tracks from PV0 ( pvAssociationQuality()>=4 ) "),
69 singleton = cms.bool(
True),
70 extension = cms.bool(
False),
72 pt =
Var(
"corPt('RawTrk')", float, doc=
"raw track MET pt",precision=10),
73 phi =
Var(
"corPhi('RawTrk')", float, doc=
"raw track MET phi",precision=10),
74 sumEt =
Var(
"corSumEt('RawTrk')", float, doc=
"raw track scalar sum of Et",precision=10),
78 chsMetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
80 name = cms.string(
"ChsMET"),
81 doc = cms.string(
"PF MET computed with CHS PF candidates"),
82 singleton = cms.bool(
True),
83 extension = cms.bool(
False),
85 pt =
Var(
"corPt('RawChs')", float, doc=
"raw chs PF MET pt",precision=10),
86 phi =
Var(
"corPhi('RawChs')", float, doc=
"raw chs PF MET phi",precision=10),
87 sumEt =
Var(
"corSumEt('RawChs')", float, doc=
"raw chs PF scalar sum of Et",precision=10),
91 metFixEE2017Table = metTable.clone()
92 metFixEE2017Table.src = cms.InputTag(
"slimmedMETsFixEE2017")
93 metFixEE2017Table.name = cms.string(
"METFixEE2017")
94 metFixEE2017Table.doc = cms.string(
"Type-1 corrected PF MET, with fixEE2017 definition")
97 metMCTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
99 name = cms.string(
"GenMET"),
100 doc = cms.string(
"Gen MET"),
101 singleton = cms.bool(
True),
102 extension = cms.bool(
False),
103 variables = cms.PSet(
104 pt =
Var(
"genMET.pt", float, doc=
"pt", precision=10),
105 phi =
Var(
"genMET.phi", float, doc=
"phi", precision=10),
111 metTables = cms.Sequence( metTable + rawMetTable + caloMetTable + puppiMetTable + tkMetTable + chsMetTable)
112 _withFixEE2017_sequence = cms.Sequence(metTables.copy() + metFixEE2017Table)
113 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
114 modifier.toReplaceWith(metTables,_withFixEE2017_sequence)
115 metMC = cms.Sequence( metMCTable )
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)