Back to home page

EIC code displayed by LXR

 
 

    


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

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/executor/CombinedBremExecutor.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/random/engine/RngEngine.hh"
0011 #include "celeritas/Types.hh"
0012 #include "celeritas/em/data/CombinedBremData.hh"
0013 #include "celeritas/em/interactor/CombinedBremInteractor.hh"
0014 #include "celeritas/geo/GeoTrackView.hh"
0015 #include "celeritas/global/CoreTrackView.hh"
0016 #include "celeritas/mat/MaterialTrackView.hh"
0017 #include "celeritas/mat/MaterialView.hh"
0018 #include "celeritas/phys/Interaction.hh"
0019 #include "celeritas/phys/PhysicsStepView.hh"
0020 
0021 namespace celeritas
0022 {
0023 //---------------------------------------------------------------------------//
0024 struct CombinedBremExecutor
0025 {
0026     inline CELER_FUNCTION Interaction
0027     operator()(celeritas::CoreTrackView const& track);
0028 
0029     CombinedBremRef params;
0030 };
0031 
0032 //---------------------------------------------------------------------------//
0033 /*!
0034  * Sample electron/positron brems from the current track.
0035  */
0036 CELER_FUNCTION Interaction
0037 CombinedBremExecutor::operator()(CoreTrackView const& track)
0038 {
0039     // Select material track view
0040     auto material = track.material().material_record();
0041 
0042     // Assume only a single element in the material, for now
0043     CELER_ASSERT(material.num_elements() == 1);
0044     ElementComponentId const selected_element{0};
0045 
0046     auto particle = track.particle();
0047     auto const& dir = track.geometry().dir();
0048     auto allocate_secondaries = track.physics_step().make_secondary_allocator();
0049     auto cutoff = track.cutoff();
0050 
0051     CombinedBremInteractor interact(params,
0052                                     particle,
0053                                     dir,
0054                                     cutoff,
0055                                     allocate_secondaries,
0056                                     material,
0057                                     selected_element);
0058 
0059     auto rng = track.rng();
0060     return interact(rng);
0061 }
0062 
0063 //---------------------------------------------------------------------------//
0064 }  // namespace celeritas