1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-22 10:18:50 -05:00
This commit is contained in:
hrocho 2019-10-22 20:59:21 +02:00
parent 345495af29
commit a473cd2947
7 changed files with 211 additions and 180 deletions

View File

@ -1,13 +1,3 @@
CATima
=======
C++ library for caclulalaton of energy loss, range, angular scattering and time of flight of the particle passing through matter.
The library is based on physics used in the ATIMA code,however its not 100% copy of ATIMA physics.
see CREDITS for more details.
The WebAtima UI to this library can be found here:
* https://web-docs.gsi.de/~aprochaz/webatima (only inside GSI)
* https://isotopea.com/webatima
Installation
------------
CMake is used to build the library. For default build use:
@ -45,7 +35,7 @@ available options:
* THIN_TARGET_APPROXIMATION - compile the library with thin target approximation, default: ON
* GSL_INTEGRATION - use GSL integration functions, otherwise use built-in integrator, default: OFF
* GLOBAL - compile with GLOBAL code (source not included at the moment, needs to be manually added to __global__ directory, default:OFF)
* STORE_SPLINES - store splines in cache, if disabled datapoints are stored and splines are recreated, default ON
* STORE_SPLINES - store splines in cache, if disabled datapoints are stored and splines are recreated, default ON
ie:
> cmake -DPYTHON_MODULE=ON -DEXAMPLES=ON ../

21
docs/api.rst Normal file
View File

@ -0,0 +1,21 @@
API Reference
#############
.. doxygenstruct:: catima::Projectile
:members:
.. doxygenclass:: catima::Material
:members:
.. doxygenclass:: catima::Layers
:members:
.. doxygenstruct:: catima::Result
:members:
:undoc-members:
.. doxygenstruct:: catima::MultiResult
:members:
:undoc-members:

View File

