Skip to content

Commit

Permalink
Rename variables containing the capital letter
Browse files Browse the repository at this point in the history
  • Loading branch information
whokion committed Feb 23, 2024
1 parent e853adf commit d6b7c69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/celeritas/neutron/interactor/NeutronElasticInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class NeutronElasticInteractor

// Sampler
UniformRealDist sample_phi_;
detail::InvariantQ2Sampler sample_Q2_;
detail::InvariantQ2Sampler sample_q2_;
};

//---------------------------------------------------------------------------//
Expand All @@ -96,7 +96,7 @@ CELER_FUNCTION NeutronElasticInteractor::NeutronElasticInteractor(
, neutron_mass_(shared_.neutron_mass)
, neutron_p_(particle.momentum())
, sample_phi_(0, 2 * constants::pi)
, sample_Q2_(shared_, target_, neutron_p_)
, sample_q2_(shared_, target_, neutron_p_)
{
CELER_EXPECT(particle.particle_id() == shared_.ids.neutron);
CELER_EXPECT(inc_energy_ > zero_quantity());
Expand All @@ -122,7 +122,7 @@ CELER_FUNCTION Interaction NeutronElasticInteractor::operator()(Engine& rng)

// Sample the scattered direction from the invariant momentum transfer
// squared (\f$ -t = Q^{2} \f$) in the c.m. frame
real_type cos_theta = 1 - real_type(0.5) * sample_Q2_(rng) / ipow<2>(cm_p);
real_type cos_theta = 1 - real_type(0.5) * sample_q2_(rng) / ipow<2>(cm_p);
clamp(cos_theta, real_type{-1}, real_type{1});

// Boost to the center of mass (c.m.) frame
Expand Down
12 changes: 6 additions & 6 deletions src/celeritas/neutron/interactor/detail/InvariantQ2Sampler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class InvariantQ2Sampler
Mass target_mass_;

// Atomic mass number (A) of the target
AtomicMassNumber A_;
AtomicMassNumber a_;
bool heavy_target_{false};
// Momentum magnitude of the incident neutron (GeV/c)
Momentum neutron_p_;
Expand Down Expand Up @@ -118,8 +118,8 @@ InvariantQ2Sampler::InvariantQ2Sampler(NeutronElasticRef const& shared,
: par_(shared.diff_xs.coeffs[target.isotope_id()].par)
, neutron_mass_(shared.neutron_mass)
, target_mass_(target.nuclear_mass())
, A_(target.atomic_mass_number())
, heavy_target_(A_.get() > 6)
, a_(target.atomic_mass_number())
, heavy_target_(a_.get() > 6)
, neutron_p_(neutron_p)
{
max_q2_ = calc_max_q2(neutron_p_);
Expand All @@ -145,7 +145,7 @@ CELER_FUNCTION auto InvariantQ2Sampler::operator()(Engine& rng) -> real_type
// Sample \f$ Q^{2} \f$
real_type q2 = 0;

if (A_ == AtomicMassNumber{1})
if (a_ == AtomicMassNumber{1})
{
// Special case for the \f$ n + p \rightarrow n + p \f$ channel
real_type R1 = -std::expm1(-max_q2_ * par_q2_.slope[0]);
Expand Down Expand Up @@ -273,7 +273,7 @@ auto InvariantQ2Sampler::calc_par_q2(Momentum neutron_p) const

ExchangeParameters result;

if (A_ == AtomicMassNumber{1})
if (a_ == AtomicMassNumber{1})
{
// Special case for the \f$ n + p \rightarrow n + p \f$ channel
real_type dl1 = lp - par_[3];
Expand Down Expand Up @@ -315,7 +315,7 @@ auto InvariantQ2Sampler::calc_par_q2(Momentum neutron_p) const

if (!heavy_target_)
{
real_type pah = std::pow(p, real_type(0.5) * A_.get());
real_type pah = std::pow(p, real_type(0.5) * a_.get());
real_type pa = ipow<2>(pah);
real_type pa2 = ipow<2>(pa);
result.expnt[0] = par_[0] / (1. + par_[1] * p4 * pa)
Expand Down

0 comments on commit d6b7c69

Please sign in to comment.