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 metTable = simpleSingletonCandidateFlatTableProducer.clone(
7  src = cms.InputTag("slimmedMETs"),
8  name = cms.string("MET"),
9  doc = cms.string("slimmedMET, type-1 corrected PF MET"),
10  variables = cms.PSet(PTVars,
11  sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
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  sumPtUnclustered = Var("metSumPtUnclustered()", float, doc="sumPt used for MET significance",precision=10),
17  MetUnclustEnUpDeltaX = Var("shiftedPx('UnclusteredEnUp')-px()", float, doc="Delta (METx_mod-METx) Unclustered Energy Up",precision=10),
18  MetUnclustEnUpDeltaY = Var("shiftedPy('UnclusteredEnUp')-py()", float, doc="Delta (METy_mod-METy) Unclustered Energy Up",precision=10),
19 
20  ),
21 )
22 
23 
24 rawMetTable = simpleSingletonCandidateFlatTableProducer.clone(
25  src = metTable.src,
26  name = cms.string("RawMET"),
27  doc = cms.string("raw PF MET"),
28  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
29  pt = Var("uncorPt", float, doc="pt", precision=10),
30  phi = Var("uncorPhi", float, doc="phi", precision=10),
31  sumEt = Var("uncorSumEt", float, doc="scalar sum of Et", precision=10),
32  ),
33 )
34 
35 
36 caloMetTable = simpleSingletonCandidateFlatTableProducer.clone(
37  src = metTable.src,
38  name = cms.string("CaloMET"),
39  doc = cms.string("Offline CaloMET (muon corrected)"),
40  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
41  pt = Var("caloMETPt", float, doc="pt", precision=10),
42  phi = Var("caloMETPhi", float, doc="phi", precision=10),
43  sumEt = Var("caloMETSumEt", float, doc="scalar sum of Et", precision=10),
44  ),
45 )
46 
47 puppiMetTable = simpleSingletonCandidateFlatTableProducer.clone(
48  src = cms.InputTag("slimmedMETsPuppi"),
49  name = cms.string("PuppiMET"),
50  doc = cms.string("PUPPI MET"),
51  variables = cms.PSet(PTVars,
52  sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
53  ptJERUp = Var("shiftedPt('JetResUp')", float, doc="JER up pt",precision=10),
54  ptJERDown = Var("shiftedPt('JetResDown')", float, doc="JER down pt",precision=10),
55  phiJERUp = Var("shiftedPhi('JetResUp')", float, doc="JER up phi",precision=10),
56  phiJERDown = Var("shiftedPhi('JetResDown')", float, doc="JER down phi",precision=10),
57  ptJESUp = Var("shiftedPt('JetEnUp')", float, doc="JES up pt",precision=10),
58  ptJESDown = Var("shiftedPt('JetEnDown')", float, doc="JES down pt",precision=10),
59  phiJESUp = Var("shiftedPhi('JetEnUp')", float, doc="JES up phi",precision=10),
60  phiJESDown = Var("shiftedPhi('JetEnDown')", float, doc="JES down phi",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 rawPuppiMetTable = simpleSingletonCandidateFlatTableProducer.clone(
69  src = puppiMetTable.src,
70  name = cms.string("RawPuppiMET"),
71  doc = cms.string("raw Puppi MET"),
72  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
73  pt = Var("uncorPt", float, doc="pt", precision=10),
74  phi = Var("uncorPhi", float, doc="phi", precision=10),
75  sumEt = Var("uncorSumEt", float, doc="scalar sum of Et", precision=10),
76  ),)
77 
78 
79 tkMetTable = simpleSingletonCandidateFlatTableProducer.clone(
80  src = metTable.src,
81  name = cms.string("TkMET"),
82  doc = cms.string("Track MET computed with tracks from PV0 ( pvAssociationQuality()>=4 ) "),
83  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
84  pt = Var("corPt('RawTrk')", float, doc="raw track MET pt",precision=10),
85  phi = Var("corPhi('RawTrk')", float, doc="raw track MET phi",precision=10),
86  sumEt = Var("corSumEt('RawTrk')", float, doc="raw track scalar sum of Et",precision=10),
87  ),
88 )
89 
90 chsMetTable = simpleSingletonCandidateFlatTableProducer.clone(
91  src = metTable.src,
92  name = cms.string("ChsMET"),
93  doc = cms.string("PF MET computed with CHS PF candidates"),
94  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
95  pt = Var("corPt('RawChs')", float, doc="raw chs PF MET pt",precision=10),
96  phi = Var("corPhi('RawChs')", float, doc="raw chs PF MET phi",precision=10),
97  sumEt = Var("corSumEt('RawChs')", float, doc="raw chs PF scalar sum of Et",precision=10),
98  ),
99 )
100 
101 deepMetResolutionTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
102  # current deepMets are saved in slimmedMETs in MiniAOD,
103  # in the same way as chsMet/TkMET
104  src = metTable.src,
105  name = cms.string("DeepMETResolutionTune"),
106  doc = cms.string("Deep MET trained with resolution tune"),
107  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
108  pt = Var("corPt('RawDeepResolutionTune')", float, doc="DeepMET ResolutionTune pt",precision=-1),
109  phi = Var("corPhi('RawDeepResolutionTune')", float, doc="DeepmET ResolutionTune phi",precision=12),
110  ),
111 )
112 
113 deepMetResponseTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
114  src = metTable.src,
115  name = cms.string("DeepMETResponseTune"),
116  doc = cms.string("Deep MET trained with extra response tune"),
117  variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
118  pt = Var("corPt('RawDeepResponseTune')", float, doc="DeepMET ResponseTune pt",precision=-1),
119  phi = Var("corPhi('RawDeepResponseTune')", float, doc="DeepMET ResponseTune phi",precision=12),
120  ),
121 )
122 
123 metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
124  src = metTable.src,
125  name = cms.string("GenMET"),
126  doc = cms.string("Gen MET"),
127  variables = cms.PSet(
128  pt = Var("genMET.pt", float, doc="pt", precision=10),
129  phi = Var("genMET.phi", float, doc="phi", precision=10),
130  ),
131 )
132 
133 
134 metTablesTask = cms.Task( metTable, rawMetTable, caloMetTable, puppiMetTable, rawPuppiMetTable, tkMetTable, chsMetTable, deepMetResolutionTuneTable, deepMetResponseTuneTable )
135 metMCTask = cms.Task( metMCTable )
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16