Skip to content

Commit

Permalink
fix: use qOverP to get the charge of TrackParameters (#18)
Browse files Browse the repository at this point in the history
After eic/EDM4eic#58, there is no more `charge` field in edm4eic::TrackParameters, so we have to get this from `qOverP`, but this is backwards compatible.
  • Loading branch information
wdconinc authored Jan 20, 2024
1 parent 24b6d3c commit 00d83fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion truth/src/ParticlesWithTruthPID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void ParticlesWithTruthPID::process(const ParticlesWithTruthPID::Input& input,
for (const auto& trk : tracks) {
const auto mom =
edm4hep::utils::sphericalToVector(1.0 / std::abs(trk.getQOverP()), trk.getTheta(), trk.getPhi());
const auto charge_rec = trk.getCharge();
const auto charge_rec = std::copysign(1., trk.getQOverP());
// utility variables for matching
int best_match = -1;
double best_delta = std::numeric_limits<double>::max();
Expand Down

0 comments on commit 00d83fe

Please sign in to comment.