diff --git a/calculations.cpp b/calculations.cpp index f4413e0..3d25c1d 100644 --- a/calculations.cpp +++ b/calculations.cpp @@ -559,7 +559,7 @@ double angular_scattering_variance(Projectile &p, Target &t){ } /// 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; if(z==1){return 63.04;} if(z==2){return 94.32;} diff --git a/calculations.h b/calculations.h index 25be496..a9b0449 100644 --- a/calculations.h +++ b/calculations.h @@ -95,10 +95,11 @@ namespace catima{ /** * returns radiation length of the (M,Z) material * 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 */ - double radiation_length(int z, int m); + double radiation_length(int z, double m); /** returns effective Z of the projectile * @param c - Configuration, the z effective will be calculated according to c.z_effective value diff --git a/tests/test_calculations.cpp b/tests/test_calculations.cpp index def28bd..824a06d 100644 --- a/tests/test_calculations.cpp +++ b/tests/test_calculations.cpp @@ -170,7 +170,7 @@ const lest::test specification[] = auto res = catima::calculate(p,graphite); dif = res.Eout - 997.077; - EXPECT( fabs(dif) < 0.01); + EXPECT( res.Eout == approx(997.07,01)); }, CASE("TOF test"){ 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[1].Eout == approx(926.3,0.1)); 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); EXPECT(res0.Eout == res.results[0].Eout);