@ -17,7 +17,7 @@ example
Config File Format
------------------
The file must be a valid JSON formatted file.
The file must be a valid JSON formatted file.
The json file should contain the following keys: "projectile", "material", "energy"
@ -33,8 +33,8 @@ examples:
#### material
The __material__ keyword is array of object for multi layer material,
or single object defining the material.
The material object must contain __Z__ keyword defining proton number
of the projectile or the compound material id.
The material object must contain __Z__ keyword defining proton number
of the projectile or the compound material id.
Optional material object keywords are:
* __Z__ - proton number or compunds id, mandatory
* __A__ - mass number of the material, if 0 or undefined elemental atomic weight is used
@ -42,7 +42,7 @@ Optional material object keywords are:
* __thickness__ - material or layer thickness in g/cm2
#### energy
The __energy__ keyword can be
The __energy__ keyword can be
1.a number specifying the kinetic energy:
```
"energy":"500.0"
@ -64,7 +64,7 @@ The __energy__ keyword can be
instead of "step" key the "num" can be specified for integer number of steps between min and max energy.
#### config
The calculation configuration can be change using __config__ keyword. If
The calculation configuration can be change using __config__ keyword. If
not specified default will be used. The config keyword is expected to be one of the strings
* "atimav1.3" - for Atima v1.3 setting
* "atimav1.4" - for Atima v1.4 setting
@ -130,151 +130,3 @@ Example Files
}
}
```
#### Compound material
The predefined compound material can be used using the __Z__ field as an ID of the compound.
The following are supported:
```
Plastics = 201,
Air = 202,
CH2 = 203,
LH2 = 204,
LD2 = 205,
Water = 206,
Diamond = 207,
Glass = 208,
ALMG3 = 209,
ArCO2_30 = 210,
CF4 = 211,
Isobutane = 212,
Kapton = 213,
Mylar = 214,
NaF = 215,
P10 = 216,
Polyolefin = 217,
CmO2 = 218,
Suprasil = 219,
HAVAR = 220,
Steel = 221,
CO2 = 222,
CH4 = 223,
Methanol = 224,
Acetone = 225,
Acetylene = 226,
Adenine = 227,
Adipose_Tissue = 228,
Alanine = 229,
Bakelite = 230,
AgBr = 231,
AgCl = 232,
AgI = 233,
Al2O3 = 234,
Amber = 235,
Ammonia = 236,
Aniline = 237,
Anthracene = 238,
A_150 = 239,
B_100 = 240,
BaF2 = 241,
BaSO4 = 242,
Benzene = 243,
BeO = 244,
BGO = 245,
Blood = 246,
Bone_Compact = 247,
Bone_Cortical = 248,
Brain_ICRP = 249,
B4C = 250,
BC400 = 251,
nButanol = 252,
C_552 = 253,
CdTe = 254,
CdWO4 = 255,
CaCO3 = 256,
CaF2 = 257,
CaO = 258,
CaWO4 = 259,
CsF = 260,
CsI = 261,
CCl4 = 262,
C2Cl4 = 263,
Cellophane = 264,
Chlorobenzene = 265,
Chloroform = 266,
Cyclohexane = 267,
Concrete = 268,
Diethyl_Ether = 269,
Ethane = 270,
Ethanol = 271,
Ethylene = 272,
Eye_lens = 273,
Fe2O3 = 274,
FeO = 275,
Freon12 = 276,
Freon12B2 = 277,
Freon13 = 278,
Freon13B1 = 279,
Freon13I1 = 280,
Gd2O2S = 281,
GaAs = 282,
Gel_Photo_Emulsion = 283,
Glass_Pyrex = 284,
Glass_Lead = 285,
Glucose = 286,
Glutamine = 287,
Glycerol = 288,
Guanine = 289,
Gypsum = 290,
nHeptane = 291,
nHexane = 292,
KI = 293,
K2O = 294,
LaBr3 = 295,
LaOBr = 296,
La2O2S = 297,
Lung = 298,
MgCO3 = 299,
MgF2 = 300,
MgO = 301,
MS20_Tissue = 302,
Muscle_skeletal = 303,
Muscle_strained = 304,
Muscle_sucrose = 305,
Muscle_no_sucrose = 306,
Na2CO3 = 307,
NaI = 308,
NaCl = 309,
Na2O = 310,
NaNO3 = 311,
Naphthalene = 312,
Nitrobenzene = 313,
N2O = 314,
Octane = 315,
Paraffin = 316,
nPentane = 317,
PhotoEmulsion = 318,
PuO2 = 319,
Polyacrylonitrile = 320,
Polycarbonate = 321,
PMMA = 322,
POM = 323,
Polypropylene = 324,
Polystyrene = 325,
Propane = 326,
nPropanol = 327,
PVC = 328,
Pyridine = 329,
SiO2 = 330,
Skin = 331,
Sucrose = 332,
Teflon = 333,
TlCl = 334,
Toluene = 335,
Trichloroethylene = 336,
WF6 = 337,
UC2 = 338,
UC = 339,
UO2 = 340,
Urea = 341,
Valine = 342
```

View File

