Fix invalid memory access in ClassifyPhotonElectronAlg
The lines
photons.erase( std::remove_if( photons.begin(), photons.end(),
[&]( const auto& hypo ) { return CaloMomentum( hypo ).pt() < m_eTcut; } ),
photons.end() );
electrons.erase( std::remove_if( electrons.begin(), electrons.end(),
[&]( const auto& hypo ) { return CaloMomentum( hypo ).pt() < m_electrEtCut; } ),
electrons.end() );
produced invalid memory access in very rare events when corrected calo hypos have pT lower than the same pT cut applied before correction. It seems KeyedContainer
does not support remove_if
? (cc @sponce) (worth to say that erasing elements happens very rarely, something like 1:1000 events) This was spotted when running (not yet merged) new test from Moore!386 (merged) (one has to run on more than 1000 events to see a crash).
Another small fix is changing m_eTcut
-> m_photonEtCut
in two places (perhaps a typo? cc @cmarinbe).
Thanks @sstahl for spotting the problem with erasing element in the very first commit.
Should go with Brunel!964 (merged) for references updates
Merge request reports
Activity
added Calo label
- Resolved by Oleksandr Zenaiev
As discussed in private mails, let's merge this to get rid of the segfaults for now. As a second step, I'd like to remove the KeyedContainers used here. But it will be in a separate merge request.
assigned to @rjhunter
- Resolved by Ross John Hunter
Could you put a bit of information in the description about where this seg fault occurs please? Was it seen in a nightly build or ci-test at some point? I'm happy to test it in the meantime.
- Resolved by Peilian Li
/ci-test --merge
added lhcb-gaudi-head label
- [2020-02-15 00:11] Validation started with lhcb-gaudi-head#2533
- [2020-02-16 00:07] Validation started with lhcb-gaudi-head#2534
- [2020-02-17 00:10] Validation started with lhcb-gaudi-head#2535
- [2020-02-18 00:10] Validation started with lhcb-gaudi-head#2536
- [2020-02-19 00:10] Validation started with lhcb-gaudi-head#2537
- [2020-02-20 00:11] Validation started with lhcb-gaudi-head#2538
- [2020-02-23 00:07] Validation started with lhcb-gaudi-head#2539
Edited by Software for LHCb- Resolved by Oleksandr Zenaiev
mentioned in issue Moore#136 (closed)
- Resolved by Peilian Li
This MR is far behind the master and there are some further discussions. It also seems that it triggered the failure in nightly test: https://lhcb-nightlies.web.cern.ch/logs/tests/nightly/lhcb-gaudi-head/2536/x86_64-centos7-gcc9-opt/Moore/ Should we unlable the lhcb-gaudi-head and wait for further updates?
added 83 commits
-
2c90a896...282b0731 - 82 commits from branch
master
- b6ef3ddc - Merge remote-tracking branch 'origin/master' into fix_ClassifyPhotonElectronAlg
-
2c90a896...282b0731 - 82 commits from branch
added 1 commit
- e9916fe2 - Apply suggestion to CaloFuture/CaloFutureReco/src/ClassifyPhotonElectronAlg.cpp