![]() |
|
|||
File indexing completed on 2025-09-15 08:54:45
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/io/ImportUnits.hh 0006 //---------------------------------------------------------------------------// 0007 #pragma once 0008 0009 #include "celeritas/Types.hh" 0010 0011 namespace celeritas 0012 { 0013 //---------------------------------------------------------------------------// 0014 /*! 0015 * Quantity of measure enumeration for imported data. 0016 * 0017 * These enumeration values are used to scale values between the Celeritas 0018 * native unit system and the CLHEP/Geant4 values. Note that MeV quantities are 0019 * set to unity for this special case (i.e. they retain their energy scaling 0020 * and need to be wrapped with the \c MevEnergy quantity when used in 0021 * Celeritas). 0022 * 0023 * \todo Rename to ImportUnit 0024 */ 0025 enum class ImportUnits 0026 { 0027 unitless, //!< No dimension 0028 mev, //!< Energy [MeV] 0029 mev_per_len, //!< Energy loss [MeV/len] 0030 len, //!< Range [len] 0031 len_inv, //!< Macroscopic xs [1/len] 0032 len_mev_inv, //!< Scaled (1/E) macroscopic xs [1/len-MeV] 0033 mev_sq_per_len, //!< Scaled [E^2] macroscopic xs [MeV^2/len] 0034 len_sq, //!< Microscopic cross section [len^2] 0035 mev_len_sq, //!< [MeV-len^2] 0036 time, //!< Time [time] 0037 inv_len_cb, //!< Number density [1/len^3] 0038 len_time_sq_per_mass, //!< Inverse pressure [len-time^2/mass] 0039 inv_mev, //!< Inverse energy [1/MeV] 0040 size_, 0041 // Deprecated aliases 0042 none = unitless, //!< Deprecated 0043 mev_per_cm = mev_per_len, //!< Deprecated 0044 cm = len, //!< Deprecated 0045 cm_inv = len_inv, //!< Deprecated 0046 cm_mev_inv = len_mev_inv, //!< Deprecated 0047 mev_2_per_cm = mev_sq_per_len, //!< Deprecated 0048 cm_2 = len_sq, //!< Deprecated 0049 }; 0050 0051 //---------------------------------------------------------------------------// 0052 // FREE FUNCTIONS 0053 //---------------------------------------------------------------------------// 0054 0055 // Get the string label for units 0056 char const* to_cstring(ImportUnits q); 0057 0058 // Get the multiplier to turn this quantity to a native value 0059 double native_value_from(UnitSystem sys, ImportUnits q); 0060 0061 // Get the multiplier to turn a unit Geant4 value to a native value 0062 double native_value_from_clhep(ImportUnits q); 0063 0064 //---------------------------------------------------------------------------// 0065 } // 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 |
![]() ![]() |