mirror of
https://github.com/gwm17/catima.git
synced 2024-11-22 18:28:51 -05:00
commit
e80e0e26f6
|
@ -254,7 +254,7 @@ Result calculate(Projectile &p, const Material &t, const Config &c){
|
|||
spline_type angular_variance_spline = get_angular_variance_spline(data);
|
||||
res.sigma_a = sqrt(angular_variance_spline(T) - angular_variance_spline(res.Eout));
|
||||
#endif
|
||||
if( !(c.skip&skip_tof) && t.thickness()>0){
|
||||
if( t.thickness()>0){
|
||||
//auto tofdata = calculate_tof(p,t,c);
|
||||
//Interpolator tof_spline(energy_table.values, tofdata.data(), energy_table.num,interpolation_t::linear);
|
||||
//res.tof = tof_spline(res.Ein) - tof_spline(res.Eout);
|
||||
|
|
22
config.h
22
config.h
|
@ -19,17 +19,6 @@ namespace catima{
|
|||
atima14 = 7
|
||||
};
|
||||
|
||||
/**
|
||||
* enum to select which calculation to skip
|
||||
*/
|
||||
enum skip_calculation:unsigned char{
|
||||
skip_none = 0,
|
||||
skip_tof = 1,
|
||||
skip_sigma_a = 2,
|
||||
skip_sigma_r = 4,
|
||||
skip_reactions = 128
|
||||
};
|
||||
|
||||
/**
|
||||
* enum to select which dEdx correction to skip
|
||||
*/
|
||||
|
@ -58,11 +47,6 @@ namespace catima{
|
|||
|
||||
/**
|
||||
* structure to store calculation configuration
|
||||
* each group of options are grouped and enum are suppose to use
|
||||
* see catima::z_eff_type, catima::skip_calculation, catima::corrections
|
||||
*
|
||||
* check catima::z_effective()
|
||||
*
|
||||
*/
|
||||
struct Config{
|
||||
#ifndef GLOBAL
|
||||
|
@ -71,12 +55,6 @@ namespace catima{
|
|||
unsigned char z_effective=z_eff_type::atima14;
|
||||
#endif
|
||||
|
||||
#ifdef REACTIONS
|
||||
unsigned char skip=skip_none;
|
||||
#else
|
||||
unsigned char skip=skip_calculation::skip_reactions;
|
||||
#endif
|
||||
|
||||
unsigned char corrections = 0;
|
||||
unsigned char calculation = 1;
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@ extern "C" {
|
|||
|
||||
CatimaResult catima_calculate(double pa, int pz, double T, double ta, double tz, double thickness, double density){
|
||||
catima::default_config.z_effective = catima_defaults.z_effective;
|
||||
catima::default_config.skip = catima_defaults.skip;
|
||||
catima::Material mat;
|
||||
catima::Projectile p(pa,pz);
|
||||
if(tz>200){
|
||||
|
|
18
cwrapper.h
18
cwrapper.h
|
@ -21,22 +21,20 @@ struct CatimaResult{
|
|||
|
||||
enum z_eff_type {
|
||||
none = 0,
|
||||
atima = 1
|
||||
};
|
||||
|
||||
enum skip_calculation{
|
||||
skip_none = 0,
|
||||
skip_tof = 1,
|
||||
skip_sigma_a = 2,
|
||||
skip_sigma_r = 4
|
||||
pierce_blann = 1,
|
||||
anthony_landorf = 2,
|
||||
hubert = 3,
|
||||
winger = 4,
|
||||
schiwietz = 5,
|
||||
global = 6,
|
||||
atima14 = 7
|
||||
};
|
||||
|
||||
struct CatimaConfig {
|
||||
char z_effective;
|
||||
char skip;
|
||||
};
|
||||
|
||||
struct CatimaConfig catima_defaults = {none,skip_none};
|
||||
struct CatimaConfig catima_defaults = {none};
|
||||
|
||||
typedef struct CatimaResult CatimaResult;
|
||||
|
||||
|
|
|
@ -213,13 +213,6 @@ PYBIND11_MODULE(pycatima,m){
|
|||
.value("global", z_eff_type::global)
|
||||
.value("atima14", z_eff_type::atima14);
|
||||
|
||||
py::enum_<skip_calculation>(m,"skip_calculation")
|
||||
.value("skip_none", skip_calculation::skip_none)
|
||||
.value("skip_tof", skip_calculation::skip_tof)
|
||||
.value("skip_sigma_a", skip_calculation::skip_sigma_a)
|
||||
.value("skip_sigma_r", skip_calculation::skip_sigma_r)
|
||||
.value("skip_reactions", skip_calculation::skip_reactions);
|
||||
|
||||
py::enum_<corrections>(m,"corrections")
|
||||
.value("no_barkas", corrections::no_barkas)
|
||||
.value("no_lindhard", corrections::no_lindhard)
|
||||
|
@ -264,13 +257,11 @@ PYBIND11_MODULE(pycatima,m){
|
|||
.def_readwrite("z_effective", &Config::z_effective)
|
||||
.def_readwrite("corrections", &Config::corrections)
|
||||
.def_readwrite("calculation", &Config::calculation)
|
||||
.def_readwrite("skip", &Config::skip)
|
||||
.def("get",[](const Config &r){
|
||||
py::dict d;
|
||||
d["z_effective"] = r.z_effective;
|
||||
d["corrections"] = r.corrections;
|
||||
d["calculation"] = r.calculation;
|
||||
d["skip"] = r.skip;
|
||||
return d;
|
||||
})
|
||||
.def("__str__",[](const Config &r){
|
||||
|
|
Loading…
Reference in New Issue
Block a user