Mantid
Loading...
Searching...
No Matches
PawleyFit.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 "MantidAPI/TableRow.h"
13#include "MantidKernel/System.h"
14#include "MantidKernel/Unit.h"
15
16namespace Mantid {
17namespace CurveFitting {
18namespace Algorithms {
19
27struct MANTID_CURVEFITTING_DLL V3DFromHKLColumnExtractor {
28 Kernel::V3D operator()(const API::Column_const_sptr &hklColumn, size_t i) const;
29
30protected:
31 Kernel::V3D getHKLFromV3DColumn(const API::Column_const_sptr &hklColumn, size_t i) const;
32 Kernel::V3D getHKLFromStringColumn(const API::Column_const_sptr &hklColumn, size_t i) const;
33
34 Kernel::V3D getHKLFromString(const std::string &hklString) const;
35};
36
49class MANTID_CURVEFITTING_DLL PawleyFit : public API::Algorithm {
50public:
51 PawleyFit();
52 virtual ~PawleyFit() = default;
53 const std::string name() const override { return "PawleyFit"; }
54 int version() const override { return 1; }
55 const std::vector<std::string> seeAlso() const override { return {"PoldiPeakSearch"}; }
56 const std::string summary() const override;
57 const std::string category() const override { return "Diffraction\\Fitting"; }
58
59protected:
60 double getTransformedCenter(double d, const Kernel::Unit_sptr &unit) const;
61
62 void addHKLsToFunction(Functions::PawleyFunction_sptr &pawleyFn, const API::ITableWorkspace_sptr &tableWs,
63 const Kernel::Unit_sptr &unit, double startX, double endX) const;
64
65 API::ITableWorkspace_sptr getLatticeFromFunction(const Functions::PawleyFunction_sptr &pawleyFn) const;
66 API::ITableWorkspace_sptr getPeakParametersFromFunction(const Functions::PawleyFunction_sptr &pawleyFn) const;
67
68 API::IFunction_sptr getCompositeFunction(const Functions::PawleyFunction_sptr &pawleyFn) const;
69
70 void init() override;
71 void exec() override;
72
74};
75
76} // namespace Algorithms
77} // namespace CurveFitting
78} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This algorithm uses the Pawley-method to refine lattice parameters using a powder diffractogram and a...
Definition: PawleyFit.h:49
const std::string category() const override
function to return a category of the algorithm.
Definition: PawleyFit.h:57
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
Definition: PawleyFit.h:53
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: PawleyFit.h:55
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
Definition: PawleyFit.h:54
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
std::shared_ptr< const Column > Column_const_sptr
Definition: Column.h:229
std::shared_ptr< PawleyFunction > PawleyFunction_sptr
std::shared_ptr< Unit > Unit_sptr
Shared pointer to the Unit base class.
Definition: Unit.h:229
Helper class which provides the Collimation Length for SANS instruments.
Small helper class to extract HKLs as V3D from table columns.
Definition: PawleyFit.h:27