Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:29:26

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-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 accel/TrackingManagerOffload.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <G4VTrackingManager.hh>
0011 
0012 namespace celeritas
0013 {
0014 class SharedParams;
0015 class LocalTransporter;
0016 
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Offload tracks to Celeritas via the per-particle G4VTrackingManager
0020  * interface
0021  */
0022 class TrackingManagerOffload final : public G4VTrackingManager
0023 {
0024   public:
0025     // Construct with shared (across threads) params, and thread-local
0026     // transporter.
0027     TrackingManagerOffload(SharedParams const* params, LocalTransporter* local);
0028 
0029     // Prepare cross-section tables for rebuild (e.g. if new materials have
0030     // been defined).
0031     void PreparePhysicsTable(G4ParticleDefinition const&) final;
0032 
0033     // Rebuild physics cross-section tables (e.g. if new materials have been
0034     // defined).
0035     void BuildPhysicsTable(G4ParticleDefinition const&) final;
0036 
0037     // Hand over passed track to this tracking manager.
0038     void HandOverOneTrack(G4Track* aTrack) final;
0039 
0040     // Complete processing of any buffered tracks.
0041     void FlushEvent() final;
0042 
0043   private:
0044     SharedParams const* params_{nullptr};
0045     LocalTransporter* transport_{nullptr};
0046 };
0047 }  // namespace celeritas