Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:32

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/em/data/MollerBhabhaData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "celeritas/Quantities.hh"
0012 #include "celeritas/Types.hh"
0013 
0014 namespace celeritas
0015 {
0016 //---------------------------------------------------------------------------//
0017 /*!
0018  * Model and particles IDs for Moller Bhabha.
0019  */
0020 struct MollerBhabhaIds
0021 {
0022     ParticleId electron;
0023     ParticleId positron;
0024 
0025     //! Whether the IDs are assigned
0026     explicit CELER_FUNCTION operator bool() const
0027     {
0028         return electron && positron;
0029     }
0030 };
0031 
0032 //---------------------------------------------------------------------------//
0033 /*!
0034  * Device data for creating an interactor.
0035  */
0036 struct MollerBhabhaData
0037 {
0038     //! Model and particle IDs
0039     MollerBhabhaIds ids;
0040 
0041     //! Electron mass * c^2 [MeV]
0042     units::MevMass electron_mass;
0043 
0044     //! Model's maximum energy limit [MeV]
0045     static CELER_CONSTEXPR_FUNCTION units::MevEnergy max_valid_energy()
0046     {
0047         return units::MevEnergy{100e6};
0048     }
0049 
0050     //! Whether the data are assigned
0051     explicit CELER_FUNCTION operator bool() const
0052     {
0053         return ids && electron_mass > zero_quantity();
0054     }
0055 };
0056 
0057 using MollerBhabhaHostRef = MollerBhabhaData;
0058 using MollerBhabhaDeviceRef = MollerBhabhaData;
0059 
0060 //---------------------------------------------------------------------------//
0061 }  // namespace celeritas