Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53: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/ext/detail/PhysicsListUtils.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <G4VModularPhysicsList.hh>
0010 
0011 namespace celeritas
0012 {
0013 namespace detail
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Create a suitably owned physics class and add it to the physics list.
0018  */
0019 template<class PL, class... T>
0020 void emplace_physics(G4VModularPhysicsList& list, T&&... args)
0021 {
0022     // Construct physics
0023     auto phys = std::make_unique<PL>(std::forward<T>(args)...);
0024 
0025     // Register, passing ownership to the list
0026     list.RegisterPhysics(phys.release());
0027 }
0028 
0029 //---------------------------------------------------------------------------//
0030 }  // namespace detail
0031 }  // namespace celeritas