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 a discrepancy in Puppi weights when running on MiniAOD w/ useExistingWeights=False #28033
Conversation
The code-checks are being triggered in jenkins. |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28033/11959
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
@hqucms this would be a nice simplification. |
d4d3006
to
fc452b1
Compare
The code-checks are being triggered in jenkins. |
@ahinzmann I think nothing should break as the weight list |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28033/11961
|
A new Pull Request was created by @hqucms (Huilin Qu) for master. It involves the following packages: CommonTools/PileupAlgos @perrotta, @cmsbuild, @santocch, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Ok. Just since I got paranoid with this piece of code, could you make a comparison of puppiMET and the weights of the puppiForMET particles:
In fact it would be nice to have example config for those three cases in the /test folder as well. Currently there is only a test for 2. |
@ahinzmann Since 1 and 2 are in the PR validation workflow, maybe we can first trigger a PR test to check them. |
please test |
The tests are being triggered in jenkins. |
Comparison is ready Comparison Summary:
|
@ahinzmann |
Regarding the small changes in the b-tagging discriminants in the PR test: they are caused by changes in numerical precision in the calculation of the puppi scaled p4. Before the PR, the candidate p4 is computed with double -> float (when creating the RecoObj) -> double, now is double -> double without the intermediate conversion. Inserting an intermediate conversion to float can reproduce the old behavior exactly. |
@hqucms The puppiForMET particles are indeed no saved. But the puppiNoLepton weights (which is a subset of puppiForMET) are stored in the packedCandidates. |
@ahinzmann |
Looking at the three sumET plots in [0], useExistingWeights=True and False indeed look almost the same, however aod2mini looks very different from the other two. It doesn't seem caused by this PR, but certainly something that we need to follow up on. [0] https://cernbox.cern.ch/index.php/s/LUlVAKr3vSH47Cp I conclude that the PR is fine. |
+1
|
+1 |
merge |
+1 |
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 be automatically merged. |
@ahinzmann |
PR description:
When running Puppi on MiniAOD w/
useExistingWeights=False
, in some cases there is a discrepancy between the puppiWeight and the rescaled pT (i.e., rescaled pT != original pT * packCand->puppiWeight()). This is tracked to:cmssw/CommonTools/PileupAlgos/plugins/PuppiProducer.cc
Lines 275 to 291 in fb7c976
on L281 and L283,
iPuppiMatched
should not be used to access the puppi weight fromlWeights
, aslWeights
is 1-to-1 withhPFProduct
-- insteadval
is the correct index.As this only affects the puppi weights set for the new packedCandidates, this discrepancy does not affect cases when
useExistingWeights=True
, or running on RECO/AOD inputs.This PR fixes this discrepancy and also simplifies the logic to compute the Puppi-scaled p4.
@ahinzmann