17using namespace CurveFitting;
19using namespace Kernel;
26 declareParameter(
"RepolarisingAsymmetry", 0.2,
"coefficient for the repolarising asymmetry");
27 declareParameter(
"DecouplingField", 500.0,
"coefficient for magnetic field rescaling");
28 declareParameter(
"BackgroundAsymmetry", 0.0,
"coefficient for the background asymmetry");
32 const double RepolAS =
getParameter(
"RepolarisingAsymmetry");
33 const double DecoupField =
getParameter(
"DecouplingField");
36 for (
size_t i = 0; i < nData; i++) {
37 out[i] = RepolAS * (0.5 + pow(xValues[i] / DecoupField, 2)) / (1 + pow(xValues[i] / DecoupField, 2)) + BG;
42 const double RepolAS =
getParameter(
"RepolarisingAsymmetry");
43 const double DecoupField =
getParameter(
"DecouplingField");
44 const double DecoupFieldSq = pow(DecoupField, 2);
46 for (
size_t i = 0; i < nData; i++) {
47 double diffRepolAS = (0.5 * DecoupFieldSq + pow(xValues[i], 2)) / (DecoupFieldSq + pow(xValues[i], 2));
48 double diffDecoupField =
49 -(RepolAS * DecoupField * pow(xValues[i], 2)) / pow((DecoupFieldSq + pow(xValues[i], 2)), 2);
50 out->
set(i, 0, diffRepolAS);
51 out->
set(i, 1, diffDecoupField);
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
Represents the Jacobian in IFitFunction::functionDeriv.
virtual void set(size_t iY, size_t iP, double value)=0
Set a value to a Jacobian matrix element.
double getParameter(size_t i) const override
Get i-th parameter.
Provide Muonium-style decoupling curve function interface to IFunction.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to active parameters.
void function1D(double *out, const double *xValues, const size_t nData) const override
Function you want to fit to.