CMS 3D CMS Logo

met_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from PhysicsTools.NanoAOD.simpleSingletonCandidateFlatTableProducer_cfi import simpleSingletonCandidateFlatTableProducer
4 
5 
6 pfmetTable = simpleSingletonCandidateFlatTableProducer.clone(
7  src = cms.InputTag("slimmedMETs"),
8  name = cms.string("PFMET"),
9  doc = cms.string("slimmedMET, type-1 corrected PF MET"),
10  variables = cms.PSet(PTVars,
11 
12  covXX = Var("getSignificanceMatrix().At(0,0)",float,doc="xx element of met covariance matrix", precision=8),
13  covXY = Var("getSignificanceMatrix().At(0,1)",float,doc="xy element of met covariance matrix", precision=8),
14  covYY = Var("getSignificanceMatrix().At(1,1)",float,doc="yy element of met covariance matrix", precision=8),
15  significance = Var("metSignificance()", float, doc="MET significance",precision=10),
16  sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
17  sumPtUnclustered = Var("metSumPtUnclustered()", float, doc="sumPt used for MET significance",precision=10),
18  ptUnclusteredUp = Var("shiftedPt('UnclusteredEnUp')", float, doc="Unclustered up pt",precision=10),
19  ptUnclusteredDown = Var("shiftedPt('UnclusteredEnDown')", float, doc="Unclustered down pt",precision=10),
20  phiUnclusteredUp = Var("shiftedPhi('UnclusteredEnUp')", float, doc="Unclustered up phi",precision=10),
21  phiUnclusteredDown = Var("shiftedPhi('UnclusteredEnDown')", float, doc="Unclustered down phi",precision=10),
22 
23  ),
24 )
25 
26 
27 rawMetTable = simpleSingletonCandidateFlatTableProducer.clone(
28  src = pfmetTable.src,
29  name = cms.string("RawPFMET"),
30  doc = cms.string("raw PF MET"),
31  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
32  pt = Var("uncorPt", float, doc="pt", precision=10),
33  phi = Var("uncorPhi", float, doc="phi", precision=10),
34  sumEt = Var("uncorSumEt", float, doc="scalar sum of Et", precision=10),
35  ),
36 )
37 
38 
39 caloMetTable = simpleSingletonCandidateFlatTableProducer.clone(
40  src = pfmetTable.src,
41  name = cms.string("CaloMET"),
42  doc = cms.string("Offline CaloMET (muon corrected)"),
43  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
44  pt = Var("caloMETPt", float, doc="pt", precision=10),
45  phi = Var("caloMETPhi", float, doc="phi", precision=10),
46  sumEt = Var("caloMETSumEt", float, doc="scalar sum of Et", precision=10),
47  ),
48 )
49 
50 puppiMetTable = simpleSingletonCandidateFlatTableProducer.clone(
51  src = cms.InputTag("slimmedMETsPuppi"),
52  name = cms.string("PuppiMET"),
53  doc = cms.string("PUPPI MET"),
54  variables = cms.PSet(PTVars,
55  covXX = Var("getSignificanceMatrix().At(0,0)",float,doc="xx element of met covariance matrix", precision=8),
56  covXY = Var("getSignificanceMatrix().At(0,1)",float,doc="xy element of met covariance matrix", precision=8),
57  covYY = Var("getSignificanceMatrix().At(1,1)",float,doc="yy element of met covariance matrix", precision=8),
58  significance = Var("metSignificance()", float, doc="MET significance",precision=10),
59  sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
60  sumPtUnclustered = Var("metSumPtUnclustered()", float, doc="sumPt used for MET significance",precision=10),
61  ptUnclusteredUp = Var("shiftedPt('UnclusteredEnUp')", float, doc="Unclustered up pt",precision=10),
62  ptUnclusteredDown = Var("shiftedPt('UnclusteredEnDown')", float, doc="Unclustered down pt",precision=10),
63  phiUnclusteredUp = Var("shiftedPhi('UnclusteredEnUp')", float, doc="Unclustered up phi",precision=10),
64  phiUnclusteredDown = Var("shiftedPhi('UnclusteredEnDown')", float, doc="Unclustered down phi",precision=10),
65 
66  ),
67 )
68 
69 rawPuppiMetTable = simpleSingletonCandidateFlatTableProducer.clone(
70  src = puppiMetTable.src,
71  name = cms.string("RawPuppiMET"),
72  doc = cms.string("raw Puppi MET"),
73  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
74  pt = Var("uncorPt", float, doc="pt", precision=10),
75  phi = Var("uncorPhi", float, doc="phi", precision=10),
76  sumEt = Var("uncorSumEt", float, doc="scalar sum of Et", precision=10),
77  ),)
78 
79 
80 trkMetTable = simpleSingletonCandidateFlatTableProducer.clone(
81  src = pfmetTable.src,
82  name = cms.string("TrkMET"),
83  doc = cms.string("Track MET computed with tracks from PV0 ( pvAssociationQuality()>=4 ) "),
84  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
85  pt = Var("corPt('RawTrk')", float, doc="raw track MET pt",precision=10),
86  phi = Var("corPhi('RawTrk')", float, doc="raw track MET phi",precision=10),
87  sumEt = Var("corSumEt('RawTrk')", float, doc="raw track scalar sum of Et",precision=10),
88  ),
89 )
90 
91 
92 deepMetResolutionTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
93  # current deepMets are saved in slimmedMETs in MiniAOD,
94  # in the same way as chsMet/TrkMET
95  src = pfmetTable.src,
96  name = cms.string("DeepMETResolutionTune"),
97  doc = cms.string("Deep MET trained with resolution tune"),
98  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
99  pt = Var("corPt('RawDeepResolutionTune')", float, doc="DeepMET ResolutionTune pt",precision=-1),
100  phi = Var("corPhi('RawDeepResolutionTune')", float, doc="DeepmET ResolutionTune phi",precision=12),
101  ),
102 )
103 
104 deepMetResponseTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
105  src = pfmetTable.src,
106  name = cms.string("DeepMETResponseTune"),
107  doc = cms.string("Deep MET trained with extra response tune"),
108  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
109  pt = Var("corPt('RawDeepResponseTune')", float, doc="DeepMET ResponseTune pt",precision=-1),
110  phi = Var("corPhi('RawDeepResponseTune')", float, doc="DeepMET ResponseTune phi",precision=12),
111  ),
112 )
113 
114 metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
115  src = pfmetTable.src,
116  name = cms.string("GenMET"),
117  doc = cms.string("Gen MET"),
118  variables = cms.PSet(
119  pt = Var("genMET.pt", float, doc="pt", precision=10),
120  phi = Var("genMET.phi", float, doc="phi", precision=10),
121  ),
122 )
123 
124 
125 metTablesTask = cms.Task(pfmetTable, rawMetTable, caloMetTable, puppiMetTable, rawPuppiMetTable, trkMetTable,
126  deepMetResolutionTuneTable, deepMetResponseTuneTable )
127 metMCTask = cms.Task( metMCTable )
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16