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

Fix for smeared MET calculation and its uncertainties. #36797

Conversation

michaelwassmer
Copy link
Contributor

This PR is in reference to an older PR (#36165).
It basically does the same thing, however with a lot less new lines of code.

PR description:

This pull request fixes the incorrect calculation of the nominal smeared missing transverse energy (MET). The underyling problem is the application of the JER correction factors. These factors are applied in PhysicsTools/PatUtils/interface/SmearedJetProducerT.h but later not considered when reverting to the uncorrected jets in JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h.
This results in the problem that the JER correction factors in the smeared MET calculation effectively cancels and therefore the smeared MET is basically the same as the regular type1-corrected MET. After the changes shown below, the nominal smeared MET distributions from MiniAOD are similar to the ones obtained from NanoAOD.

Finally, there is also a mistake when saving the JERup and JERdown varied smearedMET. The different contributions of the nominal smeared MET correction and the JERup and JERdown variations are not separated correctly from one another. After the changes shown below, the varied smeared MET distributions from MiniAOD are similar to the ones obtained from NanoAOD.

This pull request includes the following:

DataFormats/PatCandidates/src/MET.cc

  • to get the corrections/deltas for the JER variations of the smeared MET, the calculation now takes the up/down-varied smeared MET (px,py,...) and subtracts the contributions from the nominal smeared MET corrections (ref.dpx(),ref.dpy(),...) as well as the nominal type1-corrected MET (this->px(),this->py(),...)
  • the previous implementation is a mystery to me

JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h

  • add a template class/functor (AdditionalScalesT) to retrieve additional scales (JER correction factors)
  • in generic implementation it only applies 1 as a factor therefore doing nothing
  • in case of pat::Jet, see below

PhysicsTools/PatUtils/plugins/PATPFJetMETcorrInputProducer.cc

  • edit pat::Jet template specialization of the already existing RawJetExtractor class to revert all possibly applied correction factors
  • pat::Jet template specialization of AdditionalScalesT, which retrieves all previously applied jet scales

PR validation:

  • runTheMatrix.py -l limited -i all' worked besides some workflows which had CMSDAS errors despite a working certificate
  • 'scram b runtest' worked

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36797/27945

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • DataFormats/PatCandidates (reconstruction)
  • JetMETCorrections/Type1MET (reconstruction)
  • PhysicsTools/PatUtils (reconstruction)

@jpata, @cmsbuild, @clacaputo, @slava77 can you please review it and eventually sign? Thanks.
@AlexDeMoor, @rappoccio, @gouskos, @JyothsnaKomaragiri, @ahinzmann, @schoef, @mmarionncern, @rovere, @jdamgov, @jdolen, @nhanvtran, @gkasieczka, @clelange, @emilbols, @hatakeyamak, @gpetruc, @andrzejnovak, @demuller, @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

@michaelwassmer michaelwassmer marked this pull request as ready for review January 25, 2022 15:54
@errai-
Copy link

errai- commented Jan 25, 2022

Thanks for the new PR! At a first look, the implementation seems very elegant.

@jpata
Copy link
Contributor

jpata commented Jan 26, 2022

@cmsbuild please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals-INPUT
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-694c41/22014/summary.html
COMMIT: ff49d87
CMSSW: CMSSW_12_3_X_2022-01-25-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36797/22014/install.sh to create a dev area with all the needed externals and cmssw changes.

RelVals-INPUT

  • 1040.01040.0_RunZeroBias2017F+RunZeroBias2017F+TIER0RAWSIPIXELCAL+ALCASPLITSIPIXELCAL+ALCAHARVDSIPIXELCAL/step2_RunZeroBias2017F+RunZeroBias2017F+TIER0RAWSIPIXELCAL+ALCASPLITSIPIXELCAL+ALCAHARVDSIPIXELCAL.log

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 768 differences found in the comparisons
  • DQMHistoTests: Total files compared: 43
  • DQMHistoTests: Total histograms compared: 3449324
  • DQMHistoTests: Total failures: 17
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3449284
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 42 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 181 log files, 42 edm output root files, 43 DQM output files
  • TriggerResults: no differences found

@michaelwassmer
Copy link
Contributor Author

I'm a little bit confused. Is this error really due to my changes? Looking at the error mentioned by the bot this seems unlikely? The module which is crashing according to the log is HitPairEDProducer:pixelPairStepHitDoubletsB. This, however, should have nothing to do with my changes.

@qliphy
Copy link
Contributor

qliphy commented Jan 26, 2022

I'm a little bit confused. Is this error really due to my changes? Looking at the error mentioned by the bot this seems unlikely? The module which is crashing according to the log is HitPairEDProducer:pixelPairStepHitDoubletsB. This, however, should have nothing to do with my changes.

The error is already in the IB: #36804

@jpata
Copy link
Contributor

jpata commented Jan 31, 2022

@michaelwassmer @errai- has this already been scheduled to be discussed at a JME/JMAR meeting?

@jpata
Copy link
Contributor

jpata commented Feb 4, 2022

+reconstruction

many thanks for @michaelwassmer and @errai- for seeing this through!

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 4, 2022

This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). 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)

@perrotta
Copy link
Contributor

perrotta commented Feb 6, 2022

+1

  • All differences wrt baseline are in the miniAOD MET coorections and uncertainties

@perrotta
Copy link
Contributor

perrotta commented Feb 6, 2022

merge

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