Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFMet and PuppiMET Branches #44038

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 26 additions & 34 deletions PhysicsTools/NanoAOD/python/met_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@
from PhysicsTools.NanoAOD.simpleSingletonCandidateFlatTableProducer_cfi import simpleSingletonCandidateFlatTableProducer

##################### Tables for final output and docs ##########################
metTable = simpleSingletonCandidateFlatTableProducer.clone(
pfmetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = cms.InputTag("slimmedMETs"),
name = cms.string("MET"),
name = cms.string("PFMET"),
doc = cms.string("slimmedMET, type-1 corrected PF MET"),
variables = cms.PSet(PTVars,
sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),

covXX = Var("getSignificanceMatrix().At(0,0)",float,doc="xx element of met covariance matrix", precision=8),
covXY = Var("getSignificanceMatrix().At(0,1)",float,doc="xy element of met covariance matrix", precision=8),
covYY = Var("getSignificanceMatrix().At(1,1)",float,doc="yy element of met covariance matrix", precision=8),
significance = Var("metSignificance()", float, doc="MET significance",precision=10),
sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
sumPtUnclustered = Var("metSumPtUnclustered()", float, doc="sumPt used for MET significance",precision=10),
MetUnclustEnUpDeltaX = Var("shiftedPx('UnclusteredEnUp')-px()", float, doc="Delta (METx_mod-METx) Unclustered Energy Up",precision=10),
MetUnclustEnUpDeltaY = Var("shiftedPy('UnclusteredEnUp')-py()", float, doc="Delta (METy_mod-METy) Unclustered Energy Up",precision=10),
ptUnclusteredUp = Var("shiftedPt('UnclusteredEnUp')", float, doc="Unclustered up pt",precision=10),
ptUnclusteredDown = Var("shiftedPt('UnclusteredEnDown')", float, doc="Unclustered down pt",precision=10),
phiUnclusteredUp = Var("shiftedPhi('UnclusteredEnUp')", float, doc="Unclustered up phi",precision=10),
phiUnclusteredDown = Var("shiftedPhi('UnclusteredEnDown')", float, doc="Unclustered down phi",precision=10),

),
)


rawMetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
name = cms.string("RawMET"),
src = pfmetTable.src,
name = cms.string("RawPFMET"),
doc = cms.string("raw PF MET"),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
pt = Var("uncorPt", float, doc="pt", precision=10),
Expand All @@ -34,7 +37,7 @@


caloMetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
src = pfmetTable.src,
name = cms.string("CaloMET"),
doc = cms.string("Offline CaloMET (muon corrected)"),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
Expand All @@ -49,19 +52,17 @@
name = cms.string("PuppiMET"),
doc = cms.string("PUPPI MET"),
variables = cms.PSet(PTVars,
covXX = Var("getSignificanceMatrix().At(0,0)",float,doc="xx element of met covariance matrix", precision=8),
covXY = Var("getSignificanceMatrix().At(0,1)",float,doc="xy element of met covariance matrix", precision=8),
covYY = Var("getSignificanceMatrix().At(1,1)",float,doc="yy element of met covariance matrix", precision=8),
significance = Var("metSignificance()", float, doc="MET significance",precision=10),
sumEt = Var("sumEt()", float, doc="scalar sum of Et",precision=10),
ptJERUp = Var("shiftedPt('JetResUp')", float, doc="JER up pt",precision=10),
ptJERDown = Var("shiftedPt('JetResDown')", float, doc="JER down pt",precision=10),
phiJERUp = Var("shiftedPhi('JetResUp')", float, doc="JER up phi",precision=10),
phiJERDown = Var("shiftedPhi('JetResDown')", float, doc="JER down phi",precision=10),
ptJESUp = Var("shiftedPt('JetEnUp')", float, doc="JES up pt",precision=10),
ptJESDown = Var("shiftedPt('JetEnDown')", float, doc="JES down pt",precision=10),
phiJESUp = Var("shiftedPhi('JetEnUp')", float, doc="JES up phi",precision=10),
phiJESDown = Var("shiftedPhi('JetEnDown')", float, doc="JES down phi",precision=10),
sumPtUnclustered = Var("metSumPtUnclustered()", float, doc="sumPt used for MET significance",precision=10),
ptUnclusteredUp = Var("shiftedPt('UnclusteredEnUp')", float, doc="Unclustered up pt",precision=10),
ptUnclusteredDown = Var("shiftedPt('UnclusteredEnDown')", float, doc="Unclustered down pt",precision=10),
phiUnclusteredUp = Var("shiftedPhi('UnclusteredEnUp')", float, doc="Unclustered up phi",precision=10),
phiUnclusteredDown = Var("shiftedPhi('UnclusteredEnDown')", float, doc="Unclustered down phi",precision=10),

),
)

