Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-09 10:08:05

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/phys/detail/EnergyMaxXsCalculator.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "celeritas/inp/Grid.hh"
0010 #include "celeritas/phys/PhysicsOptions.hh"
0011 #include "celeritas/phys/Process.hh"
0012 
0013 namespace celeritas
0014 {
0015 namespace detail
0016 {
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Find the energy where the macroscopic cross section is largest.
0020  *
0021  * This is used in the integral approach of sampling a discrete interaction
0022  * length when a particle loses energy along a step.
0023  */
0024 class EnergyMaxXsCalculator
0025 {
0026   public:
0027     // Construct with physics options and process
0028     EnergyMaxXsCalculator(PhysicsOptions const&, Process const&);
0029 
0030     // Calculate the energy of the maximum cross section in the grid
0031     real_type operator()(inp::XsGrid const&) const;
0032 
0033     //! Whether the integral approach is used
0034     explicit operator bool() const { return use_integral_xs_; }
0035 
0036   private:
0037     bool use_integral_xs_;
0038     bool is_annihilation_;
0039 };
0040 
0041 //---------------------------------------------------------------------------//
0042 }  // namespace detail
0043 }  // namespace celeritas