MultipleScatteringAbsorption.h 3.82 KB
Newer Older
1
2
3
4
5
6
7
8
#ifndef MANTID_ALGORITHM_MULTIPLE_SCATTERING_ABSORPTION_H_
#define MANTID_ALGORITHM_MULTIPLE_SCATTERING_ABSORPTION_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/MatrixWorkspace.h"
9
#include <vector>
10
11
12
13
14
15
16
17
18
19
20
21
22

namespace Mantid
{
namespace Algorithms
{
/** Multiple scattering absorption correction, originally used to 
    correct vanadium spectrum at IPNS.  Algorithm originally worked
    out by Jack Carpenter and Asfia Huq and implmented in Java by
    Alok Chatterjee.  Translated to C++ by Dennis Mikkelson.

    @author Dennis Mikkelson 
    @date 17/08/2010

23
24
    Copyright &copy; 2010 ISIS Rutherford Appleton Laboratory & 
    NScD Oak Ridge National Laboratory
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

    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/>.

41
42
    File change history is stored at:
                  <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>
43
44
45
46
47
48
49
50
51
52
53
54
55
    Code Documentation is available at: <http://doxygen.mantidproject.org>
 */
class DLLExport MultipleScatteringAbsorption : public API::Algorithm
{
public:

  /// Default constructor
  MultipleScatteringAbsorption() : API::Algorithm() {};

  /// Destructor
  virtual ~MultipleScatteringAbsorption() {};

  /// Algorithm's name for identification overriding a virtual method
56
  virtual const std::string name() const { return "MultipleScatteringCylinderAbsorption";}
57
58
59
60
61

  /// Algorithm's version for identification overriding a virtual method
  virtual int version() const { return 1;}

  /// Algorithm's category for identification overriding a virtual method
62
  virtual const std::string category() const { return "Absorption Corrections";}
63
64
65
66
67
68
69
70

private:

  // Overridden Algorithm methods
  void init();
  void exec();

  // Attenuation Factor
71
  double AttFac(const double sigir, const double sigsr, const std::vector<double>& Z);
72
73

  // Set up "Z" array for specified angle
74
  void ZSet(const double angle_deg, std::vector<double>& Z);
75
76
77
78
79
80
81
82

  // Wavelength function
  double wavelength( double path_length_m, double tof_us );

  /** MultipleScatteringAbsorption correction calculation.  This
   *  method will change the values in the y_val array to correct for
   *  multiple scattering absorption.
   *
83
84
85
86
87
88
89
   *  @param total_path ::  The total flight path in meters
   *  @param angle_deg ::   The scattering angle (two theta) in degrees
   *  @param radius ::      The sample rod radius in cm
   *  @param coeff1 ::      The absorption cross section / 1.81
   *  @param coeff2 ::      The density
   *  @param coeff3 ::      The total scattering cross section
   *  @param tof ::         Array of times-of-flight at bin boundaries
90
   *                     (or bin centers) for the spectrum, in microseconds
91
   *  @param y_val ::       The spectrum values
92
93
94
95
96
   */
  void apply_msa_correction( double total_path,
                             double angle_deg,
                             double radius,
                             double coeff1, double coeff2, double coeff3,
97
98
                             std::vector<double>& tof,
                             std::vector<double>& y_val);
99
100
101
102
103
104
};

} // namespace Algorithm
} // namespace Mantid

#endif /*MANTID_ALGORITHM_MULTIPLE_SCATTERING_ABSORPTION_H_*/