Back to home page

EIC code displayed by LXR

 
 

    


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

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/neutron/model/CascadeOptions.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Macros.hh"
0011 #include "corecel/Types.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 /*!
0017  * Configuration options for the Bertini cascade model.
0018  */
0019 struct CascadeOptions
0020 {
0021     /// Top-level Configuration flags
0022 
0023     //! The flag for using the PreCompound model
0024     bool use_precompound = false;
0025 
0026     //! The flag for using ABLA data
0027     bool use_abla = false;
0028 
0029     //! The flag for using the three body momentum
0030     bool use_three_body_mom = false;
0031 
0032     //! The flag for using the phase space
0033     bool use_phase_space = false;
0034 
0035     //! The flag for applying coalescence
0036     bool do_coalescence = true;
0037 
0038     //! The probability for the pion-nucleon absorption
0039     real_type prob_pion_absorption = 0;
0040 
0041     /// Nuclear structure parameters
0042 
0043     //! The flag for using two parameters for the nuclear radius
0044     bool use_two_params = false;
0045 
0046     //! The scale for the nuclear radius in [femtometer]
0047     real_type radius_scale = 2.81967;
0048 
0049     //! The radius scale for small A (A < 4)
0050     real_type radius_small = 8;
0051 
0052     //! The radius scale for alpha (A = 4)
0053     real_type radius_alpha = 0.7;
0054 
0055     //! The trailing factor for the nuclear radius
0056     real_type radius_trailing = 0;
0057 
0058     //! The scale for the Fermi radius in [MeV/c]
0059     real_type fermi_scale = 1932;
0060 
0061     //! The scale for cross sections
0062     real_type xsec_scale = 1;
0063 
0064     //! The scale for the quasi-deuteron cross section of gamma
0065     real_type gamma_qd_scale = 1;
0066 
0067     /// Final-state clustering cuts
0068 
0069     //! The final state clustering cut (2 clusters)
0070     real_type dp_max_doublet = 0.09;
0071 
0072     //! The final state clustering cut (3 clusters)
0073     real_type dp_max_triplet = 0.108;
0074 
0075     //! The final state clustering cut (4 clusters)
0076     real_type dp_max_alpha = 0.115;
0077 
0078     //! Whether all data are assigned and valid
0079     explicit CELER_FUNCTION operator bool() const
0080     {
0081         // clang-format off
0082       return  (prob_pion_absorption >= 0)
0083            && (radius_scale > 0)
0084            && (radius_small > 0)
0085            && (radius_alpha > 0)
0086            && (radius_trailing >= 0)
0087            && (fermi_scale > 0)
0088            && (xsec_scale > 0)
0089            && (gamma_qd_scale > 0)
0090            && (dp_max_doublet > 0)
0091            && (dp_max_triplet > 0)
0092            && (dp_max_alpha > 0);
0093         // clang-format on
0094     }
0095 };
0096 
0097 //---------------------------------------------------------------------------//
0098 //! Equality operator
0099 constexpr bool operator==(CascadeOptions const& a, CascadeOptions const& b)
0100 {
0101     // clang-format off
0102     return a.use_precompound == b.use_precompound
0103            && a.use_abla == b.use_abla
0104            && a.use_three_body_mom == b.use_three_body_mom
0105            && a.use_phase_space == b.use_phase_space
0106            && a.do_coalescence == b.do_coalescence
0107            && a.prob_pion_absorption == b.prob_pion_absorption
0108            && a.use_two_params == b.use_two_params
0109            && a.radius_scale == b.radius_scale
0110            && a.radius_small == b.radius_small
0111            && a.radius_alpha == b.radius_alpha
0112            && a.radius_trailing == b.radius_trailing
0113            && a.fermi_scale == b.fermi_scale
0114            && a.xsec_scale == b.xsec_scale
0115            && a.gamma_qd_scale == b.gamma_qd_scale
0116            && a.dp_max_doublet == b.dp_max_doublet
0117            && a.dp_max_triplet == b.dp_max_triplet
0118            && a.dp_max_alpha == b.dp_max_alpha;
0119     // clang-format on
0120 }
0121 
0122 //---------------------------------------------------------------------------//
0123 // Throw a runtime assertion if any of the input is invalid
0124 void validate_input(CascadeOptions const&);
0125 
0126 //---------------------------------------------------------------------------//
0127 }  // namespace celeritas