1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-22 18:28:51 -05:00

ls docs and example

This commit is contained in:
hrocho 2017-07-27 11:39:44 +02:00
parent f146d72966
commit 58ce7fcb3a
8 changed files with 61 additions and 2 deletions

View File

@ -29,11 +29,41 @@ The range spline precision is checked via calculating dE/dx from inverse derivat
\end{figure} \end{figure}
\section{Lindhard-Soerensen}
The Lindhard-Soerensen (LS) corrections to energy loss and energy loss straggling can be calculated directly or from precalculated values, which is useful when performance is needed. The precalculated LS coefficients are calculated at predefined log distributed energies. Below and above the energy limits the functions returns the value at minimal or maximal precalculated value. The take into account the different masses the Ls coefficients are precalculated for 2 different masses and final coefficients are estimated using a linear interpolation between the two calculations.
The calculated LS coefficients are plotted in Fig. \ref{ls}.
For the comparison and check of precalculated LS coefficients the LS coefficients and relative difference to directly calculated coefficients for different masses and charges are plotted in Figures \ref{ls_prec} amd \ref{lsX_prec}.
\begin{figure}
\centering
\includegraphics[width=6.5cm]{plots/ls.png}
\includegraphics[width=6.5cm]{plots/lsX.png}
\caption{LS corrections for energy loss and energy loss straggling for different energies and projectile}
\label{ls}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=12cm]{plots/ls_precision.png}
\caption{LS corrections for energy loss directly calculated and calculated from the tabulated values for different Z and A. On the right the relative differences are plotted. The lowest energy for precalculation was set to 1 MeV/u.}
\label{ls_prec}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=12cm]{plots/lsX_precision.png}
\caption{LS corrections for energy loss directly calculated and calculated from the tabulated values for different Z and A. On the right the relative differences are plotted. The lowest energy for precalculation was set to 1 MeV/u.}
\label{lsX_prec}
\end{figure}
\section{Benchmarks} \section{Benchmarks}
\subsection{Thin Target Approximation} \subsection{Thin Target Approximation}
test: projectile: 238U@700MeV/u - 30GeV/u, material: C(1mg/cm2), 30000 calculation in loop. test: projectile: 238U@700MeV/u - 30GeV/u, material: C(1mg/cm2), 30000 calculation in loop.
reults: with thin target pproximation: 2.4s, without: 2.4s reults: with thin target pproximation: 2.4s, without: 2.4s
\end{document} \end{document}

BIN
docs/plots/ls.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
docs/plots/lsX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
docs/plots/ls_precision.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -0,0 +1,27 @@
/**
* this example program print out Lindhard - Soerrensen coefficients for 238U
*/
#include "catima/catima.h"
#include "catima/storage.h"
#include <iostream>
using std::cout;
using std::endl;
int main(){
catima::Projectile p(238,92); // define projectile, ie 12C
cout<<"projectile 238U\n";
auto energies = catima::EnergyTable<50>(2,5); // get energy table, energies log distributed between 10^2 and 10000^5;
for(double T:energies){
auto ls = catima::bethek_lindhard(p(T));
auto lsX = catima::bethek_lindhard_X(p(T));
cout<<"T "<<T<<", Delta LS = "<<ls<<", X = "<<lsX<<endl;
}
return 0;
}

View File

@ -1,4 +1,4 @@
PROGRAMS=simple example2 materials PROGRAMS=simple example2 materials ls_coefficients
GCC=g++ -Wall -std=c++14 GCC=g++ -Wall -std=c++14
INCDIR=-I$(CATIMAPATH)/include INCDIR=-I$(CATIMAPATH)/include

View File

@ -59,6 +59,8 @@ namespace catima{
double operator()(int i)const{return values[i];} double operator()(int i)const{return values[i];}
double values[N]; double values[N];
double step; double step;
double* begin(){return values;}
double* end(){return &values[num-1];}
std::size_t num; std::size_t num;
}; };