-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 crash in pat::MET when no Type-I uncertainties are added #11394
Conversation
A new Pull Request was created by @blinkseb (Sébastien Brochet) for CMSSW_7_6_X. Fix crash in pat::MET when no Type-I uncertainties are added It involves the following packages: DataFormats/PatCandidates @cmsbuild, @vadler, @monttj can you please review it and eventually sign? Thanks. |
@@ -94,11 +94,13 @@ void pat::PATMETSlimmer::maybeReadShifts(const edm::ParameterSet &basePSet, cons | |||
} | |||
else if(level==pat::MET::Smear) { | |||
shifts_.push_back(OneMETShift(pat::MET::NoShift, level, baseTag, consumesCollector(), readFromMiniAOD, true, false, true)); | |||
shifts_.push_back(OneMETShift(pat::MET::NoShift, level, baseTag, consumesCollector(), readFromMiniAOD, false, true, true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That line should be removed, as it will conflict with the storage of the MET type1, the way it is done, it will erase the type1MET to put the type1Smeared MET in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I wasn't sure about this one. I'll remove up, thanks!
a91fdd4
to
5a75f34
Compare
I updated the PR with @mmarionncern comments. |
+1 for me |
@blinkseb Can you make a PR in the 74X and 75X we can aim to have it in an analysis release. |
please test |
The tests are being triggered in jenkins. |
@mariadalfonso I opened two new PR for 7.4.x ( #11413 ) and 7.5.x ( #11412 ) |
@blinkseb I only see the changes you mention in the PR description to |
@lgray See the discussion history with @mmarionncern ; those changes were not correct. I'll edit the PR description |
Any updates on this? |
Fix crash in pat::MET when no Type-I uncertainties are added
Hello,
This PR fixes a crash I experienced when running on CMSSW 7.4.12 patch4. I manually create a new slimmedMETs using the following code snippet:
I explicitly do not want T1 uncertainties, I'm only interested in T1 met + Raw met.
When trying to access
pat::MET::uncorPt()
the code crash inside thepat::MET::findMETTotalShift
.This is because in this particular case, the
uncertainties_
array is empty, because, since there's no Type1 uncertainties, the functionsetUncShift
is never called byPATMETSlimmer
.This PR fixes both issues: first, it ensure that ifuncertainties_
is empty, the code no longer crashed. Second, it fixesPATMETSlimmer
by making suresetUncShift
is called not matter the type of uncertainties.This PR changes
pat::MET::findMETTotalShift
to prevent the crash by checking ifuncertainties_
is empty.If merged, it'll need to be backport to 7.5 and 7.4.
Thanks