Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:11:37

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/optical/action/StepDiagnostic.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 
0011 #include "celeritas/optical/CoreTrackData.hh"
0012 #include "celeritas/user/StepDiagnosticBase.hh"
0013 
0014 #include "ActionInterface.hh"
0015 
0016 namespace celeritas
0017 {
0018 namespace optical
0019 {
0020 //---------------------------------------------------------------------------//
0021 /*!
0022  * Tally number of steps taken by each photon in the optical stepping loop.
0023  */
0024 class StepDiagnostic final : public StepDiagnosticBase,
0025                              public OpticalStepActionInterface
0026 {
0027   public:
0028     // Construct and add to core params
0029     static std::shared_ptr<StepDiagnostic> make_and_insert(
0030         CoreParams const& core, size_type max_bins);
0031 
0032     //! Construct with ID and counts
0033     StepDiagnostic(ActionId id, size_type max_bins, size_type num_streams);
0034 
0035     //!@{
0036     //! \name StepAction interface
0037 
0038     // Launch kernel with host data
0039     void step(CoreParams const&, CoreStateHost&) const final;
0040     // Launch kernel with device data
0041     void step(CoreParams const&, CoreStateDevice&) const final;
0042     //! ID of the action
0043     ActionId action_id() const final { return id_; }
0044     //! Short name for the action
0045     std::string_view label() const final { return "optical-step-diagnostic"; }
0046     // Description of the action for user interaction
0047     std::string_view description() const final;
0048     //! Dependency ordering of the action
0049     StepActionOrder order() const final { return StepActionOrder::user_post; }
0050     //!@}
0051 
0052   private:
0053     ActionId id_;
0054 };
0055 
0056 //---------------------------------------------------------------------------//
0057 }  // namespace optical
0058 }  // namespace celeritas