Mantid
Loading...
Searching...
No Matches
Meier.h
Go to the documentation of this file.
1// Mantid Repository : https: // github.com/mantidproject/mantid
2//
3// Copyright © 2022 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin &CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier : GPL - 3.0 +
7#pragma once
10#include "MantidCurveFitting/DllConfig.h"
11#include <valarray>
12
13namespace Mantid {
14namespace CurveFitting {
15namespace Functions {
16
34class MANTID_CURVEFITTING_DLL Meier : public API::ParamFunction, public API::IFunction1D {
35public:
36 std::string name() const override { return "Meier"; }
37 const std::string category() const override { return "Muon\\MuonSpecific"; }
38 void function1D(double *out, const double *xValues, const size_t nData) const override;
39 void init() override;
40
41private:
42 // Precomputes intermediate terms used to calculate the polrization in the x and z directions
43 void precomputeIntermediateSteps(std::valarray<double> &cos2AlphaSquared, std::valarray<double> &negativeLambda,
44 std::valarray<double> &positiveLambda, const double &J2) const;
45
46 // Calculates and returns the value of cost 2*alpha sequared
47 double getCos2AlphaSquared(const double &q1, const double &qq) const;
48
49 // Calculates and returns the value of q1
50 double getQ1(const double &m, const double &OmegaQ, const double &OmegaD) const;
51
52 // Calculates and returns the value of q2
53 double getQ2(const double &m, const double &J, const double &OmegaD) const;
54
55 // Calculates and returns the value of q3
56 double getQ3(const double &J, const double &OmegaQ, const double &OmegaD) const;
57
58 // Calculates and returns the value of qq
59 double getQQ(const double &q1, const double &q2) const;
60
61 // Calculates and returns the value of positive lambda
62 double getPositiveLambda(const double &q3, const double &Wm) const;
63
64 // Calculates and returns the value of negative lambda
65 double getNegativeLambda(const double &q3, const double &Wm) const;
66
67 // Calculates and returns the value of lambda for the special cases
68 double getBaseLambda(const double &OmegaQ, const double &OmegaD, const double &J) const;
69
70 // Calculates the polarization in the x direction
71 void calculatePx(std::valarray<double> &Px, const std::valarray<double> &xValues,
72 const std::valarray<double> &cos2AlphaSquared, const std::valarray<double> &negativeLambda,
73 const std::valarray<double> &positiveLambda, const double &J2) const;
74
75 // Calculates the polarization in the z direction
76 void calculatePz(std::valarray<double> &Pz, const std::valarray<double> &xValues,
77 const std::valarray<double> &cos2AlphaSquared, const std::valarray<double> &negativeLambda,
78 const std::valarray<double> &positiveLambda, const double &J2) const;
79};
80} // namespace Functions
81} // namespace CurveFitting
82} // namespace Mantid
This is a specialization of IFunction for functions of one real argument.
Definition IFunction1D.h:43
Implements the part of IFunction interface dealing with parameters.
Time dependence of the polarization function for a static muon interacting with nuclear spin.
Definition Meier.h:34
std::string name() const override
Returns the function's name.
Definition Meier.h:36
const std::string category() const override
The categories the Fit function belong to.
Definition Meier.h:37
Helper class which provides the Collimation Length for SANS instruments.