Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2021-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/em/data/KleinNishinaData.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "celeritas/Quantities.hh"
0013 #include "celeritas/Types.hh"
0014 
0015 namespace celeritas
0016 {
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Model and particles IDs.
0020  */
0021 struct KleinNishinaIds
0022 {
0023     ParticleId electron;
0024     ParticleId gamma;
0025 
0026     //! Check whether the data is assigned
0027     explicit CELER_FUNCTION operator bool() const { return electron && gamma; }
0028 };
0029 
0030 //---------------------------------------------------------------------------//
0031 /*!
0032  * Device data for creating a KleinNishinaInteractor.
0033  */
0034 struct KleinNishinaData
0035 {
0036     using Mass = units::MevMass;
0037 
0038     //! Model and particle identifiers
0039     KleinNishinaIds ids;
0040 
0041     //! 1 / electron mass [1 / MevMass]
0042     real_type inv_electron_mass;
0043 
0044     //! Check whether the data is assigned
0045     explicit CELER_FUNCTION operator bool() const
0046     {
0047         return ids && inv_electron_mass > 0;
0048     }
0049 };
0050 
0051 using KleinNishinaDeviceRef = KleinNishinaData;
0052 using KleinNishinaHostRef = KleinNishinaData;
0053 
0054 //---------------------------------------------------------------------------//
0055 }  // namespace celeritas