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 size_t getNumberDomains() const override;
27 void setAttribute(const std::string &name, const Attribute &) override;
28 std::vector<API::IFunction_sptr> createEquivalentFunctions() const override;
29 void buildTargetFunction() const override;
31 HeatCapacity = 1,
32 Susceptibility = 2,
33 Magnetisation = 3,
34 MagneticMoment = 4
35 };
36
37protected:
38 void updateTargetFunction() const override;
39
40private:
42 API::IFunction_sptr buildSpectrum(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
43 double temperature, double fwhm, size_t i) const;
44 API::IFunction_sptr buildPhysprop(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
45 const ComplexFortranMatrix &ham, double temperature, size_t iSpec) const;
47 void updateSpectrum(API::IFunction &spectrum, int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf,
48 const ComplexFortranMatrix &ham, double temperature, double fwhm, size_t i) const;
50 void calcExcitations(int nre, const DoubleFortranVector &en, const ComplexFortranMatrix &wf, double temperature,
51 API::FunctionValues &values, size_t iSpec) const;
53 mutable std::vector<size_t> m_nPeaks;
55 mutable std::vector<int> m_physprops;
57 mutable std::vector<std::vector<double>> m_fwhmX;
58 mutable std::vector<std::vector<double>> m_fwhmY;
60 mutable std::vector<double> m_temperatures;
62 mutable std::vector<double> m_FWHMs;
63};
64
65} // namespace Functions
66} // namespace CurveFitting
67} // namespace Mantid
std::string name
Definition Run.cpp:60
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:285
This is an interface to a fitting function - a semi-abstarct class.
Definition IFunction.h:166
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.
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:743
Helper class which provides the Collimation Length for SANS instruments.