-
Notifications
You must be signed in to change notification settings - Fork 122
/
EQSANSResolution.cpp
32 lines (28 loc) · 1.1 KB
/
EQSANSResolution.cpp
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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/EQSANSResolution.h"
#include <cmath>
namespace Mantid {
namespace Algorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(EQSANSResolution)
/*
* Double Boltzmann fit to the TOF resolution as a function of wavelength
*/
double EQSANSResolution::getTOFResolution(double wl) {
if (wl > 2.0) {
return 0.0148 * wl * wl * wl - 0.5233 * wl * wl + 6.4797 * wl + 231.99;
} else {
return 392.31 * pow(wl, 6) - 3169.3 * pow(wl, 5) + 10445 * pow(wl, 4) - 17872 * wl * wl * wl + 16509 * wl * wl -
7448.4 * wl + 1280.5;
}
}
} // namespace Algorithms
} // namespace Mantid