Mantid
Loading...
Searching...
No Matches
CrystalFieldMultiSpectrum.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
8
11#include "MantidCurveFitting/DllConfig.h"
13
14namespace Mantid {
15namespace CurveFitting {
16namespace Functions {
20class MANTID_CURVEFITTING_DLL CrystalFieldMultiSpectrum : public API::FunctionGenerator {
21public:
23
24 void init() override;
25 std::string name() const override { return "CrystalFieldMultiSpectrum"; }
26 const std::string category() const override { return "General"; }
27 size_t getNumberDomains() const override;
28 void setAttribute(const std::string &name, const Attribute &) override;
29 std::vector<API::IFunction_sptr> createEquivalentFunctions() const override;
30 void buildTargetFunction() const override;
32 HeatCapacity = 1,
33 Susceptibility = 2,
34 Magnetisation = 3,
35 MagneticMoment = 4
36 };
37
38protected:
39 void updateTargetFunction() const override;
40
41private:
43 API::IFunction_sptr buildSpectrum(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
44 double temperature, double fwhm, size_t i) const;
45 API::IFunction_sptr buildPhysprop(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
46 const ComplexFortranMatrix &ham, double temperature, size_t iSpec) const;
48 void updateSpectrum(API::IFunction &spectrum, int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
49 const ComplexFortranMatrix &ham, double temperature, double fwhm, size_t i) const;
51 void calcExcitations(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf, double temperature,
52 API::FunctionValues &values, size_t iSpec) const;
54 mutable std::vector<size_t> m_nPeaks;
56 mutable std::vector<int> m_physprops;
58 mutable std::vector<std::vector<double>> m_fwhmX;
59 mutable std::vector<std::vector<double>> m_fwhmY;
61 mutable std::vector<double> m_temperatures;
63 mutable std::vector<double> m_FWHMs;
64};
65
66} // namespace Functions
67} // namespace CurveFitting
68} // namespace Mantid
FunctionGenerator is a partial implementation of IFunction that defines a function consisting of two ...
A class to store values calculated by a function.
Attribute is a non-fitting parameter.
Definition: IFunction.h:282
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
std::vector< std::vector< double > > m_fwhmX
Caches of the width functions.
std::vector< size_t > m_nPeaks
Cache number of fitted peaks.
std::vector< double > m_temperatures
Cache the temperatures.
std::vector< double > m_FWHMs
Cache the default peak FWHMs.
const std::string category() const override
The categories the Fit function belong to.
std::string name() const override
Returns the function's name.
std::vector< int > m_physprops
Cache the list of "spectra" corresponding to physical properties.
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
Helper class which provides the Collimation Length for SANS instruments.