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

Bug fix for track MET in MET correction tools #34860

Merged
merged 2 commits into from Aug 27, 2021

Conversation

lathomas
Copy link
Contributor

PR description:

This PR is a fix of a longstanding bug in the calculation of the track MET in the MET correction tools that results in a wrong value in NANOAOD.
The bug was recently (re?)discovered when trying to run MINI and NANO in a single job (see #34714 )

The PF candidate filter is now in synch with the one used in the MINIAOD tools.

https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py#L219-L222

PR validation:

Explicitly checked that the TrackMET value in NANOAOD is identical when you fetch the MINIAOD value or recompute it using the MET correction tool.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34860/24658

  • This PR adds an extra 32KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @lathomas for master.

It involves the following packages:

  • PhysicsTools/PatUtils (reconstruction)

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@mmarionncern, @gouskos, @JyothsnaKomaragiri, @ahinzmann, @schoef, @rappoccio, @jdamgov, @jdolen, @nhanvtran, @gkasieczka, @clelange, @emilbols, @hatakeyamak, @gpetruc, @andrzejnovak, @mariadalfonso, @seemasharmafnal this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Aug 12, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-049747/17748/summary.html
COMMIT: f45c5fb
CMSSW: CMSSW_12_1_X_2021-08-12-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/34860/17748/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 11 differences found in the comparisons
  • DQMHistoTests: Total files compared: 39
  • DQMHistoTests: Total histograms compared: 2999420
  • DQMHistoTests: Total failures: 7
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2999391
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 38 files compared)
  • Checked 165 log files, 37 edm output root files, 39 DQM output files
  • TriggerResults: no differences found

@@ -1728,7 +1728,7 @@ def miniAODConfigurationPre(self, process, patMetModuleSequence, pfCandCollectio
patMetModuleSequence += getattr(process, "pfMetCHS")
patMetModuleSequence += getattr(process, "patCHSMet")

pfTrk = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("fromPV(0) > 0 && charge()!=0"))
pfTrk = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("pvAssociationQuality()>=4 && charge()!=0 && vertexRef().key()==0"))
Copy link
Contributor

Choose a reason for hiding this comment

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

if this has to be the same as in miniAOD_tools.py, please define a common reference and use it or clone from it directly in the places where these need to be the same.

Here, it looks like the package dependency chain suggests this directory is OK. So, e.g. in PhysicsTools/PatUtils/python/tools/trackSelectors_cff.py

chargedPackedCandsForMet = cms.EDFilter("CandPtrSelector" ... 

Copy link
Contributor

Choose a reason for hiding this comment

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

would be great to do as well for the pfCHS.
note in runMETCorrectionsAndUncertainties.py is even defined twice once for jets and once for met

pfCHS = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("fromPV(0)>0"))

pfCHS = cms.EDFilter("CandPtrSelector", src = pfCandCollection, cut = cms.string("fromPV"))

Copy link
Contributor

Choose a reason for hiding this comment

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

The duplicate definition of pfCHS is adressed in #33885.
@lathomas: Could you take care of defining the trkMET selection as suggested by Slava (and I sync to that once you're done)?

@slava77
Copy link
Contributor

slava77 commented Aug 20, 2021

@lathomas
please clarify on the status of updating this PR following the review.
Thank you.

@slava77
Copy link
Contributor

slava77 commented Aug 23, 2021

@lathomas @ahinzmann
will there be some interference between this PR and #33885?

more details about #33885 were covered in the reco meeting
https://indico.cern.ch/event/1067481/contributions/4492388/attachments/2296238/3905408/20210604_trackvertexassociation.pdf

@ahinzmann
Copy link
Contributor

@lathomas @ahinzmann
will there be some interference between this PR and #33885?

more details about #33885 were covered in the reco meeting
https://indico.cern.ch/event/1067481/contributions/4492388/attachments/2296238/3905408/20210604_trackvertexassociation.pdf

@lathomas #33885 could potentially also address the issue tackled by this PR. Are you able to test if #33885 helps cure the issue here?

@lathomas
Copy link
Contributor Author

Hello.
No. It looks like TrkMET is still computed in the wrong way in #33885
This line is incorrect:

pfTrk = cms.EDFilter("CandPtrSelector", src = cms.InputTag("pfCHS"), cut = cms.string("charge()!=0"))

The input collection for TrkMET is not equivalent to charged pfCHS

@ahinzmann
Copy link
Contributor

Hello.
No. It looks like TrkMET is still computed in the wrong way in #33885
This line is incorrect:

pfTrk = cms.EDFilter("CandPtrSelector", src = cms.InputTag("pfCHS"), cut = cms.string("charge()!=0"))

The input collection for TrkMET is not equivalent to charged pfCHS

What exactly is the difference? Is it a difference choice of pvAssociationQuality threshold?

@lathomas
Copy link
Contributor Author

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34860/24862

@cmsbuild
Copy link
Contributor

Pull request #34860 was updated. @jpata, @cmsbuild, @slava77 can you please check and sign again.

@mariadalfonso
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-049747/18021/summary.html
COMMIT: 0e55061
CMSSW: CMSSW_12_1_X_2021-08-24-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/34860/18021/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 13 differences found in the comparisons
  • DQMHistoTests: Total files compared: 39
  • DQMHistoTests: Total histograms compared: 3000352
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3000324
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 38 files compared)
  • Checked 165 log files, 37 edm output root files, 39 DQM output files
  • TriggerResults: no differences found

@slava77
Copy link
Contributor

slava77 commented Aug 25, 2021

+reconstruction

for #34860 0e55061

  • code changes are in line with the PR description and the follow up review: track-MET in NANO and mini is now defined using a common track selector
  • jenkins tests pass and comparisons with the baseline show differences in the nanoAOD tkMetTable; sumEt has the most clearly visible change showing a reduction in the selected tracks going to the sum e.g. in wf 136.8523 (JetHT2018)

wf136 8523_tkMet_sumEt

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@slava77
Copy link
Contributor

slava77 commented Aug 26, 2021

@perrotta @qliphy
This PR is holding up #33885 .
please check if this PR can be merged.

Thank you.

@perrotta
Copy link
Contributor

@perrotta @qliphy
This PR is holding up #33885 .
please check if this PR can be merged.

Thank you.

@slava77 we are building pre2 right now.
This PR will get merged as soon as the build finishes succesfully, and we can release that pre

@perrotta
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants