Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:25

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/neutron/interactor/NeutronInelasticInteractor.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "celeritas/mat/IsotopeView.hh"
0013 #include "celeritas/neutron/data/NeutronInelasticData.hh"
0014 #include "celeritas/phys/Interaction.hh"
0015 #include "celeritas/phys/ParticleTrackView.hh"
0016 
0017 namespace celeritas
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Perform neutron inelastic interaction based on the Bertini cascade model.
0022  *
0023  * \note This performs the sampling procedure as in G4CascadeInterface, as
0024  * documented in section 24 of the Geant4 Physics Reference (release 11.2).
0025  */
0026 class NeutronInelasticInteractor
0027 {
0028   public:
0029     //!@{
0030     //! \name Type aliases
0031     using Energy = units::MevEnergy;
0032     using Mass = units::MevMass;
0033     using Momentum = units::MevMomentum;
0034     //!@}
0035 
0036   public:
0037     // Construct from shared and state data
0038     inline CELER_FUNCTION
0039     NeutronInelasticInteractor(NeutronInelasticRef const& shared,
0040                                ParticleTrackView const& particle);
0041 
0042     // Sample an interaction with the given RNG
0043     template<class Engine>
0044     inline CELER_FUNCTION Interaction operator()(Engine& rng);
0045 
0046   private:
0047     //// DATA ////
0048 
0049     // Constant shared data
0050     NeutronInelasticRef const& shared_;
0051 };
0052 
0053 //---------------------------------------------------------------------------//
0054 // INLINE DEFINITIONS
0055 //---------------------------------------------------------------------------//
0056 /*!
0057  * Construct with shared and state data, and a target nucleus.
0058  */
0059 CELER_FUNCTION
0060 NeutronInelasticInteractor::NeutronInelasticInteractor(
0061     NeutronInelasticRef const& shared, ParticleTrackView const& particle)
0062     : shared_(shared)
0063 {
0064     CELER_EXPECT(particle.particle_id() == shared_.scalars.neutron_id);
0065 }
0066 //---------------------------------------------------------------------------//
0067 /*!
0068  * Sample the final state of the neutron-nucleus inelastic interaction.
0069  */
0070 template<class Engine>
0071 CELER_FUNCTION Interaction NeutronInelasticInteractor::operator()(Engine&)
0072 {
0073     CELER_NOT_IMPLEMENTED("Neutron inelastic interaction");
0074 }
0075 
0076 //---------------------------------------------------------------------------//
0077 }  // namespace celeritas