Ticket #4958: Muon_StaticKuboToyabe.cpp

File Muon_StaticKuboToyabe.cpp, 1.1 KB (added by Karl Palmen, 9 years ago)
Line 
1//----------------------------------------------------------------------
2// Includes
3//----------------------------------------------------------------------
4#include "Muon_StaticKuboToyabe.h"
5#include <cmath>
6
7namespace Mantid
8{
9namespace CurveFitting
10{
11
12using namespace Kernel;
13using namespace API;
14
15DECLARE_FUNCTION(Muon_StaticKuboToyabe)
16
17void Muon_StaticKuboToyabe::init()
18{
19  declareParameter("A", 0.2);
20  declareParameter("Delta", 0.2);
21}
22
23
24void Muon_StaticKuboToyabe::functionLocal(double* out, const double* xValues, const int& nData)const
25{
26    const double& A = getParameter("A");
27    const double& G = getParameter("Delta");
28 
29 
30   for (int i = 0; i < nData; i++) {
31       // double diff=xValues[i]-peakCentre;
32           // double e=pow(gs*xValues[i],2.0);
33        out[i] = A*(exp(-pow(G*xValues[i],2)/2)*(1-pow(G*xValues[i],2))*2./3.+1./3.);
34    }
35}
36void Muon_StaticKuboToyabe::functionDerivLocal(API::Jacobian* out, const double* xValues, const int& nData)
37{
38  calNumericalDeriv(out, xValues, nData);
39}
40
41
42
43
44} // namespace CurveFitting
45} // namespace Mantid