-
Notifications
You must be signed in to change notification settings - Fork 124
/
CylinderAbsorption.h
122 lines (104 loc) · 4.95 KB
/
CylinderAbsorption.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef MANTID_ALGORITHMS_CYLINDERABSORPTION_H_
#define MANTID_ALGORITHMS_CYLINDERABSORPTION_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/AbsorptionCorrection.h"
namespace Mantid {
namespace Algorithms {
/** Calculates attenuation due to absorption and scattering in a cylindrical
sample.
Properties:
<UL>
<LI> InputWorkspace - The name of the input workspace. </LI>
<LI> OutputWorkspace - The name of the output workspace. Can be the same as
the input one. </LI>
<LI> AttenuationXSection - The attenuation cross-section for the sample
material in barns. </LI>
<LI> ScatteringXSection - The scattering cross-section for the sample
material in barns. </LI>
<LI> SampleNumberDensity - The number density of the sample in
Angstrom^-3.</LI>
<LI> NumberOfWavelengthPoints - The number of wavelength points for which
numerical integral is calculated (default: all points). </LI>
<LI> ExpMethod - The method to calculate exponential function (Normal of
Fast approximation). </LI>
<LI> Emode - The energy mode (0=elastic, 1=direct geometry, 2=indirect
geometry) </LI>
<LI> Efixed - Value of fixed energy: EI (emode=1) or EF (emode=2) (meV)
</LI>
<LI> CylinderSampleHeight - The height of the cylindrical sample in
centimetres. </LI>
<LI> CylinderSampleRadius - The radius of the cylindrical sample in
centimetres. </LI>
<LI> NumberOfSlices - The number of slices into which the cylinder is
divided for the calculation. </LI>
<LI> NumberOfAnnuli - The number of annuli into which each slice is divided
for the calculation. </LI>
</UL>
This algorithm uses numerical integration method to calculate attenuation
factors
resulting from absorption and single scattering in a cylindrical sample with
the dimensions and material
properties given. Factors are calculated for each spectrum (i.e. detector
position) and wavelength point,
as defined by the input workspace. The sample is divided up into a stack of
slices, which are then divided
into annuli (rings). These annuli are further divided to give the full set
of elements for which a calculation
will be carried out. Thus the calculation speed depends linearly on the
total number of bins in the workspace
and on the number of slices. The dependence on the number of annuli is
stronger, going as 3n(n + 1).
Path lengths through the sample are then calculated for the centre-point of
each element and a numerical
integration is carried out using these path lengths over the volume
elements.
This algorithm assumes that Y (the sample cylinder axis) is up.
@author Russell Taylor, Tessella Support Services plc
@date 02/12/2008
Copyright © 2008-2010 ISIS Rutherford Appleton Laboratory, NScD Oak
Ridge National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport CylinderAbsorption : public AbsorptionCorrection {
public:
/// Default constructor
CylinderAbsorption();
/// Algorithm's name
const std::string name() const override { return "CylinderAbsorption"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Calculates bin-by-bin correction factors for attenuation due to "
"absorption and single scattering in a 'cylindrical' sample.";
}
/// Algorithm's version
int version() const override { return (1); }
private:
void defineProperties() override;
void retrieveProperties() override;
std::string sampleXML() override;
void initialiseCachedDistances() override;
double m_cylHeight; ///< The height of the cylindrical sample in m
double m_cylRadius; ///< The radius of the cylindrical sample in m
int m_numSlices; ///< The number of slices
double m_sliceThickness; ///< The slice thickness
int m_numAnnuli; ///< The number of annuli
double m_deltaR; ///< radius of the cylindrical sample in m / The number of
/// annuli
};
} // namespace Algorithms
} // namespace Mantid
#endif /* MANTID_ALGORITHMS_CYLINDERABSORPTION_H_*/