Skip to content

Commit

Permalink
re-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Oct 3, 2024
1 parent dd38434 commit 7641648
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,18 @@ ActsExamples::ProcessCode ActsExamples::ParticleSmearing::execute(
params[Acts::eBoundLoc0] = sigmaD0 * stdNormal(rng);
params[Acts::eBoundLoc1] = sigmaZ0 * stdNormal(rng);
params[Acts::eBoundTime] = time + sigmaT0 * stdNormal(rng);
// smear direction angles phi,theta ensuring correct bounds
const auto [newPhi, newTheta] = Acts::detail::normalizePhiTheta(
phi + sigmaPhi * stdNormal(rng), theta + sigmaTheta * stdNormal(rng));
params[Acts::eBoundPhi] = newPhi;
params[Acts::eBoundTheta] = newTheta;
if (std::abs(newTheta) < 1e-6) {
throw std::runtime_error("Theta is too close to zero.");
// smear direction angles phi, theta ensuring correct bounds
while (true) {
const auto [newPhi, newTheta] = Acts::detail::normalizePhiTheta(
phi + sigmaPhi * stdNormal(rng),
theta + sigmaTheta * stdNormal(rng));

// We don't want to have theta-values parallel to the beam axis.
if (std::abs(newTheta) > 1e-6) {
params[Acts::eBoundPhi] = newPhi;
params[Acts::eBoundTheta] = newTheta;
break;
}
}
// compute smeared q/p
params[Acts::eBoundQOverP] = qOverP + sigmaQOverP * stdNormal(rng);
Expand Down

0 comments on commit 7641648

Please sign in to comment.