Expand All @@ -76,9 +77,9 @@
),)


tkMetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
name = cms.string("TkMET"),
trkMetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = pfmetTable.src,
name = cms.string("TrkMET"),
doc = cms.string("Track MET computed with tracks from PV0 ( pvAssociationQuality()>=4 ) "),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
pt = Var("corPt('RawTrk')", float, doc="raw track MET pt",precision=10),
Expand All @@ -87,21 +88,11 @@
),
)

chsMetTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
name = cms.string("ChsMET"),
doc = cms.string("PF MET computed with CHS PF candidates"),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
pt = Var("corPt('RawChs')", float, doc="raw chs PF MET pt",precision=10),
phi = Var("corPhi('RawChs')", float, doc="raw chs PF MET phi",precision=10),
sumEt = Var("corSumEt('RawChs')", float, doc="raw chs PF scalar sum of Et",precision=10),
),
)

deepMetResolutionTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
# current deepMets are saved in slimmedMETs in MiniAOD,
# in the same way as chsMet/TkMET
src = metTable.src,
# in the same way as chsMet/TrkMET
src = pfmetTable.src,
name = cms.string("DeepMETResolutionTune"),
doc = cms.string("Deep MET trained with resolution tune"),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
Expand All @@ -111,7 +102,7 @@
)

deepMetResponseTuneTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
src = pfmetTable.src,
name = cms.string("DeepMETResponseTune"),
doc = cms.string("Deep MET trained with extra response tune"),
variables = cms.PSet(#NOTA BENE: we don't copy PTVars here!
Expand All @@ -121,7 +112,7 @@
)

metMCTable = simpleSingletonCandidateFlatTableProducer.clone(
src = metTable.src,
src = pfmetTable.src,
name = cms.string("GenMET"),
doc = cms.string("Gen MET"),
variables = cms.PSet(
Expand All @@ -131,5 +122,6 @@
)


metTablesTask = cms.Task( metTable, rawMetTable, caloMetTable, puppiMetTable, rawPuppiMetTable, tkMetTable, chsMetTable, deepMetResolutionTuneTable, deepMetResponseTuneTable )
metTablesTask = cms.Task(pfmetTable, rawMetTable, caloMetTable, puppiMetTable, rawPuppiMetTable, trkMetTable,
deepMetResolutionTuneTable, deepMetResponseTuneTable )
metMCTask = cms.Task( metMCTable )
60 changes: 31 additions & 29 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
Plot1D('sumEt', 'sumEt', 20, 200, 3000, 'scalar sum of Et'),
)
),
ChsMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'raw chs PF MET phi'),
Plot1D('pt', 'pt', 20, 0, 400, 'raw chs PF MET pt'),
Plot1D('sumEt', 'sumEt', 20, 600, 5000, 'raw chs PF scalar sum of Et'),
)
),
CorrT1METJet = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Expand Down Expand Up @@ -493,24 +485,34 @@
Plot1D('', '', 100, 0, 2, 'all weights'),
)
),

MET = cms.PSet(
PFMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('MetUnclustEnUpDeltaX', 'MetUnclustEnUpDeltaX', 20, -20, 20, 'Delta (METx_mod-METx) Unclustered Energy Up'),
Plot1D('MetUnclustEnUpDeltaY', 'MetUnclustEnUpDeltaY', 20, -10, 10, 'Delta (METy_mod-METy) Unclustered Energy Up'),
Plot1D('covXX', 'covXX', 20, 0, 40000, 'xx element of met covariance matrix'),
Plot1D('covXY', 'covXY', 20, -8000, 8000, 'xy element of met covariance matrix'),
Plot1D('covYY', 'covYY', 20, 0, 50000, 'yy element of met covariance matrix'),
Plot1D('fiducialGenPhi', 'fiducialGenPhi', 20, -3.14159, 3.14159, 'phi'),
Plot1D('fiducialGenPt', 'fiducialGenPt', 20, 0, 400, 'pt'),
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Plot1D('pt', 'pt', 20, 0, 400, 'pt'),
Plot1D('significance', 'significance', 20, 0, 200, 'MET significance'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add pt/phiUnclusteredUp/Down here.

Plot1D('sumEt', 'sumEt', 20, 600, 5000, 'scalar sum of Et'),
Plot1D('sumPtUnclustered', 'sumPtUnclustered', 20, 0, 3000, 'sumPt used for MET significance'),

Plot1D('ptUnclusteredUp', 'ptUnclusteredUp', 20, 0, 400, 'pt Unclustered Up'),
Plot1D('ptUnclusteredDown', 'ptUnclusteredDown', 20, 0, 400, 'pt Unclustered Down'),
Plot1D('phiUnclusteredUp', 'phiUnclusteredUp', 20, -3.14159, 3.14159, 'phi Unclustered Up'),
Plot1D('phiUnclusteredDown', 'phiUnclusteredDown', 20, -3.14159, 3.14159, 'phi Unclustered Down'),
Copy link
Contributor

@mseidel42 mseidel42 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you filling histos for unclustered variations of FiducialMET? They should not exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, that is all under PFMET now...


)
),

FiducialMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Plot1D('pt', 'pt', 20, 0, 400, 'pt'),
)
),

Muon = cms.PSet(
sels = cms.PSet(
Good = cms.string('pt > 15 && abs(dxy) < 0.2 && abs(dz) < 0.5 && mediumId && miniPFRelIso_all < 0.4')
Expand Down Expand Up @@ -720,24 +722,23 @@
PuppiMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(

Plot1D('covXX', 'covXX', 20, 0, 40000, 'xx element of met covariance matrix'),
Plot1D('covXY', 'covXY', 20, -8000, 8000, 'xy element of met covariance matrix'),
Plot1D('covYY', 'covYY', 20, 0, 50000, 'yy element of met covariance matrix'),
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Plot1D('phiJERUp', 'phiJERUp', 20, -3.14159, 3.14159, 'JER up phi'),
Plot1D('phiJERDown', 'phiJERDown', 20, -3.14159, 3.14159, 'JER down phi'),
Plot1D('phiJESUp', 'phiJESUp', 20, -3.14159, 3.14159, 'JES up phi'),
Plot1D('phiJESDown', 'phiJESDown', 20, -3.14159, 3.14159, 'JES down phi'),
Plot1D('phiUnclusteredUp', 'phiUnclusteredUp', 20, -3.14159, 3.14159, 'Unclustered up phi'),
Plot1D('phiUnclusteredDown', 'phiUnclusteredDown', 20, -3.14159, 3.14159, 'Unclustered down phi'),
Plot1D('pt', 'pt', 20, 0, 400, 'pt'),
Plot1D('ptJERUp', 'ptJERUp', 20, 0, 400, 'JER up pt'),
Plot1D('ptJERDown', 'ptJERDown', 20, 0, 400, 'JER down pt'),
Plot1D('ptJESUp', 'ptJESUp', 20, 0, 400, 'JES up pt'),
Plot1D('ptJESDown', 'ptJESDown', 20, 0, 400, 'JES down pt'),
Plot1D('ptUnclusteredUp', 'ptUnclusteredUp', 20, 0, 400, 'Unclustered up pt'),
Plot1D('ptUnclusteredDown', 'ptUnclusteredDown', 20, 0, 400, 'Unclustered down pt'),
Plot1D('sumEt', 'sumEt', 20, 200, 3000, 'scalar sum of Et'),
Plot1D('significance', 'significance', 20, 0, 200, 'PuppiMET significance'),
Plot1D('sumEt', 'sumEt', 20, 600, 5000, 'scalar sum of Et'),
Plot1D('sumPtUnclustered', 'sumPtUnclustered', 20, 0, 3000, 'sumPt used for PuppiMET significance'),

Plot1D('ptUnclusteredUp', 'ptUnclusteredUp', 20, 0, 400, 'pt Unclustered Up'),
Plot1D('ptUnclusteredDown', 'ptUnclusteredDown', 20, 0, 400, 'pt Unclustered Down'),
Plot1D('phiUnclusteredUp', 'phiUnclusteredUp', 20, -3.14159, 3.14159, 'phi Unclustered Up'),
Plot1D('phiUnclusteredDown', 'phiUnclusteredDown', 20, -3.14159, 3.14159, 'phi Unclustered Down'),
)
),
RawMET = cms.PSet(
RawPFMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Expand Down Expand Up @@ -871,7 +872,7 @@
NoPlot('status'),
)
),
TkMET = cms.PSet(
TrkMET = cms.PSet(
sels = cms.PSet(),
plots = cms.VPSet(
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Expand Down Expand Up @@ -964,3 +965,4 @@
),
)
)

8 changes: 2 additions & 6 deletions PhysicsTools/NanoAOD/python/particlelevel_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,9 @@

wajidalikhan marked this conversation as resolved.
Show resolved Hide resolved
rivetMetTable = simpleSingletonCandidateFlatTableProducer.clone(
rappoccio marked this conversation as resolved.
Show resolved Hide resolved
src = cms.InputTag("particleLevel:mets"),
name = cms.string("MET"),
name = cms.string("FiducialMET"),
doc = cms.string("MET from Rivet-based ParticleLevelProducer in fiducial volume abs(eta)<5"),
extension = cms.bool(True),
variables = cms.PSet(
fiducialGenPt = Var("pt", float, precision=10),
fiducialGenPhi = Var("phi", float, precision=10),
),
variables = cms.PSet(PTVars),
)

HTXSCategoryTable = simpleHTXSFlatTableProducer.clone(
Expand Down