1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-26 12:08:52 -05:00
This commit is contained in:
hrocho 2018-10-31 19:14:29 +01:00
parent c0e0cc509f
commit cb8cb30f74
6 changed files with 14 additions and 5 deletions

View File

@ -112,6 +112,11 @@ double bethek_dedx_e(Projectile &p, const Target &t, const Config &c, double I){
} }
double result = (f2)*barkas + LS - delta/2.; double result = (f2)*barkas + LS - delta/2.;
result *=f1; result *=f1;
if( (p.T>50000.0) && (!c.dedx&corrections::no_highenergy)){
result += pair_production(p,t);
result += bremsstrahlung(p,t);
}
return result; return result;
} }

View File

@ -36,7 +36,8 @@ namespace catima{
enum corrections:unsigned char{ enum corrections:unsigned char{
no_barkas = 1, no_barkas = 1,
no_lindhard = 2, no_lindhard = 2,
no_shell_correction = 4 no_shell_correction = 4,
no_highenergy = 8
}; };
/** /**

View File

@ -6,7 +6,7 @@ namespace catima {
constexpr double Ezero = 1E-3; // lowest E to calculate, below taken as 0 constexpr double Ezero = 1E-3; // lowest E to calculate, below taken as 0
constexpr double logEmin = -3; // log of minimum energy constexpr double logEmin = -3; // log of minimum energy
constexpr double logEmax = 5.0; // log of max energy constexpr double logEmax = 7.0; // log of max energy
constexpr int max_datapoints = 500; // how many datapoints between logEmin and logEmax constexpr int max_datapoints = 500; // how many datapoints between logEmin and logEmax
constexpr int max_storage_data = 100; // number of datapoints which can be stored in cache constexpr int max_storage_data = 100; // number of datapoints which can be stored in cache
constexpr double numeric_epsilon = std::numeric_limits<double>::epsilon(); constexpr double numeric_epsilon = std::numeric_limits<double>::epsilon();

View File

@ -65,8 +65,7 @@ namespace catima{
int EnergyTable_index(const EnergyTable<N> &table, double val){ int EnergyTable_index(const EnergyTable<N> &table, double val){
if(val<table.values[0] || val>table.values[table.num-1])return -1; if(val<table.values[0] || val>table.values[table.num-1])return -1;
double lxval = (log(val/table.values[0])/M_LN10); double lxval = (log(val/table.values[0])/M_LN10);
int i = (int)std::floor(lxval/table.step); return static_cast<int>( std::floor(lxval/table.step));
return i;
} }
template<int N> template<int N>

View File

@ -127,7 +127,7 @@ const lest::test specification[] =
EXPECT(catima::pair_production(p(1e6),t) == approx(1900,300)); EXPECT(catima::pair_production(p(1e6),t) == approx(1900,300));
EXPECT(catima::bremsstrahlung(p(1e6),t) == approx(170,20)); EXPECT(catima::bremsstrahlung(p(1e6),t) == approx(170,20));
EXPECT(catima::pair_production(p(7e6),t) == approx(21000,3000)); EXPECT(catima::pair_production(p(7e6),t) == approx(19000,5000));
EXPECT(catima::bremsstrahlung(p(7e6),t) == approx(6000,500)); EXPECT(catima::bremsstrahlung(p(7e6),t) == approx(6000,500));
}, },
CASE("dEdx for compounds"){ CASE("dEdx for compounds"){

View File

@ -120,6 +120,10 @@ const lest::test specification[] =
EXPECT(catima::energy_table.step==step); EXPECT(catima::energy_table.step==step);
EXPECT(catima::energy_table.values[0]==exp(M_LN10*(catima::logEmin))); EXPECT(catima::energy_table.values[0]==exp(M_LN10*(catima::logEmin)));
EXPECT(catima::energy_table.values[1]==exp(M_LN10*(catima::logEmin+step))); EXPECT(catima::energy_table.values[1]==exp(M_LN10*(catima::logEmin+step)));
EXPECT(catima::energy_table.values[2]==exp(M_LN10*(catima::logEmin+2.0*step)));
EXPECT(catima::energy_table.values[3]==exp(M_LN10*(catima::logEmin+3.0*step)));
EXPECT(catima::energy_table.values[4]==exp(M_LN10*(catima::logEmin+4.0*step)));
EXPECT(catima::energy_table.values[5]==exp(M_LN10*(catima::logEmin+5.0*step)));
EXPECT(catima::energy_table.values[catima::max_datapoints-1]==approx(exp(M_LN10*(catima::logEmax))).epsilon(1e-6)); EXPECT(catima::energy_table.values[catima::max_datapoints-1]==approx(exp(M_LN10*(catima::logEmax))).epsilon(1e-6));
}, },
CASE("indexing"){ CASE("indexing"){