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/GeantUnits.hh
0006 //! \sa geocel/g4/Convert.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 double clhep_field{1 / units::ClhepTraits::BField::value()};
0020 //! Value of a unit Celeritas time in the CLHEP unit system
0021 inline constexpr double clhep_time{1 / units::ClhepTraits::Time::value()};
0022 
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Convert Celeritas energy quantities to Geant4.
0026  *
0027  * The unit value should always be CLHEP::MeV which is defined to be unity.
0028  */
0029 inline constexpr double
0030 convert_to_geant(units::MevEnergy const& energy, double units)
0031 {
0032     CELER_EXPECT(units == 1);
0033     return energy.value();
0034 }
0035 
0036 //---------------------------------------------------------------------------//
0037 }  // namespace celeritas