mirror of
https://github.com/gwm17/catima.git
synced 2024-11-23 02:38:51 -05:00
We
This commit is contained in:
parent
dea686bba6
commit
b2f9f0c151
16
catima.cpp
16
catima.cpp
|
@ -418,4 +418,20 @@ double calculate_tof_from_E(Projectile p, double Eout, const Material &t, const
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double w_magnification(Projectile p, double Ein, const Material &t, const Config &c){
|
||||||
|
double res = 1.0;
|
||||||
|
if(t.density()<= 0.0 || t.thickness()<=0){
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
std::vector<double> energies{0.99*Ein, Ein, 1.1*Ein};
|
||||||
|
auto eres = energy_out(p,energies,t,c);
|
||||||
|
if(eres[0]>0.0 && eres[1]>0.0 && eres[2]>0.0){
|
||||||
|
res = energies[1]*(eres[2]-eres[0])/(eres[1]*(energies[2]-energies[0]));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res = 0.0;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
} // end of atima namespace
|
} // end of atima namespace
|
||||||
|
|
5
catima.h
5
catima.h
|
@ -209,6 +209,11 @@ namespace catima{
|
||||||
*/
|
*/
|
||||||
double calculate_tof_from_E(Projectile p, double Eout, const Material &t, const Config &c=default_config);
|
double calculate_tof_from_E(Projectile p, double Eout, const Material &t, const Config &c=default_config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns energy magnification after passing material t
|
||||||
|
*/
|
||||||
|
double w_magnification(Projectile p, double Ein, const Material &t, const Config &c=default_config);
|
||||||
|
|
||||||
class DataPoint;
|
class DataPoint;
|
||||||
/**
|
/**
|
||||||
* calculates DataPoint for Projectile Material combinatino
|
* calculates DataPoint for Projectile Material combinatino
|
||||||
|
|
|
@ -450,6 +450,11 @@ def energy_out(Projectile projectile, Material material, energy = None, Config c
|
||||||
energy = projectile.T()
|
energy = projectile.T()
|
||||||
return catimac.energy_out(projectile.cbase, <double>energy, material.cbase, config.cbase)
|
return catimac.energy_out(projectile.cbase, <double>energy, material.cbase, config.cbase)
|
||||||
|
|
||||||
|
def w_magnification(Projectile projectile, Material material, energy = None, Config config = default_config):
|
||||||
|
if(energy is None):
|
||||||
|
energy = projectile.T()
|
||||||
|
return catimac.w_magnification(projectile.cbase,energy, material.cbase, config.cbase)
|
||||||
|
|
||||||
def sezi_dedx_e(Projectile projectile, Target t):
|
def sezi_dedx_e(Projectile projectile, Target t):
|
||||||
return catimac.sezi_dedx_e(projectile.cbase, t.cbase)
|
return catimac.sezi_dedx_e(projectile.cbase, t.cbase)
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,8 @@ cdef extern from "catima/catima.h" namespace "catima":
|
||||||
cdef Result calculate(Projectile &p, const Material &t, const Config &c);
|
cdef Result calculate(Projectile &p, const Material &t, const Config &c);
|
||||||
cdef MultiResult calculate(Projectile &p, const Layers &layers, const Config &c);
|
cdef MultiResult calculate(Projectile &p, const Layers &layers, const Config &c);
|
||||||
|
|
||||||
|
cdef double w_magnification(Projectile p, double E, const Material &t, const Config &c);
|
||||||
|
|
||||||
cdef extern from "catima/calculations.h" namespace "catima":
|
cdef extern from "catima/calculations.h" namespace "catima":
|
||||||
cdef double bethek_lindhard(const Projectile &p);
|
cdef double bethek_lindhard(const Projectile &p);
|
||||||
cdef double bethek_lindhard_X(const Projectile &p);
|
cdef double bethek_lindhard_X(const Projectile &p);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user