1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-23 10:48:50 -05:00
catima/examples/example2.cpp

32 lines
852 B
C++
Raw Normal View History

2017-07-25 12:19:11 -04:00
#include "catima/catima.h"
#include <iostream>
using std::cout;
using std::endl;
int main(){
catima::Material graphite;
graphite.add_element(12,6,1); // arguments are A,Z, stoichiometric number
graphite.density(1.8); // density in g/cm3
graphite.thickness(2.0); // thickness in g/cm2
catima::Material water({ // material with 2 atoms
{1,1,2}, // 1H - two atoms
{16,8,1} // 16O - 1 atom
});
water.density(1.0).thickness(2.0);
catima::Projectile p(12,6); // define projectile, ie 12C
catima::Layers layer1; // create layers from materials defined above
layer1.add(graphite);
layer1.add(water);
layer1.add(graphite);
auto results = catima::calculate(p(1000),layer1); //calculate rtansport through layers with initial energy 1000 MeV/u
return 0;
}