Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:24

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