Skip to content

Commit

Permalink
fix: GeneratedParticles: ignore MCParticles with generatorStatus != 1 (
Browse files Browse the repository at this point in the history
…#772)

### Briefly, what does this PR introduce?
The GeneratedParticles branch all MCParticles which are thrown into the
detector, in the ReconstructedParticles format (for easy comparison).
This means we should not include generatorStatus == 0 as was the case
until now.

### What kind of change does this PR introduce?
- [x] Bug fix (issue: GeneratedParticles includes more particles than
intended)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
Yes, excludes secondary particles (which should be determined from
MCParticles based on the bit pattern in simulatorStatus).
  • Loading branch information
wdconinc authored Jul 23, 2023
1 parent 3283395 commit 0feffaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/algorithms/reco/MC2SmearedParticle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void eicrecon::MC2SmearedParticle::init(std::shared_ptr<spdlog::logger> logger)

edm4eic::ReconstructedParticle *eicrecon::MC2SmearedParticle::produce(const edm4hep::MCParticle *mc_particle) {

if (mc_particle->getGeneratorStatus() > 1) {
if (mc_particle->getGeneratorStatus() != 1) {
m_log->debug("ignoring particle with generatorStatus = {}", mc_particle->getGeneratorStatus());
return nullptr;
}
Expand Down

0 comments on commit 0feffaa

Please sign in to comment.