STIR 6.4.0
ScatterSimulation.inl
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2004 - 2012, Hammersmith Imanet Ltd
5 This file is part of STIR.
6
7 SPDX-License-Identifier: Apache-2.0
8
9 See STIR/LICENSE.txt for details
10*/
24#include "stir/is_null_ptr.h"
25#include "stir/info.h"
26#include "stir/error.h"
27
28START_NAMESPACE_STIR
29
30/**************** Functions to set images ****************/
31
32float
33ScatterSimulation::dif_Compton_cross_section(const float cos_theta, float energy)
34{
35 const double Re = 2.818E-13; // aktina peristrofis electroniou gia to atomo tou H
36 const double sin_theta_2 = 1 - cos_theta * cos_theta;
37 const double P = 1.0 / (1.0 + (energy / 511.0) * (1.0 - cos_theta));
38 return static_cast<float>((Re * Re / 2) * P * (1 - P * sin_theta_2 + P * P));
39}
40
41float
42ScatterSimulation::photon_energy_after_Compton_scatter(const float cos_theta, const float energy)
43{
44 return static_cast<float>(energy / (1 + (energy / 511.0f) * (1 - cos_theta))); // For an arbitrary energy
45}
46
47float
48ScatterSimulation::photon_energy_after_Compton_scatter_511keV(const float cos_theta)
49{
50 return 511.f / (2.f - cos_theta); // for a given energy, energy := 511 keV
51}
52
53float
54ScatterSimulation::total_Compton_cross_section(const float energy)
55{
56 const double a = energy / 511.0;
57 const double l = log(1.0 + 2.0 * a);
58 const double sigma0 = 6.65E-25; // sigma0=8*pi*a*a/(3*m*m)
59 return static_cast<float>(
60 0.75 * sigma0
61 * ((1.0 + a) / (a * a) * (2.0 * (1.0 + a) / (1.0 + 2.0 * a) - l / a) + l / (2.0 * a)
62 - (1.0 + 3.0 * a) / (1.0 + 2.0 * a) / (1.0 + 2.0 * a))); // Klein - Nishina formula = sigma / sigma0
63}
64
65float
66ScatterSimulation::total_Compton_cross_section_relative_to_511keV(const float energy)
67{
68 const double a = energy / 511.0;
69 static const double prefactor
70 = 9.0 / (-40 + 27 * log(3.)); // Klein-Nishina formula for a=1 & devided with 0.75 == (40 - 27*log(3)) / 9
71
72 return // checked this in Mathematica
73 static_cast<float>(
74 prefactor
75 * (((-4 - a * (16 + a * (18 + 2 * a))) / square(1 + 2 * a) + ((2 + (2 - a) * a) * log(1 + 2 * a)) / a) / square(a)));
76}
77
78END_NAMESPACE_STIR
Declaration of class stir::ProjDataInMemory.
Declaration of class stir::ProjDataInterfile.
Declaration of stir::error()
NUMBER square(const NUMBER &x)
returns the square of a number, templated.
Definition common.h:154
Declaration of stir::info()
Definition of stir::is_null_ptr functions.
Declaration of stir::read_from_file functions (providing easy access to class stir::InputFileFormatRe...