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