Mantid
Loading...
Searching...
No Matches
PeakParameterHelper.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2021 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
12#include "MantidAlgorithms/DllConfig.h"
13#include "MantidHistogramData/Histogram.h"
14
15#include <algorithm>
16#include <utility>
17
18namespace Mantid {
19namespace Algorithms {
20
21namespace PeakParameterHelper {
24
25template <typename vector_like>
26MANTID_ALGORITHMS_DLL size_t findXIndex(const vector_like &vecx, const double x, const size_t startindex = 0);
27
29MANTID_ALGORITHMS_DLL int observePeakCenter(const HistogramData::Histogram &histogram,
30 const API::FunctionValues &bkgd_values, size_t start_index,
31 size_t stop_index, double &peak_center, size_t &peak_center_index,
32 double &peak_height);
33
35MANTID_ALGORITHMS_DLL double observePeakFwhm(const HistogramData::Histogram &histogram,
36 const API::FunctionValues &bkgd_values, size_t ipeak, size_t istart,
37 size_t istop, const EstimatePeakWidth peakWidthEstimateApproach,
38 const double peakWidthPercentage);
39
41MANTID_ALGORITHMS_DLL int
42estimatePeakParameters(const HistogramData::Histogram &histogram, const std::pair<size_t, size_t> &peak_window,
43 const API::IPeakFunction_sptr &peakfunction, const API::IBackgroundFunction_sptr &bkgdfunction,
44 bool observe_peak_width, const EstimatePeakWidth peakWidthEstimateApproach,
45 const double peakWidthPercentage, const double minPeakHeight);
46} // namespace PeakParameterHelper
47
48} // namespace Algorithms
49} // namespace Mantid
A class to store values calculated by a function.
std::shared_ptr< IBackgroundFunction > IBackgroundFunction_sptr
std::shared_ptr< IPeakFunction > IPeakFunction_sptr
MANTID_ALGORITHMS_DLL double observePeakFwhm(const HistogramData::Histogram &histogram, const API::FunctionValues &bkgd_values, size_t ipeak, size_t istart, size_t istop, const EstimatePeakWidth peakWidthEstimateApproach, const double peakWidthPercentage)
Observe peak width.
MANTID_ALGORITHMS_DLL int observePeakCenter(const HistogramData::Histogram &histogram, const API::FunctionValues &bkgd_values, size_t start_index, size_t stop_index, double &peak_center, size_t &peak_center_index, double &peak_height)
observe peak center
MANTID_ALGORITHMS_DLL size_t findXIndex(const vector_like &vecx, const double x, const size_t startindex=0)
Get an index of a value in a sorted vector.
MANTID_ALGORITHMS_DLL int estimatePeakParameters(const HistogramData::Histogram &histogram, const std::pair< size_t, size_t > &peak_window, const API::IPeakFunction_sptr &peakfunction, const API::IBackgroundFunction_sptr &bkgdfunction, bool observe_peak_width, const EstimatePeakWidth peakWidthEstimateApproach, const double peakWidthPercentage, const double minPeakHeight)
Estimate peak parameters by 'observation'.
Helper class which provides the Collimation Length for SANS instruments.