Skip to content
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

feat: Python bindings for geantino hypothesis #2508

Merged
merged 9 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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