Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:09:08

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