Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2021-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/ImportParameters.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <map>
0011 
0012 #include "celeritas/Constants.hh"
0013 #include "celeritas/Types.hh"
0014 #include "celeritas/Units.hh"
0015 
0016 #include "ImportUnits.hh"
0017 
0018 namespace celeritas
0019 {
0020 //---------------------------------------------------------------------------//
0021 /*!
0022  * Common electromagnetic physics parameters (see G4EmParameters.hh).
0023  *
0024  * \note Geant4 v11 removed the Spline() option from G4EmParameters.hh.
0025  * \note The Geant4 MSC models use the values in \c G4EmParameters as the
0026  * defaults; however, the MSC parameters can also be set directly using the
0027  * model setter methods (there is no way to retrieve the values from the model
0028  * in that case).
0029  */
0030 struct ImportEmParameters
0031 {
0032     static constexpr auto energy_units{ImportUnits::mev};
0033 
0034     //! Energy loss fluctuation
0035     bool energy_loss_fluct{false};
0036     //! LPM effect for bremsstrahlung and pair production
0037     bool lpm{true};
0038     //! Integral cross section rejection
0039     bool integral_approach{true};
0040     //! Slowing down threshold for linearity assumption
0041     double linear_loss_limit{0.01};
0042     //! Lowest e-/e+ kinetic energy [MeV]
0043     double lowest_electron_energy{0.001};
0044     //! Whether auger emission should be enabled (valid only for relaxation)
0045     bool auger{false};
0046     //! MSC step limit algorithm
0047     MscStepLimitAlgorithm msc_step_algorithm{MscStepLimitAlgorithm::safety};
0048     //! MSC range factor for e-/e+
0049     double msc_range_factor{0.04};
0050     //! MSC safety factor
0051     double msc_safety_factor{0.6};
0052     //! MSC lambda limit [length]
0053     double msc_lambda_limit{1 * units::millimeter};
0054     //! Polar angle limit between single and multiple Coulomb scattering
0055     double msc_theta_limit{constants::pi};
0056     //! Kill secondaries below production cut
0057     bool apply_cuts{false};
0058     //! Nuclear screening factor for single/multiple Coulomb scattering
0059     double screening_factor{1};
0060     //! Factor for dynamic computation of angular limit between SS and MSC
0061     double angle_limit_factor{1};
0062     //! Nuclear form factor model for Coulomb scattering
0063     NuclearFormFactorType form_factor{NuclearFormFactorType::exponential};
0064 
0065     //! Whether parameters are assigned and valid
0066     explicit operator bool() const
0067     {
0068         return linear_loss_limit > 0 && lowest_electron_energy > 0
0069                && msc_step_algorithm != MscStepLimitAlgorithm::size_
0070                && msc_range_factor > 0 && msc_range_factor < 1
0071                && msc_safety_factor >= 0.1 && msc_lambda_limit > 0
0072                && msc_theta_limit >= 0 && msc_theta_limit <= constants::pi
0073                && screening_factor > 0 && angle_limit_factor > 0
0074                && form_factor != NuclearFormFactorType::size_;
0075     }
0076 };
0077 
0078 //---------------------------------------------------------------------------//
0079 /*!
0080  * Particle-dependent parameters for killing looping tracks.
0081  */
0082 struct ImportLoopingThreshold
0083 {
0084     static constexpr auto energy_units{ImportUnits::mev};
0085 
0086     //! Number of steps a higher-energy looping track takes before it's killed
0087     int threshold_trials{10};
0088     //! Energy below which looping tracks are immediately killed [MeV]
0089     double important_energy{250};
0090 
0091     //! Whether parameters are assigned and valid
0092     explicit operator bool() const
0093     {
0094         return threshold_trials > 0 && important_energy >= 0;
0095     }
0096 };
0097 
0098 //---------------------------------------------------------------------------//
0099 /*!
0100  * Parameters related to transportation.
0101  *
0102  * The looping thresholds are particle-dependent and stored in a map where the
0103  * keys are the PDG number.
0104  */
0105 struct ImportTransParameters
0106 {
0107     //!@{
0108     //! \name Type aliases
0109     using PDGInt = int;
0110     using ImportLoopingMap = std::map<PDGInt, ImportLoopingThreshold>;
0111     //!@}
0112 
0113     //! Thresholds for killing looping tracks
0114     ImportLoopingMap looping;
0115     //! Maximum number of substeps in the field propagator
0116     int max_substeps{1000};
0117 
0118     //! Whether parameters are assigned and valid
0119     explicit operator bool() const
0120     {
0121         return max_substeps >= 0 && !looping.empty();
0122     }
0123 };
0124 
0125 //---------------------------------------------------------------------------//
0126 /*!
0127  * TODO: Placeholder for optical parameter data.
0128  * See \c G4OpticalParameters .
0129  */
0130 struct ImportOpticalParameters
0131 {
0132     bool scintillation_by_particle{false};
0133 };
0134 
0135 //---------------------------------------------------------------------------//
0136 }  // namespace celeritas