1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-23 02:38:51 -05:00
This commit is contained in:
hrocho 2018-02-07 12:13:23 +01:00
parent ee7246b464
commit a530d98d8d
3 changed files with 6 additions and 5 deletions

View File

@ -559,7 +559,7 @@ double angular_scattering_variance(Projectile &p, Target &t){
} }
/// radioation lengths are taken frm Particle Data Group 2014 /// radioation lengths are taken frm Particle Data Group 2014
double radiation_length(int z, int m){ double radiation_length(int z, double m){
double lr = 0; double lr = 0;
if(z==1){return 63.04;} if(z==1){return 63.04;}
if(z==2){return 94.32;} if(z==2){return 94.32;}

View File

@ -95,10 +95,11 @@ namespace catima{
/** /**
* returns radiation length of the (M,Z) material * returns radiation length of the (M,Z) material
* for certain z the radiation length is tabulated, otherwise calculated * for certain z the radiation length is tabulated, otherwise calculated
* @param z - proton number of material * @param z - proton number of target
* @param m - weight of the target
* @return radiation length in g/cm^2 * @return radiation length in g/cm^2
*/ */
double radiation_length(int z, int m); double radiation_length(int z, double m);
/** returns effective Z of the projectile /** returns effective Z of the projectile
* @param c - Configuration, the z effective will be calculated according to c.z_effective value * @param c - Configuration, the z effective will be calculated according to c.z_effective value

View File

@ -170,7 +170,7 @@ const lest::test specification[] =
auto res = catima::calculate(p,graphite); auto res = catima::calculate(p,graphite);
dif = res.Eout - 997.077; dif = res.Eout - 997.077;
EXPECT( fabs(dif) < 0.01); EXPECT( res.Eout == approx(997.07,01));
}, },
CASE("TOF test"){ CASE("TOF test"){
catima::Projectile p{12,6,6,1000}; catima::Projectile p{12,6,6,1000};
@ -295,7 +295,7 @@ const lest::test specification[] =
EXPECT(res.results[0].range == approx(107.163,0.1)); EXPECT(res.results[0].range == approx(107.163,0.1));
EXPECT(res.results[1].Eout == approx(926.3,0.1)); EXPECT(res.results[1].Eout == approx(926.3,0.1));
EXPECT(res.results[1].sigma_a == approx(0.000774).R(0.05)); EXPECT(res.results[1].sigma_a == approx(0.000774).R(0.05));
EXPECT(res.results[1].range == approx(110.8,0.1)); EXPECT(res.results[1].range == approx(111.3,0.1));
auto res0 = catima::calculate(p(1000),water); auto res0 = catima::calculate(p(1000),water);
EXPECT(res0.Eout == res.results[0].Eout); EXPECT(res0.Eout == res.results[0].Eout);