From e2c3db8405f8256f2b335097fa83c278eafbf704 Mon Sep 17 00:00:00 2001 From: hrocho Date: Wed, 5 Aug 2020 18:58:03 +0200 Subject: [PATCH] dx py fix --- catima.cpp | 3 --- pymodule/pycatima.cpp | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/catima.cpp b/catima.cpp index bb801ec..be00a11 100644 --- a/catima.cpp +++ b/catima.cpp @@ -314,10 +314,7 @@ MultiResult calculate(const Projectile &p, const Layers &layers, const Config &c double e = p.T; res.total_result.Ein = e; res.results.reserve(layers.num()); - double z = 0; - double cov = 0; for(auto&m:layers.get_materials()){ - z += m.thickness_cm(); Result r = calculate(p,m,e,c); e = r.Eout; res.total_result.Eloss += r.Eloss; diff --git a/pymodule/pycatima.cpp b/pymodule/pycatima.cpp index 6929cbe..2759488 100644 --- a/pymodule/pycatima.cpp +++ b/pymodule/pycatima.cpp @@ -281,14 +281,14 @@ PYBIND11_MODULE(pycatima,m){ m.def("srim_dedx_e",&srim_dedx_e); m.def("sezi_dedx_e",&sezi_dedx_e, "sezi_dedx_e", py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); - m.def("calculate",py::overload_cast(&calculate),"calculate",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); - m.def("calculate_layers",py::overload_cast(&calculate),"calculate_layers",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); - m.def("dedx_from_range",py::overload_cast(&dedx_from_range),"calculate",py::arg("projectile") ,py::arg("material"), py::arg("config")=default_config); - m.def("dedx_from_range",py::overload_cast&, const Material&, const Config&>(&dedx_from_range),"calculate",py::arg("projectile"), py::arg("energy") ,py::arg("material"), py::arg("config")=default_config); - m.def("dedx",py::overload_cast(&dedx), "dedx",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); - m.def("range",py::overload_cast(&range), "range",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); - m.def("energy_out",py::overload_cast&, const Material&, const Config&>(&energy_out),"energy_out",py::arg("projectile"), py::arg("energy") ,py::arg("material"), py::arg("config")=default_config); - m.def("energy_out",py::overload_cast(&energy_out),"energy_out",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); + m.def("calculate",py::overload_cast(&calculate),"calculate",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); + m.def("calculate_layers",py::overload_cast(&calculate),"calculate_layers",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); + m.def("dedx_from_range",py::overload_cast(&dedx_from_range),"calculate",py::arg("projectile") ,py::arg("material"), py::arg("config")=default_config); + m.def("dedx_from_range",py::overload_cast&, const Material&, const Config&>(&dedx_from_range),"calculate",py::arg("projectile"), py::arg("energy") ,py::arg("material"), py::arg("config")=default_config); + m.def("dedx",py::overload_cast(&dedx), "dedx",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); + m.def("range",py::overload_cast(&range), "range",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); + m.def("energy_out",py::overload_cast&, const Material&, const Config&>(&energy_out),"energy_out",py::arg("projectile"), py::arg("energy") ,py::arg("material"), py::arg("config")=default_config); + m.def("energy_out",py::overload_cast(&energy_out),"energy_out",py::arg("projectile"), py::arg("material"), py::arg("config")=default_config); m.def("lindhard",&bethek_lindhard); m.def("lindhard_X",&bethek_lindhard_X); m.def("get_material",py::overload_cast(&get_material));