@ -1,10 +1,6 @@
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:
@ -21,10 +17,10 @@ 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}
```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
@ -42,7 +38,7 @@ The example of water definition:
```cpp
catima::Material carbon({0,6,1}); // carbon with elemental atomic weight
catima::Material carbon({0,6,1}); // carbon with elemental atomic weight
catima::Material water1({
{1,1,2}, // {weight, Z, stn or weight fraction}
@ -224,3 +220,151 @@ It provides only basic interface.
Compound Pre-defined Materials
==============================
The predefined compound material can be used using the __Z__ field as an ID of the compound.
The following are supported:
```
Plastics = 201,
Air = 202,
CH2 = 203,
LH2 = 204,
LD2 = 205,
Water = 206,
Diamond = 207,
Glass = 208,
ALMG3 = 209,
ArCO2_30 = 210,
CF4 = 211,
Isobutane = 212,
Kapton = 213,
Mylar = 214,
NaF = 215,
P10 = 216,
Polyolefin = 217,
CmO2 = 218,
Suprasil = 219,
HAVAR = 220,
Steel = 221,
CO2 = 222,
CH4 = 223,
Methanol = 224,
Acetone = 225,
Acetylene = 226,
Adenine = 227,
Adipose_Tissue = 228,
Alanine = 229,
Bakelite = 230,
AgBr = 231,
AgCl = 232,
AgI = 233,
Al2O3 = 234,
Amber = 235,
Ammonia = 236,
Aniline = 237,
Anthracene = 238,
A_150 = 239,
B_100 = 240,
BaF2 = 241,
BaSO4 = 242,
Benzene = 243,
BeO = 244,
BGO = 245,
Blood = 246,
Bone_Compact = 247,
Bone_Cortical = 248,
Brain_ICRP = 249,
B4C = 250,
BC400 = 251,
nButanol = 252,
C_552 = 253,
CdTe = 254,
CdWO4 = 255,
CaCO3 = 256,
CaF2 = 257,
CaO = 258,
CaWO4 = 259,
CsF = 260,
CsI = 261,
CCl4 = 262,
C2Cl4 = 263,
Cellophane = 264,
Chlorobenzene = 265,
Chloroform = 266,
Cyclohexane = 267,
Concrete = 268,
Diethyl_Ether = 269,
Ethane = 270,
Ethanol = 271,
Ethylene = 272,
Eye_lens = 273,
Fe2O3 = 274,
FeO = 275,
Freon12 = 276,
Freon12B2 = 277,
Freon13 = 278,
Freon13B1 = 279,
Freon13I1 = 280,
Gd2O2S = 281,
GaAs = 282,
Gel_Photo_Emulsion = 283,
Glass_Pyrex = 284,
Glass_Lead = 285,
Glucose = 286,
Glutamine = 287,
Glycerol = 288,
Guanine = 289,
Gypsum = 290,
nHeptane = 291,
nHexane = 292,
KI = 293,
K2O = 294,
LaBr3 = 295,
LaOBr = 296,
La2O2S = 297,
Lung = 298,
MgCO3 = 299,
MgF2 = 300,
MgO = 301,
MS20_Tissue = 302,
Muscle_skeletal = 303,
Muscle_strained = 304,
Muscle_sucrose = 305,
Muscle_no_sucrose = 306,
Na2CO3 = 307,
NaI = 308,
NaCl = 309,
Na2O = 310,
NaNO3 = 311,
Naphthalene = 312,
Nitrobenzene = 313,
N2O = 314,
Octane = 315,
Paraffin = 316,
nPentane = 317,
PhotoEmulsion = 318,
PuO2 = 319,
Polyacrylonitrile = 320,
Polycarbonate = 321,
PMMA = 322,
POM = 323,
Polypropylene = 324,
Polystyrene = 325,
Propane = 326,
nPropanol = 327,
PVC = 328,
Pyridine = 329,
SiO2 = 330,
Skin = 331,
Sucrose = 332,
Teflon = 333,
TlCl = 334,
Toluene = 335,
Trichloroethylene = 336,
WF6 = 337,
UC2 = 338,
UC = 339,
UO2 = 340,
Urea = 341,
Valine = 342
```

View File

@ -29,13 +29,13 @@ extensions = [
'breathe'
]
breathe_projects = {'nurex':'build/doxygenxml/'}
breathe_projects = {'catima':'build/doxygenxml/'}
breathe_default_project = 'catima'
breathe_domain_by_extenstion = {'h':'cpp'}
primary_domain = 'cpp'
highlight_language = 'cpp'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
#templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
@ -53,4 +53,4 @@ html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = ['_static']

View File

@ -17,6 +17,24 @@ Content
README
.. toctree::
:maxdepth: 1
:caption: Manual
catima_manual
.. toctree::
:maxdepth: 1
:caption: Console App
catima_calculator
.. toctree::
:maxdepth: 1
:caption: API Reference
api
Indices and tables
==================

View File

@ -38,9 +38,15 @@ namespace catima{
double Z=0;
double Q=0;
double T=0;
Projectile& operator()(double e){T=e;return *this;}
Projectile(){}
/// constructor
/// @param a - mass
/// @param z - proton number
/// @param q - charge state
/// @param t - energy in MeV/u
Projectile(double a, double z, double q=0, double t=0):A(a),Z(z),Q(q),T(t){if(q==0)Q=Z;}
Projectile& operator()(double e){T=e;return *this;}
Projectile() = default;
};
bool operator==(const Projectile &a, const Projectile&b);
@ -85,10 +91,10 @@ namespace catima{
* constructor to add 1 or multiple element into the Material
* \code{.cpp}
* Maetrial water({
{1,1,2},
{16,8,1},
1.0, // optional density
});
* {1,1,2},
* {16,8,1},
* 1.0, // optional density
* });
* \endcode
*/
Material(std::initializer_list<std::array<double,3>>list,double _density=0.0, double ipot = 0.0, double mass=0.0);