![]() |
|
|||
File indexing completed on 2025-02-22 10:31:21
0001 //----------------------------------*-C++-*----------------------------------// 0002 // Copyright 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 celeritas/ext/GeantUnits.hh 0007 //---------------------------------------------------------------------------// 0008 #pragma once 0009 0010 #include "celeritas/Quantities.hh" 0011 #include "celeritas/UnitTypes.hh" 0012 0013 namespace celeritas 0014 { 0015 //---------------------------------------------------------------------------// 0016 // CONSTANTS 0017 //---------------------------------------------------------------------------// 0018 //! Value of a unit Celeritas field in the CLHEP unit system 0019 inline constexpr real_type clhep_field = 1 0020 / units::ClhepTraits::BField::value(); 0021 //! Value of a unit Celeritas time in the CLHEP unit system 0022 inline constexpr real_type clhep_time = 1 / units::ClhepTraits::Time::value(); 0023 0024 //---------------------------------------------------------------------------// 0025 /*! 0026 * Convert Celeritas energy quantities to Geant4. 0027 * 0028 * The unit value should always be CLHEP::MeV which is defined to be unity. 0029 */ 0030 inline constexpr double 0031 convert_to_geant(units::MevEnergy const& energy, double units) 0032 { 0033 CELER_EXPECT(units == 1); 0034 return energy.value(); 0035 } 0036 0037 //---------------------------------------------------------------------------// 0038 } // namespace celeritas
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |