Back to home page

EIC code displayed by LXR

 
 

    


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

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/optical/GeneratorDistributionData.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 #include "corecel/cont/EnumArray.hh"
0013 #include "celeritas/Quantities.hh"
0014 #include "celeritas/Types.hh"
0015 #include "celeritas/optical/Types.hh"
0016 
0017 namespace celeritas
0018 {
0019 namespace optical
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Pre- and post-step data for sampling optical photons.
0024  */
0025 struct GeneratorStepData
0026 {
0027     units::LightSpeed speed;
0028     Real3 pos{};
0029 
0030     //! Check whether the data are assigned
0031     explicit CELER_FUNCTION operator bool() const
0032     {
0033         return speed > zero_quantity();
0034     }
0035 };
0036 
0037 //---------------------------------------------------------------------------//
0038 /*!
0039  * Input data for sampling optical photons.
0040  *
0041  * This contains *all* the data needed to sample optical photons directly
0042  * generated by tracks in the main stepping loop.
0043  */
0044 struct GeneratorDistributionData
0045 {
0046     size_type num_photons{};  //!< Sampled number of photons to generate
0047     real_type time{};  //!< Pre-step time
0048     real_type step_length{};
0049     units::ElementaryCharge charge;
0050     OpticalMaterialId material;
0051     EnumArray<StepPoint, GeneratorStepData> points;
0052 
0053     //! Check whether the data are assigned
0054     explicit CELER_FUNCTION operator bool() const
0055     {
0056         return num_photons > 0 && step_length > 0 && material;
0057     }
0058 };
0059 
0060 //---------------------------------------------------------------------------//
0061 }  // namespace optical
0062 }  // namespace celeritas