24#include "marley/OpticalModel.hh"
44 int fragment_pdg,
int two_j,
int l,
int two_s,
45 int target_charge = 0 )
override;
50 TCKey(
int fragment_pdg,
int two_j,
int l,
int two_s,
51 int target_charge ) : frag_pdg_( fragment_pdg ), two_j_( two_j ),
52 l_( l ), two_s_( two_s ), target_charge_( target_charge ) {}
56 bool operator<(
const TCKey& other )
const {
57 if ( frag_pdg_ != other.frag_pdg_ ) {
58 return frag_pdg_ < other.frag_pdg_;
60 else if ( two_j_ != other.two_j_ ) {
61 return two_j_ < other.two_j_;
63 else if ( l_ != other.l_ ) {
66 else if ( two_s_ != other.two_s_ ) {
67 return two_s_ < other.two_s_;
69 else if ( target_charge_ != other.target_charge_ ) {
70 return target_charge_ < other.target_charge_;
79 int target_charge_ = 0;
82 inline static void set_use_cache(
bool use_it ) {
90 int fragment_pdg,
int two_j,
int l,
int two_s,
91 int target_charge = 0 ) = 0;
95 std::map< TCKey, std::shared_ptr< InterpolatingFunction > >
Nuclear optical model that caches transmission coefficient calculations for efficiency.
static bool USE_CACHE
Boolean switch that allows global enabling/disabling of the cache, which is used by default.
static constexpr double MIN_TOTAL_KE_CM
Minimum kinetic energy to use when interacting with the cache.
CachedOpticalModel(int Z, int A)
static constexpr double MAX_TOTAL_KE_CM
Maximum kinetic energy to use when interacting with the cache.
std::map< TCKey, std::shared_ptr< InterpolatingFunction > > tc_cache_
Saved InterpolatingFunction objects corresponding to previously-encountered transmission coefficient ...
virtual double compute_transmission_coefficient(double total_KE_CM, int fragment_pdg, int two_j, int l, int two_s, int target_charge=0)=0
Do the actual calculation of the transmission coefficient.
virtual double transmission_coefficient(double total_KE_CM, int fragment_pdg, int two_j, int l, int two_s, int target_charge=0) override
Calculate the transmission coefficient for a nuclear fragment.
Abstract base class for an approximate representation of a 1D continuous function.
OpticalModel(int Z, int A)
int A() const
Get the mass number.
int Z() const
Get the atomic number.