Skip to content

Commit

Permalink
feat: Python bindings for geantino hypothesis (acts-project#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand authored Oct 6, 2023
1 parent 3201e75 commit 577c162
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Core/include/Acts/EventData/ParticleHypothesis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class NonNeutralChargedParticleHypothesis
pion().mass(), absQ);
}

static NonNeutralChargedParticleHypothesis chargedGeantino() {
return chargedGeantino(Acts::UnitConstants::e);
}
static NonNeutralChargedParticleHypothesis chargedGeantino(float absQ) {
return NonNeutralChargedParticleHypothesis(PdgParticle::eInvalid, 0, absQ);
}
Expand Down Expand Up @@ -154,6 +157,9 @@ class ParticleHypothesis : public GenericParticleHypothesis<AnyCharge> {
static ParticleHypothesis geantino() {
return NeutralParticleHypothesis::geantino();
}
static ParticleHypothesis chargedGeantino() {
return chargedGeantino(Acts::UnitConstants::e);
}
static ParticleHypothesis chargedGeantino(float absQ) {
return ParticleHypothesis(PdgParticle::eInvalid, 0, absQ);
}
Expand Down
17 changes: 14 additions & 3 deletions Examples/Python/src/EventData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@ void addEventData(Context& ctx) {
[](py::object /* self */) {
return Acts::ParticleHypothesis::pion();
})
.def_property_readonly_static("electron", [](py::object /* self */) {
return Acts::ParticleHypothesis::electron();
});
.def_property_readonly_static(
"electron",
[](py::object /* self */) {
return Acts::ParticleHypothesis::electron();
})
.def_property_readonly_static(
"geantino",
[](py::object /* self */) {
return Acts::ParticleHypothesis::geantino();
})
.def_property_readonly_static(
"chargedGeantino", [](py::object /* self */) {
return Acts::ParticleHypothesis::chargedGeantino();
});
}

} // namespace Acts::Python

0 comments on commit 577c162

Please sign in to comment.