CATima library manual ===================== Compiling and Instalation ------------------------- See [README.md](README.md) for details. [link2](catima_calculator.md) Units ------ The following units are used for input and outputs: * projectile energy - MeV/u * density - g/cm^3 * material thickness - g/cm^2 * material length - cm * angle - rad * time of flight - ns Projectile ---------- The __Projectile__ class is used to store projectile data. Each projectile must provide A,Z combination, additionally charge state can be set as well. The example of projectile definition: ~~~~~~~~~~~~~~~~~~~{.cpp} catima::Projectile p1(12,6); //12C projectile catima::Projectile p2(12,6,5); //12C(5+) projectile ~~~~~~~~~~~~~~~~~~~ to set the energy of the projectile in MeV/u units: ```cpp p1.T = 1000.0; p2(1000.0); ``` Material Definition ------------------- The material is defined and stored in __Material__ class. The class stores the atom constituents, thickness and density of the material etc. There are 2 ways to define materials: specifying all elements in constructor or using `add_element(double, int, double)` function. The example of water definition: ```cpp catima::Material carbon({0,6,1}); // carbon with elemental atomic weight catima::Material water1({ {1,1,2}, // {weight, Z, stn or weight fraction} {16,8,1} }); water1.density(1.0); water1.thickness(2.0); water1.I(78.); // set custom ionization potential in eV catima::Material water2; water2.add_element(1,1,2); water2.add_element(16,8,1); water2.density(1.0).thickness(2.0); ``` If mass number is equal to 0, the mass number of the element is taken as atomic weight of the element. Compound elements can be defined either via stoichiometric number or via weight fraction. If the number is less than 1 it is assumed weight fraction is being used, otherwise stoichiometric number or molar fraction is being used. ```cpp catima::Material air ({{0,7,0.755267},{0,8,0.231781},{0,18,0.012827},{0,6,0.000124}},0.001205); // weight fractions catima::Material water ({{0,1,2},{0,8,1}},1); // mole fraction ``` ### predefined materials ### If the library is compiled with predefined materials database, the Material can be retrieved from the database as: ```cpp using namespace catimal Material water = get_material(material::WATER); Material graphite = get_material(6); ``` The list of predefined material can be found at __material_database.h__ file Calculation ----------- To calculate all observable following function can be used: ```cpp Result calculate(Projectile &p, const Material &t, double T, Config c) Result calculate(Projectile &p, const Material &t, Config c) ``` Both function returns structure ___Result___ which contains all calculated variables. ```cpp struct Result{ double Ein=0.0; double Eout=0.0; double Eloss = 0.0; double range=0.0; double dEdxi=0.0; double dEdxo=0.0; double sigma_E=0.0; double sigma_a=0.0; double sigma_r=0.0; double tof=0.0; }; ``` If one is interested only in one of the variable, the following function can be used: ```cpp double dedx(Projectile &p, double T, const Material &t, Config c=default_config); double domega2dx(Projectile &p, double T, const Material &t, Config c=default_config); double range(Projectile &p, double T, const Material &t, Config c=default_config); double range_straggling(Projectile &p, double T, const Material &t, Config c=default_config); double angular_straggling(Projectile &p, double T, const Material &t, Config c=default_config); ``` Example calculation: ```cpp ... double T=1000; auto result = catima::calculate(p1(1000),water1); cout<<"T "<