Skip to content

Commit

Permalink
refactor: Use Particle::qOverP in Fatras simulation (#2375)
Browse files Browse the repository at this point in the history
After providing this function in a previous PR this is preferred IMO

Pulled out of #2366
  • Loading branch information
andiwand authored Aug 16, 2023
1 parent 0486e42 commit c83f8fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ struct GaussianMixture {
Particle &particle) const {
/// Calculate the highland formula first
double sigma = Acts::computeMultipleScatteringTheta0(
slab, particle.pdg(), particle.mass(),
particle.charge() / particle.absoluteMomentum(), particle.charge());
slab, particle.pdg(), particle.mass(), particle.qOverP(),
particle.charge());
double sigma2 = sigma * sigma;

// Gauss distribution, will be sampled with generator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ struct GeneralMixture {
// for electrons we fall back to the Highland (extension)
// return projection factor times sigma times gauss random
const auto theta0 = Acts::computeMultipleScatteringTheta0(
slab, particle.pdg(), particle.mass(),
particle.charge() / particle.absoluteMomentum(), particle.charge());
slab, particle.pdg(), particle.mass(), particle.qOverP(),
particle.charge());
theta = std::normal_distribution<double>(0.0, theta0)(generator);
}
// scale from planar to 3d angle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ struct Highland {
Particle &particle) const {
// compute the planar scattering angle
const auto theta0 = Acts::computeMultipleScatteringTheta0(
slab, particle.pdg(), particle.mass(),
particle.charge() / particle.absoluteMomentum(), particle.charge());
slab, particle.pdg(), particle.mass(), particle.qOverP(),
particle.charge());
// draw from the normal distribution representing the 3d angle distribution
return std::normal_distribution<double>(0.0, M_SQRT2 * theta0)(generator);
}
Expand Down

0 comments on commit c83f8fc

Please sign in to comment.