Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 09:05:27

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/track/CoreStateCounters.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 
0011 namespace celeritas
0012 {
0013 //---------------------------------------------------------------------------//
0014 /*!
0015  * Counters for within-step track initialization and activity.
0016  *
0017  * These counters are updated *by value on the host at every step* so they
0018  * should not be stored in TrackInitStateData because then the device-memory
0019  * copy will not be synchronized.
0020  *
0021  * For all user \c StepActionOrder (TODO: this may change if we add a
0022  * "user_end"), all but the secondaries/alive
0023  * counts are for the current step iteration, and secondaries/alive values
0024  * are from the previous step iteration.
0025  *
0026  * \todo Drop the 'num' prefix since we know they're counters.
0027  */
0028 struct CoreStateCounters
0029 {
0030     //!@{
0031     //! \name Set when primaries are generated
0032     size_type num_pending{0};  //!< Number waiting to be generated
0033     size_type num_generated{0};  //!< Number of track initializers created
0034     //!@}
0035     //
0036     //!@{
0037     //! \name Updated during generation and initialization
0038     size_type num_initializers{0};  //!< Number of track initializers
0039     size_type num_vacancies{0};  //!< Number of empty track slots
0040     //!@}
0041 
0042     //!@{
0043     //! \name Set after tracks are initialized
0044     size_type num_active{0};  //!< Number of active tracks at start
0045     //!@}
0046 
0047     //!@{
0048     //! \name Set after secondaries are generated
0049     size_type num_secondaries{0};  //!< Number of secondaries produced
0050     size_type num_alive{0};  //!< Number of alive tracks at end
0051     //!@}
0052 };
0053 
0054 //---------------------------------------------------------------------------//
0055 }  // namespace celeritas