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
Muon FSR recovery for miniaod and nanoaod #28118
Conversation
…ion of out photons, fix idx
As #39 without NANOAOD code
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28118/12143
|
A new Pull Request was created by @arizzi for master. It involves the following packages: DataFormats/PatCandidates @perrotta, @cmsbuild, @santocch, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
-1 Tested at: 46f1bfa You can see the results of the tests here: I found follow errors while testing this PR Failed tests: AddOn
I found errors in the following addon tests: cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi --conditions auto:run2_mc_l1stage1 --fast -n 100 --eventcontent AODSIM,DQM --relval 100000,1000 -s GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid,L1,DIGI2RAW,L1Reco,RECO,EI,VALIDATION --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --datatier GEN-SIM-DIGI-RECO,DQMIO --beamspot NominalCollision2015 --era Run2_25ns : FAILED - time: date Sun Oct 6 01:32:55 2019-date Sun Oct 6 01:28:03 2019 s - exit: 35584 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
merge |
+1 |
pat::PackedCandidateRef pfcandRef = pat::PackedCandidateRef(pfcands, iter_pf - pfcands->begin()); | ||
|
||
for (auto electrons_iter = electrons->begin(); electrons_iter != electrons->end(); ++electrons_iter) { | ||
for (auto itr = electrons_iter->associatedPackedPFCandidates().begin(); |
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.
This does not work. associatedPackedPFCandidates()
returns a temporary object
edm::RefVector<pat::PackedCandidateCollection> associatedPackedPFCandidates() const; |
so the calls to electrons_iter->associatedPackedPFCandidates().begin()
and electrons_iter->associatedPackedPFCandidates().begin()
are actually returning iterators to two different containers (both of which are gone during the iteration of the loop).
This was found by the address sanitizer
https://cmssdt.cern.ch/SDT/cgi-bin/logreader/slc7_amd64_gcc820/CMSSW_11_0_ASAN_X_2019-10-18-2300/pyRelValMatrixLogs/run/250202.118_ProdTTbar_13_pmx25ns+ProdTTbar_13UP18+DIGIPRMXUP18_PROD_PU25+RECOPRMXUP18PROD_PU25+NANOEDMMC2018_PROD/step4_ProdTTbar_13_pmx25ns+ProdTTbar_13UP18+DIGIPRMXUP18_PROD_PU25+RECOPRMXUP18PROD_PU25+NANOEDMMC2018_PROD.log#/
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.
shouldn't it loop forever then?
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.
It's actually undefined behavior. I'm guessing that the two temporaries just happen to be made at the same point on the stack. This causes a lucky accident that it just happens to work for now.
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 then we may experience random crashes in large production.
@peruzzim I'm not sure if the nanov6 campaign was already submitted, but I'd suggest to fix this (just having a local copy of the vector)
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.
I think a possibly better solution would be to switch to using ranged for loop
for(auto const& cand: electrons_iter->associatedPackedPFCandidates()) {
The language guarantees that the temporary container returned from the call to electrons_iter->associatedPackedPFCandidates()
will be kept around for the lifetime of the for loop.
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.
implemented this solution in #28221
+1 |
Pull request #28118 was updated. @simonepigazzini, @vlimant can you please check and sign again. |
PR description:
This PR adds the producers for FSR recovery needed for next round of NanoAOD.
As the producer are generic enough to run also on top of MiniAOD they have been included as discussed with muon POG (https://its.cern.ch/jira/browse/CMSMUONS-300) outside the PhysicsTools/NanoAOD package
The nanoaod enabling code is not included in this PR and will be integrated once this enters cmssw.
A version of this PR with the nanoaod code (actually just some configuration) has been tested here:
cms-nanoAOD#413
PR validation:
Tests have been performed in the nanoaod PR linked above, no standard workflow is currently affected (inclusion during miniaod production step has not yet being discussed in XPOG)
@NTrevisani @jorieger @peruzzim