Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Algorithms::FitPeaks Class Referencefinal

#include <FitPeaks.h>

Inheritance diagram for Mantid::Algorithms::FitPeaks:
Mantid::API::Algorithm Mantid::API::IAlgorithm Mantid::Kernel::IPropertyManager

Public Member Functions

const std::string category () const override
 Algorithm's category for identification.
 
 FitPeaks ()
 
const std::string name () const override
 Algorithm's name.
 
const std::string summary () const override
 Summary of algorithms purpose.
 
std::map< std::string, std::string > validateInputs () override
 Validate inputs.
 
int version () const override
 Algorithm's version.
 
- Public Member Functions inherited from Mantid::API::Algorithm
 Algorithm ()
 Constructor.
 
 Algorithm (const Algorithm &)=delete
 
Algorithmoperator= (const Algorithm &)=delete
 
 ~Algorithm () override
 Virtual destructor.
 
void initialize () override
 Initialization method invoked by the framework.
 
bool execute () override final
 The actions to be performed by the algorithm on a dataset.
 
void addTimer (const std::string &name, const Kernel::time_point_ns &begin, const Kernel::time_point_ns &end)
 
void executeAsChildAlg () override
 Execute as a Child Algorithm.
 
std::map< std::string, std::string > validateInputs () override
 Perform validation of ALL the input properties of the algorithm.
 
ExecutionState executionState () const override
 Gets the current execution state.
 
ResultState resultState () const override
 Gets the current result State.
 
bool isInitialized () const override
 Has the Algorithm already been initialized.
 
bool isExecuted () const override
 Has the Algorithm already been executed successfully.
 
bool isRunning () const override
 True if the algorithm is running.
 
bool isReadyForGarbageCollection () const override
 True if the algorithm is ready for garbage collection.
 
bool isChild () const override
 To query whether algorithm is a child.
 
void setChild (const bool isChild) override
 To set whether algorithm is a child.
 
void enableHistoryRecordingForChild (const bool on) override
 Change the state of the history recording flag.
 
bool isRecordingHistoryForChild ()
 
void setAlwaysStoreInADS (const bool doStore) override
 Do we ALWAYS store in the AnalysisDataService? This is set to true for python algorithms' child algorithms.
 
bool getAlwaysStoreInADS () const override
 Returns true if we always store in the AnalysisDataService.
 
void setRethrows (const bool rethrow) override
 Set whether the algorithm will rethrow exceptions.
 
Poco::ActiveResult< bool > executeAsync () override
 Asynchronous execution.
 
void addObserver (const Poco::AbstractObserver &observer) const override
 Add an observer for a notification.
 
void removeObserver (const Poco::AbstractObserver &observer) const override
 Remove an observer.
 
void cancel () override
 Raises the cancel flag.
 
bool getCancel () const
 Returns the cancellation state.
 
Kernel::LoggergetLogger () const
 Returns a reference to the logger.
 
void setLogging (const bool value) override
 Logging can be disabled by passing a value of false.
 
bool isLogging () const override
 returns the status of logging, True = enabled
 
void setLoggingOffset (const int value) override
 gets the logging priority offset
 
int getLoggingOffset () const override
 returns the logging priority offset
 
void setAlgStartupLogging (const bool enabled) override
 disable Logging of start and end messages
 
bool getAlgStartupLogging () const override
 get the state of Logging of start and end messages
 
void setChildStartProgress (const double startProgress) const override
 setting the child start progress
 
void setChildEndProgress (const double endProgress) const override
 setting the child end progress
 
std::string toString () const override
 Serialize an object to a string.
 
::Json::Value toJson () const override
 Serialize an object to a json object.
 
virtual std::shared_ptr< AlgorithmcreateChildAlgorithm (const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
 Create a Child Algorithm.
 
void setupAsChildAlgorithm (const Algorithm_sptr &algorithm, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true)
 Setup algorithm as child algorithm.
 
void trackAlgorithmHistory (std::shared_ptr< AlgorithmHistory > parentHist)
 set whether we wish to track the child algorithm's history and pass it the parent object to fill.
 
void findWorkspaces (WorkspaceVector &workspaces, unsigned int direction, bool checkADS=false) const
 Populate lists of the workspace properties for a given direction (InOut workspaces are included in both input/output)
 
virtual bool checkGroups ()
 Check the input workspace properties for groups.
 
virtual bool processGroups ()
 Process WorkspaceGroup inputs.
 
void copyNonWorkspaceProperties (IAlgorithm *alg, int periodNum)
 Copy all the non-workspace properties from this to alg.
 
void declareProperty (std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
 Add a property to the list of managed properties.
 
void declareOrReplaceProperty (std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
 Add or replace property in the list of managed properties.
 
void resetProperties () override
 Reset property values back to initial values (blank or default values)
 
void setProperties (const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override
 Set the ordered list of properties by one string of values, separated by semicolons.
 
void setProperties (const ::Json::Value &jsonValue, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override
 Sets all the declared properties from a json object.
 
void setPropertiesWithString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >()) override
 Sets all the declared properties from a string.
 
void setPropertyValue (const std::string &name, const std::string &value) override
 Set the value of a property by string N.B.
 
void setPropertyValueFromJson (const std::string &name, const Json::Value &value) override
 Set the value of a property by Json::Value object.
 
void setPropertyOrdinal (const int &index, const std::string &value) override
 Set the value of a property by an index N.B.
 
virtual void copyPropertiesFrom (const Algorithm &alg)
 Make m_properties point to the same PropertyManager as alg.m_properties.
 
bool existsProperty (const std::string &name) const override
 Checks whether the named property is already in the list of managed property.
 
bool validateProperties () const override
 Validates all the properties in the collection.
 
size_t propertyCount () const override
 Count the number of properties under management.
 
std::string getPropertyValue (const std::string &name) const override
 Get the value of a property as a string.
 
const std::vector< Kernel::Property * > & getProperties () const override
 Get the list of managed properties.
 
std::vector< std::string > getDeclaredPropertyNames () const noexcept override
 Return the list of declared property names.
 
TypedValue getProperty (const std::string &name) const override
 Get the value of a property.
 
std::string asString (bool withDefaultValues=false) const override
 Return the property manager serialized as a string.
 
::Json::Value asJson (bool withDefaultValues=false) const override
 Return the property manager serialized as a json object.
 
bool isDefault (const std::string &name) const
 
void removeProperty (const std::string &name, const bool delproperty=true) override
 Removes the property from management.
 
std::unique_ptr< Kernel::PropertytakeProperty (const size_t index) override
 Removes the property from management and returns a pointer to it.
 
void clear () override
 Clears all properties under management.
 
void afterPropertySet (const std::string &) override
 Override this method to perform a custom action right after a property was set.
 
Kernel::PropertygetPointerToProperty (const std::string &name) const override
 Get a property by name.
 
Kernel::PropertygetPointerToPropertyOrdinal (const int &index) const override
 Get a property by an index.
 
virtual void declareProperty (std::unique_ptr< Property > p, const std::string &doc="")=0
 Function to declare properties (i.e. store them)
 
template<typename T >
void declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input)
 Add a property of the template type to the list of managed properties.
 
template<typename T >
void declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input)
 Add a property to the list of managed properties with no validator.
 
template<typename T >
void declareProperty (const std::string &name, T value, const unsigned int direction)
 Add a property of the template type to the list of managed properties.
 
void declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input)
 Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
 
void declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input)
 Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
 
void declareProperty (const std::string &name, const char *value, const unsigned int direction)
 Add a property of string type to the list of managed properties.
 
const std::string category () const override
 function to return a category of the algorithm.
 
const std::vector< std::string > categories () const override
 Function to return all of the categories that contain this algorithm.
 
const std::string categorySeparator () const override
 Function to return the separator token for the category string.
 
const std::vector< std::string > seeAlso () const override
 Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm.A default implementation is provided.
 
const std::string alias () const override
 function to return any aliases to the algorithm; A default implementation is provided
 
const std::string aliasDeprecated () const override
 Expiration date (in ISO8601 format) for the algorithm aliases; default implementation for no expiration date.
 
const std::string helpURL () const override
 function to return URL for algorithm documentation; A default implementation is provided.
 
template<typename T , typename = typename std::enable_if<std::is_convertible<T *, MatrixWorkspace *>::value>::type>
std::tuple< std::shared_ptr< T >, Indexing::SpectrumIndexSet > getWorkspaceAndIndices (const std::string &name) const
 Mechanism for retriving the index property.
 
template<typename T1 , typename T2 , typename = typename std::enable_if<std::is_convertible<T1 *, MatrixWorkspace *>::value>::type, typename = typename std::enable_if<std::is_convertible<T2 *, std::string *>::value || std::is_convertible<T2 *, std::vector<int64_t> *>::value>::type>
void setWorkspaceInputProperties (const std::string &name, const std::shared_ptr< T1 > &wksp, IndexType type, const T2 &list)
 Mechanism for setting the index property with a workspace shared pointer.
 
template<typename T1 , typename T2 , typename = typename std::enable_if<std::is_convertible<T1 *, MatrixWorkspace *>::value>::type, typename = typename std::enable_if<std::is_convertible<T2 *, std::string *>::value || std::is_convertible<T2 *, std::vector<int64_t> *>::value>::type>
void setWorkspaceInputProperties (const std::string &name, const std::string &wsName, IndexType type, const T2 &list)
 Mechanism for setting the index property with a workspace shared pointer.
 
const std::string workspaceMethodName () const override
 
const std::vector< std::string > workspaceMethodOn () const override
 
const std::string workspaceMethodInputProperty () const override
 
AlgorithmID getAlgorithmID () const override
 Algorithm ID.
 
Algorithms As Methods
- Public Member Functions inherited from Mantid::Kernel::IPropertyManager
void declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input)
 Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
 
void declareProperty (const std::string &name, const char *value, const unsigned int direction)
 Add a property of string type to the list of managed properties.
 
void declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input)
 Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string).
 
template<typename T >
void declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input)
 Add a property to the list of managed properties with no validator.
 
template<typename T >
void declareProperty (const std::string &name, T value, const unsigned int direction)
 Add a property of the template type to the list of managed properties.
 
template<typename T >
void declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input)
 Add a property of the template type to the list of managed properties.
 
virtual void filterByProperty (Mantid::Kernel::LogFilter *, const std::vector< std::string > &)
 
std::vector< Property * > getPropertiesInGroup (const std::string &group) const
 Get the list of managed properties in a given group.
 
IPropertyManagersetProperty (const std::string &name, const char *value)
 Specialised version of setProperty template method to handle const char *.
 
IPropertyManagersetProperty (const std::string &name, const std::string &value)
 Specialised version of setProperty template method to handle std::string.
 
template<typename T >
IPropertyManagersetProperty (const std::string &name, const T &value)
 Templated method to set the value of a PropertyWithValue.
 
template<typename T >
IPropertyManagersetProperty (const std::string &name, std::unique_ptr< T > value)
 Templated method to set the value of a PropertyWithValue from a std::unique_ptr.
 
void setPropertyGroup (const std::string &name, const std::string &group)
 Set the group for a given property.
 
void setPropertySettings (const std::string &name, std::unique_ptr< IPropertySettings > settings)
 
void updatePropertyValues (const IPropertyManager &other)
 Update values of the existing properties.
 
virtual ~IPropertyManager ()=default
 

Private Member Functions

void calculateFittedPeaks (const std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > > &fit_results)
 calculate peak+background for fitted
 
double calculateSignalToNoiseRatio (size_t iws, const std::pair< double, double > &range, const API::IBackgroundFunction_sptr &bkgd_function)
 calculate signal-to-noise ratio in histogram range
 
double calculateSignalToSigmaRatio (const size_t &iws, const std::pair< double, double > &peakWindow, const API::IPeakFunction_sptr &peakFunction)
 
void checkPeakIndices (std::size_t const &, std::size_t const &)
 
void checkPeakWindowEdgeOrder (double const &, double const &)
 
void checkWorkspaceIndices (std::size_t const &)
 Get the expected peak's position.
 
void convertParametersNameToIndex ()
 Convert peak function's parameter names to parameter index for fast access.
 
API::MatrixWorkspace_sptr createMatrixWorkspace (const std::vector< double > &vec_x, const std::vector< double > &vec_y, const std::vector< double > &vec_e)
 Create a single spectrum workspace for fitting.
 
bool decideToEstimatePeakParams (const bool firstPeakInSpectrum, const API::IPeakFunction_sptr &peak_function)
 Decide whether to estimate peak parameters.
 
void exec () override
 Main exec method.
 
bool fitBackground (const size_t &ws_index, const std::pair< double, double > &fit_window, const double &expected_peak_pos, const API::IBackgroundFunction_sptr &bkgd_func)
 fit background
 
double fitFunctionHighBackground (const API::IAlgorithm_sptr &fit, const std::pair< double, double > &fit_window, const size_t &ws_index, const double &expected_peak_center, bool observe_peak_shape, const API::IPeakFunction_sptr &peakfunction, const API::IBackgroundFunction_sptr &bkgdfunc)
 fit a single peak with high background
 
double fitFunctionMD (API::IFunction_sptr fit_function, const API::MatrixWorkspace_sptr &dataws, const size_t wsindex, const std::pair< double, double > &vec_xmin, const std::pair< double, double > &vec_xmax)
 
double fitFunctionSD (const API::IAlgorithm_sptr &fit, const API::IPeakFunction_sptr &peak_function, const API::IBackgroundFunction_sptr &bkgd_function, const API::MatrixWorkspace_sptr &dataws, size_t wsindex, const std::pair< double, double > &peak_range, const double &expected_peak_center, bool estimate_peak_width, bool estimate_background)
 Methods to fit functions (general)
 
double fitIndividualPeak (size_t wi, const API::IAlgorithm_sptr &fitter, const double expected_peak_center, const std::pair< double, double > &fitwindow, const bool estimate_peak_width, const API::IPeakFunction_sptr &peakfunction, const API::IBackgroundFunction_sptr &bkgdfunc, const std::shared_ptr< FitPeaksAlgorithm::PeakFitPreCheckResult > &pre_check_result)
 Fit an individual peak.
 
std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > > fitPeaks ()
 suites of method to fit peaks
 
void fitSpectrumPeaks (size_t wi, const std::vector< double > &expected_peak_centers, const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &fit_result, std::vector< std::vector< double > > &lastGoodPeakParameters, const std::shared_ptr< FitPeaksAlgorithm::PeakFitPreCheckResult > &pre_check_result)
 fit peaks in a same spectrum
 
void generateCalculatedPeaksWS ()
 Generate workspace for calculated values.
 
void generateFittedParametersValueWorkspaces ()
 Generate output workspaces.
 
void generateOutputPeakPositionWS ()
 main method to create output workspaces
 
std::string getPeakHeightParameterName (const API::IPeakFunction_const_sptr &peak_function)
 Get the parameter name for peak height (I or height or etc)
 
void getRangeData (size_t iws, const std::pair< double, double > &range, std::vector< double > &vec_x, std::vector< double > &vec_y, std::vector< double > &vec_e)
 get vector X, Y and E in a given range
 
size_t histRangeToDataPointCount (size_t iws, const std::pair< double, double > &range)
 convert a histogram range to index boundaries
 
void histRangeToIndexBounds (size_t iws, const std::pair< double, double > &range, size_t &left_index, size_t &right_index)
 convert a histogram range to index boundaries
 
void init () override
 Init.
 
bool isObservablePeakProfile (const std::string &peakprofile)
 check whether FitPeaks supports observation on a certain peak profile's parameters (width!)
 
void logNoOffset (const size_t &priority, const std::string &msg)
 
double numberCounts (size_t iws)
 sum up all counts in histogram
 
double numberCounts (size_t iws, const std::pair< double, double > &range)
 sum up all counts in histogram range
 
void processInputFitRanges ()
 process inputs for peak fitting range
 
void processInputFunctions ()
 process inputs for peak and background functions
 
void processInputPeakCenters ()
 peak centers
 
void processInputPeakTolerance ()
 process inputs about fitted peak positions' tolerance
 
void processInputs ()
 process inputs (main and child algorithms)
 
void processOutputs (std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > > fit_result_vec)
 Set the workspaces and etc to output properties.
 
bool processSinglePeakFitResult (size_t wsindex, size_t peakindex, const double cost, const std::vector< double > &expected_peak_positions, const FitPeaksAlgorithm::FitFunction &fitfunction, const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &fit_result)
 Process the result from fitting a single peak.
 
void setupParameterTableWorkspace (const API::ITableWorkspace_sptr &table_ws, const std::vector< std::string > &param_names, bool with_chi2)
 Set up parameter table (parameter value or error)
 
void writeFitResult (size_t wi, const std::vector< double > &expected_positions, const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &fit_result)
 Write result of peak fit per spectrum to output analysis workspaces.
 

Private Attributes

API::IBackgroundFunction_sptr m_bkgdFunction
 Background function.
 
bool m_constrainPeaksPosition
 
std::string m_costFunction
 Cost function.
 
API::ITableWorkspace_sptr m_fitErrorTable
 table workspace for fitted parameters' fitting error. This is optional
 
int m_fitIterations
 Fit iterations.
 
bool m_fitPeaksFromRight
 Fit from right or left.
 
API::ITableWorkspace_sptr m_fittedParamTable
 output analysis workspaces table workspace for fitted parameters
 
API::MatrixWorkspace_sptr m_fittedPeakWS
 matrix workspace contained calcalated peaks+background from fitted result it has same number of spectra of input workspace even if only part of spectra to have peaks to fit
 
std::function< std::vector< double >(std::size_t const &)> m_getExpectedPeakPositions
 
std::function< std::pair< double, double >(std::size_t const &, std::size_t const &)> m_getPeakFitWindow
 
bool m_highBackground
 flag for high background
 
std::vector< size_t > m_initParamIndexes
 input starting parameters' indexes in peak function
 
std::vector< double > m_initParamValues
 input peak parameters' starting values corresponding to above peak parameter names
 
DataObjects::EventWorkspace_const_sptr m_inputEventWS
 event workspace for input
 
bool m_inputIsDSpace
 
API::MatrixWorkspace_sptr m_inputMatrixWS
 mandatory input and output workspaces
 
API::IBackgroundFunction_sptr m_linearBackgroundFunction
 Linear background function for high background fitting.
 
std::string m_minimizer
 Minimzer.
 
double m_minPeakHeight
 minimum peak height without background and it also serves as the criteria for observed peak parameter
 
double m_minPeakTotalCount
 
double m_minSignalToNoiseRatio
 
double m_minSignalToSigmaRatio
 
std::size_t m_numPeaksToFit
 the number of peaks to fit in all spectra
 
std::size_t m_numSpectraToFit
 total number of spectra to be fit
 
API::MatrixWorkspace_sptr m_outputPeakPositionWorkspace
 output workspace for peak positions
 
std::vector< double > m_peakCenters
 Designed peak positions and tolerance.
 
API::MatrixWorkspace_const_sptr m_peakCenterWorkspace
 
API::IPeakFunction_sptr m_peakFunction
 Peak profile name.
 
std::vector< std::string > m_peakParamNames
 input peak parameters' names
 
bool m_peakPosTolCase234
 peak positon tolerance case b, c and d
 
std::vector< double > m_peakPosTolerances
 tolerances for fitting peak positions
 
Algorithms::PeakParameterHelper::EstimatePeakWidth m_peakWidthEstimateApproach
 Flag for observing peak width: there are 3 states (1) no estimation (2) from 'observation' (3) calculated from instrument resolution.
 
double m_peakWidthPercentage
 flag to estimate peak width from
 
std::vector< std::vector< double > > m_peakWindowVector
 peak windows
 
API::MatrixWorkspace_const_sptr m_peakWindowWorkspace
 
API::ITableWorkspace_const_sptr m_profileStartingValueTable
 table workspace for profile parameters' starting value
 
bool m_rawPeaksTable
 flag to show that the pamarameters in table are raw parameters or effective parameters
 
std::size_t m_startWorkspaceIndex
 start index
 
std::size_t m_stopWorkspaceIndex
 stop index (workspace index of the last spectrum included)
 
bool m_uniformPeakPositions
 
bool m_uniformProfileStartingValue
 flag for profile startng value being uniform or not
 

Additional Inherited Members

- Public Types inherited from Mantid::API::Algorithm
using WorkspaceVector = std::vector< std::shared_ptr< Workspace > >
 
- Static Public Member Functions inherited from Mantid::API::Algorithm
static IAlgorithm_sptr fromString (const std::string &input)
 De-serialize an object from a string.
 
static IAlgorithm_sptr fromJson (const Json::Value &input)
 De-serialize an object from a Json.
 
static IAlgorithm_sptr fromHistory (const AlgorithmHistory &history)
 Construct an object from a history entry.
 
- Public Attributes inherited from Mantid::API::Algorithm
bool calledByAlias = false
 Flag to indicate if the algorithm is called by its alias.
 
- Protected Member Functions inherited from Mantid::API::Algorithm
virtual const std::string workspaceMethodOnTypes () const
 Returns a semi-colon separated list of workspace types to attach this algorithm.
 
void cacheWorkspaceProperties ()
 Go through the properties and cache the input/output workspace properties for later use.
 
void cacheInputWorkspaceHistories ()
 Cache the histories of any input workspaces so they can be copied over after algorithm completion.
 
void setExecutionState (const ExecutionState state)
 Sets the current execution state.
 
void setResultState (const ResultState state)
 Sets the result execution state.
 
void store ()
 Stores any output workspaces into the AnalysisDataService.
 
void progress (double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
 Sends ProgressNotification.
 
void interruption_point ()
 This is called during long-running operations, and check if the algorithm has requested that it be cancelled.
 
Poco::NotificationCenter & notificationCenter () const
 Return a reference to the algorithm's notification dispatcher.
 
void handleChildProgressNotification (const Poco::AutoPtr< ProgressNotification > &pNf)
 Observation slot for child algorithm progress notification messages, these are scaled and then signalled for this algorithm.
 
const Poco::AbstractObserver & progressObserver () const
 Return a reference to the algorithm's object that is reporting progress.
 
bool isWorkspaceProperty (const Kernel::Property *const prop) const
 checks the property is a workspace property
 
bool trackingHistory ()
 get whether we are tracking the history for this algorithm,
 
virtual void fillHistory ()
 Copy workspace history from input workspaces to output workspaces and record the history for ths algorithm.
 
void fillHistory (const std::vector< Workspace_sptr > &outputWorkspaces)
 Copy workspace history from input workspaces to provided vector of output workspaces.
 
virtual void setOtherProperties (IAlgorithm *alg, const std::string &propertyName, const std::string &propertyValue, int periodNum)
 Virtual method to set the non workspace properties for this algorithm.
 
template<typename T , const int AllowedIndexTypes = static_cast<int>(IndexType::WorkspaceIndex), typename... WSPropArgs, typename = typename std::enable_if<std::is_convertible<T *, MatrixWorkspace *>::value>::type>
void declareWorkspaceInputProperties (const std::string &propertyName, const std::string &doc, WSPropArgs &&...wsPropArgs)
 Declare a property which defines the workspace and allowed index types, as well as a property for capturing the indices all at once.
 
- Protected Member Functions inherited from Mantid::Kernel::IPropertyManager
template<typename T >
getValue (const std::string &name) const
 Templated method to get the value of a property.
 
template<>
MANTID_KERNEL_DLL PropertyManager_sptr getValue (const std::string &name) const
 
template<>
MANTID_KERNEL_DLL PropertyManager_const_sptr getValue (const std::string &name) const
 
- Static Protected Member Functions inherited from Mantid::API::Algorithm
template<typename NumT >
static bool isEmpty (const NumT toCheck)
 checks that the value was not set by users, uses the value in empty double/int.
 
- Protected Attributes inherited from Mantid::API::Algorithm
std::atomic< bool > m_cancel
 Set to true to stop execution.
 
std::atomic< bool > m_parallelException
 Set if an exception is thrown, and not caught, within a parallel region.
 
std::vector< IWorkspaceProperty * > m_inputWorkspaceProps
 All the WorkspaceProperties that are Input or InOut. Set in execute()
 
std::shared_ptr< AlgorithmHistorym_history
 Pointer to the history for the algorithm being executed.
 
Kernel::Logger m_log
 Logger for this algorithm.
 
Kernel::Loggerg_log
 
std::shared_ptr< AlgorithmHistorym_parentHistory
 Pointer to the parent history object (if set)
 
std::vector< WorkspaceVectorm_unrolledInputWorkspaces
 One vector of workspaces for each input workspace property.
 
size_t m_groupSize
 Size of the group(s) being processed.
 
bool m_usingBaseProcessGroups = false
 distinguish between base processGroups() and overriden/algorithm specific versions
 
- Static Protected Attributes inherited from Mantid::API::Algorithm
static size_t g_execCount = 0
 Counter to keep track of algorithm execution order.
 

Detailed Description

Definition at line 101 of file FitPeaks.h.

Constructor & Destructor Documentation

◆ FitPeaks()

Mantid::Algorithms::FitPeaks::FitPeaks ( )

Definition at line 262 of file FitPeaks.cpp.

Member Function Documentation

◆ calculateFittedPeaks()

void Mantid::Algorithms::FitPeaks::calculateFittedPeaks ( const std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > > &  fit_results)
private

calculate peak+background for fitted

calculate fitted peaks with background in the output workspace The current version gets the peak parameters and background parameters from fitted parameter table

Definition at line 1494 of file FitPeaks.cpp.

References Mantid::API::FunctionValues::getCalculated(), m_bkgdFunction, m_fittedParamTable, m_fittedPeakWS, m_getPeakFitWindow, m_numPeaksToFit, m_peakFunction, m_startWorkspaceIndex, m_stopWorkspaceIndex, PARALLEL_CHECK_INTERRUPT_REGION, PARALLEL_END_INTERRUPT_REGION, PARALLEL_FOR_IF, PARALLEL_START_INTERRUPT_REGION, and Mantid::Kernel::threadSafe().

Referenced by processOutputs().

◆ calculateSignalToNoiseRatio()

double Mantid::Algorithms::FitPeaks::calculateSignalToNoiseRatio ( size_t  iws,
const std::pair< double, double > &  range,
const API::IBackgroundFunction_sptr bkgd_function 
)
private

calculate signal-to-noise ratio in histogram range

Calculate signal-to-noise ratio in a histogram range.

Parameters
iws:: histogram index in workspace
range:: histogram range
bkgd_function:: background function pointer
Returns
:: signal-to-noise ratio

Definition at line 2187 of file FitPeaks.cpp.

Referenced by fitIndividualPeak().

◆ calculateSignalToSigmaRatio()

double Mantid::Algorithms::FitPeaks::calculateSignalToSigmaRatio ( const size_t &  iws,
const std::pair< double, double > &  peakWindow,
const API::IPeakFunction_sptr peakFunction 
)
private

Definition at line 1555 of file FitPeaks.cpp.

References m_inputMatrixWS, sigma, and Mantid::API::FunctionValues::toVector().

Referenced by fitSpectrumPeaks().

◆ category()

const std::string Mantid::Algorithms::FitPeaks::category ( ) const
inlineoverridevirtual

Algorithm's category for identification.

Implements Mantid::API::IAlgorithm.

Definition at line 115 of file FitPeaks.h.

◆ checkPeakIndices()

void Mantid::Algorithms::FitPeaks::checkPeakIndices ( std::size_t const &  wi,
std::size_t const &  ipeak 
)
private

Definition at line 2235 of file FitPeaks.cpp.

References m_getExpectedPeakPositions, and m_numPeaksToFit.

Referenced by processInputFitRanges().

◆ checkPeakWindowEdgeOrder()

void Mantid::Algorithms::FitPeaks::checkPeakWindowEdgeOrder ( double const &  left,
double const &  right 
)
private

Definition at line 2244 of file FitPeaks.cpp.

References left, and right.

Referenced by processInputFitRanges().

◆ checkWorkspaceIndices()

void Mantid::Algorithms::FitPeaks::checkWorkspaceIndices ( std::size_t const &  wi)
private

Get the expected peak's position.

Definition at line 2226 of file FitPeaks.cpp.

References m_startWorkspaceIndex, and m_stopWorkspaceIndex.

Referenced by processInputFitRanges(), and processInputPeakCenters().

◆ convertParametersNameToIndex()

void Mantid::Algorithms::FitPeaks::convertParametersNameToIndex ( )
private

Convert peak function's parameter names to parameter index for fast access.

Convert the input initial parameter name/value to parameter index/value for faster access according to the parameter name and peak profile function Output: m_initParamIndexes will be set up.

Definition at line 946 of file FitPeaks.cpp.

References Mantid::API::Algorithm::g_log, m_initParamIndexes, m_peakFunction, m_peakParamNames, m_profileStartingValueTable, and Mantid::Kernel::Logger::warning().

Referenced by processInputFunctions().

◆ createMatrixWorkspace()

API::MatrixWorkspace_sptr Mantid::Algorithms::FitPeaks::createMatrixWorkspace ( const std::vector< double > &  vec_x,
const std::vector< double > &  vec_y,
const std::vector< double > &  vec_e 
)
private

Create a single spectrum workspace for fitting.

Definition at line 1924 of file FitPeaks.cpp.

Referenced by fitFunctionHighBackground().

◆ decideToEstimatePeakParams()

bool Mantid::Algorithms::FitPeaks::decideToEstimatePeakParams ( const bool  firstPeakInSpectrum,
const API::IPeakFunction_sptr peak_function 
)
private

Decide whether to estimate peak parameters.

If not, then set the peak parameters from user specified starting value

Parameters
firstPeakInSpectrum:: flag whether the given peak is the first peak in the spectrum
peak_function:: peak function to set parameter values to
Returns
:: flag whether the peak width shall be observed

Definition at line 1340 of file FitPeaks.cpp.

References m_initParamIndexes, and m_initParamValues.

Referenced by fitSpectrumPeaks().

◆ exec()

void Mantid::Algorithms::FitPeaks::exec ( )
overrideprivatevirtual

◆ fitBackground()

bool Mantid::Algorithms::FitPeaks::fitBackground ( const size_t &  ws_index,
const std::pair< double, double > &  fit_window,
const double &  expected_peak_pos,
const API::IBackgroundFunction_sptr bkgd_func 
)
private

◆ fitFunctionHighBackground()

double Mantid::Algorithms::FitPeaks::fitFunctionHighBackground ( const API::IAlgorithm_sptr fit,
const std::pair< double, double > &  fit_window,
const size_t &  ws_index,
const double &  expected_peak_center,
bool  observe_peak_shape,
const API::IPeakFunction_sptr peakfunction,
const API::IBackgroundFunction_sptr bkgdfunc 
)
private

fit a single peak with high background

Fit peak with high background.

Definition at line 1882 of file FitPeaks.cpp.

References createMatrixWorkspace(), fitBackground(), fitFunctionSD(), getRangeData(), m_inputMatrixWS, m_linearBackgroundFunction, and n.

Referenced by fitIndividualPeak().

◆ fitFunctionMD()

double Mantid::Algorithms::FitPeaks::fitFunctionMD ( API::IFunction_sptr  fit_function,
const API::MatrixWorkspace_sptr dataws,
const size_t  wsindex,
const std::pair< double, double > &  vec_xmin,
const std::pair< double, double > &  vec_xmax 
)
private

◆ fitFunctionSD()

double Mantid::Algorithms::FitPeaks::fitFunctionSD ( const API::IAlgorithm_sptr fit,
const API::IPeakFunction_sptr peak_function,
const API::IBackgroundFunction_sptr bkgd_function,
const API::MatrixWorkspace_sptr dataws,
size_t  wsindex,
const std::pair< double, double > &  peak_range,
const double &  expected_peak_center,
bool  estimate_peak_width,
bool  estimate_background 
)
private

Methods to fit functions (general)

Fit function in single domain (mostly applied for fitting peak + background) with estimating peak parameters This is the core fitting algorithm to deal with the simplest situation.

Exceptions
:Fit.isExecuted is false (cannot be executed)

Definition at line 1726 of file FitPeaks.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::Algorithms::PeakParameterHelper::estimatePeakParameters(), Mantid::Algorithms::PeakParameterHelper::findXIndex(), Mantid::API::Algorithm::g_log, Mantid::Algorithms::PeakParameterHelper::GOOD, Mantid::Algorithms::PeakParameterHelper::LOWPEAK, m_constrainPeaksPosition, m_fitIterations, m_minPeakHeight, m_peakWidthEstimateApproach, m_peakWidthPercentage, Mantid::Algorithms::PeakParameterHelper::NOSIGNAL, and Mantid::Kernel::Logger::warning().

Referenced by fitFunctionHighBackground(), and fitIndividualPeak().

◆ fitIndividualPeak()

double Mantid::Algorithms::FitPeaks::fitIndividualPeak ( size_t  wi,
const API::IAlgorithm_sptr fitter,
const double  expected_peak_center,
const std::pair< double, double > &  fitwindow,
const bool  estimate_peak_width,
const API::IPeakFunction_sptr peakfunction,
const API::IBackgroundFunction_sptr bkgdfunc,
const std::shared_ptr< FitPeaksAlgorithm::PeakFitPreCheckResult > &  pre_check_result 
)
private

◆ fitPeaks()

std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > > Mantid::Algorithms::FitPeaks::fitPeaks ( )
private

suites of method to fit peaks

main method to fit peaks among all

Vector to record all the FitResult (only containing specified number of spectra. shift is expected)

Definition at line 978 of file FitPeaks.cpp.

References fitSpectrumPeaks(), logNoOffset(), m_bkgdFunction, m_getExpectedPeakPositions, m_numPeaksToFit, m_numSpectraToFit, m_peakFunction, m_startWorkspaceIndex, m_stopWorkspaceIndex, PARALLEL_CHECK_INTERRUPT_REGION, PARALLEL_CRITICAL, PARALLEL_END_INTERRUPT_REGION, PARALLEL_START_INTERRUPT_REGION, PRAGMA_OMP, Mantid::Kernel::ProgressBase::report(), and writeFitResult().

Referenced by exec().

◆ fitSpectrumPeaks()

void Mantid::Algorithms::FitPeaks::fitSpectrumPeaks ( size_t  wi,
const std::vector< double > &  expected_peak_centers,
const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &  fit_result,
std::vector< std::vector< double > > &  lastGoodPeakParameters,
const std::shared_ptr< FitPeaksAlgorithm::PeakFitPreCheckResult > &  pre_check_result 
)
private

◆ generateCalculatedPeaksWS()

void Mantid::Algorithms::FitPeaks::generateCalculatedPeaksWS ( )
private

Generate workspace for calculated values.

Generate the output MatrixWorkspace for calculated peaks (as an option)

FitPeaks::generateCalculatedPeaksWS

Definition at line 2046 of file FitPeaks.cpp.

References Mantid::API::Algorithm::getPropertyValue(), m_fittedPeakWS, and m_inputMatrixWS.

Referenced by exec().

◆ generateFittedParametersValueWorkspaces()

void Mantid::Algorithms::FitPeaks::generateFittedParametersValueWorkspaces ( )
private

Generate output workspaces.

Generate table workspace for fitted parameters' value and optionally the table workspace for those parameters' fitting error.

FitPeaks::generateFittedParametersValueWorkspace

Definition at line 2004 of file FitPeaks.cpp.

References Mantid::API::Algorithm::getProperty(), Mantid::API::Algorithm::getPropertyValue(), m_bkgdFunction, m_fitErrorTable, m_fittedParamTable, m_peakFunction, m_rawPeaksTable, and setupParameterTableWorkspace().

Referenced by exec().

◆ generateOutputPeakPositionWS()

void Mantid::Algorithms::FitPeaks::generateOutputPeakPositionWS ( )
private

main method to create output workspaces

generate output workspace for peak positions

Definition at line 1948 of file FitPeaks.cpp.

References m_getExpectedPeakPositions, m_numPeaksToFit, m_numSpectraToFit, m_outputPeakPositionWorkspace, and m_startWorkspaceIndex.

Referenced by exec().

◆ getPeakHeightParameterName()

std::string Mantid::Algorithms::FitPeaks::getPeakHeightParameterName ( const API::IPeakFunction_const_sptr peak_function)
private

Get the parameter name for peak height (I or height or etc)

Definition at line 2363 of file FitPeaks.cpp.

◆ getRangeData()

void Mantid::Algorithms::FitPeaks::getRangeData ( size_t  iws,
const std::pair< double, double > &  range,
std::vector< double > &  vec_x,
std::vector< double > &  vec_y,
std::vector< double > &  vec_e 
)
private

get vector X, Y and E in a given range

Parameters
iws:: histogram index in workspace
range:: histogram range
vec_x:: (output) vector of X-values
vec_y:: (output) vector of Y-values
vec_e:: (output) vector of E-values

Definition at line 2155 of file FitPeaks.cpp.

References histRangeToIndexBounds(), and m_inputMatrixWS.

Referenced by fitFunctionHighBackground(), and numberCounts().

◆ histRangeToDataPointCount()

size_t Mantid::Algorithms::FitPeaks::histRangeToDataPointCount ( size_t  iws,
const std::pair< double, double > &  range 
)
private

convert a histogram range to index boundaries

Calculate number of data points in a histogram range.

calculate how many data points are in a histogram range

Parameters
iws:: histogram index in workspace
range:: histogram range
Returns
:: number of data points

Definition at line 2112 of file FitPeaks.cpp.

References histRangeToIndexBounds(), and m_inputMatrixWS.

Referenced by fitIndividualPeak().

◆ histRangeToIndexBounds()

void Mantid::Algorithms::FitPeaks::histRangeToIndexBounds ( size_t  iws,
const std::pair< double, double > &  range,
size_t &  left_index,
size_t &  right_index 
)
private

convert a histogram range to index boundaries

Convert a histogram range to vector index boundaries.

Parameters
iws:: histogram index in workspace
range:: histogram range
left_index:: (output) left index boundary
right_index:: (output) right index boundary

Definition at line 2131 of file FitPeaks.cpp.

Referenced by getRangeData(), and histRangeToDataPointCount().

◆ init()

void Mantid::Algorithms::FitPeaks::init ( )
overrideprivatevirtual

◆ isObservablePeakProfile()

bool Mantid::Algorithms::FitPeaks::isObservablePeakProfile ( const std::string &  peakprofile)
private

check whether FitPeaks supports observation on a certain peak profile's parameters (width!)

check whether a peak profile is allowed to observe peak width and set width

isObservablePeakProfile

Parameters
peakprofile: name of peak profile to check against
Returns
:: flag whether the specified peak profile observable

Definition at line 1627 of file FitPeaks.cpp.

Referenced by processInputs().

◆ logNoOffset()

void Mantid::Algorithms::FitPeaks::logNoOffset ( const size_t &  priority,
const std::string &  msg 
)
private

◆ name()

const std::string Mantid::Algorithms::FitPeaks::name ( ) const
inlineoverridevirtual

Algorithm's name.

Implements Mantid::API::Algorithm.

Definition at line 106 of file FitPeaks.h.

◆ numberCounts() [1/2]

double Mantid::Algorithms::FitPeaks::numberCounts ( size_t  iws)
private

sum up all counts in histogram

Sum up all counts in a histogram.

Parameters
iws:: histogram index in workspace
Returns
:: total number of counts in the histogram

Definition at line 2085 of file FitPeaks.cpp.

References m_inputMatrixWS.

Referenced by fitIndividualPeak(), and fitSpectrumPeaks().

◆ numberCounts() [2/2]

double Mantid::Algorithms::FitPeaks::numberCounts ( size_t  iws,
const std::pair< double, double > &  range 
)
private

sum up all counts in histogram range

Sum up all counts in a histogram range.

Parameters
iws:: histogram index in workspace
range:: histogram range
Returns
:: total number of counts in the range

Definition at line 2097 of file FitPeaks.cpp.

References getRangeData().

◆ processInputFitRanges()

void Mantid::Algorithms::FitPeaks::processInputFitRanges ( )
private

◆ processInputFunctions()

void Mantid::Algorithms::FitPeaks::processInputFunctions ( )
private

◆ processInputPeakCenters()

void Mantid::Algorithms::FitPeaks::processInputPeakCenters ( )
private

peak centers

Processing peaks centers and fitting tolerance information from input.

the parameters that are set including

  1. m_peakCenters/m_peakCenterWorkspace/m_uniformPeakPositions (bool)/m_partialSpectra (bool)
  2. m_peakPosTolerances (vector)
  3. m_numPeaksToFit

Definition at line 827 of file FitPeaks.cpp.

References checkWorkspaceIndices(), Mantid::Kernel::Logger::debug(), Mantid::Kernel::Logger::error(), Mantid::API::Algorithm::g_log, Mantid::API::Algorithm::getProperty(), Mantid::API::Algorithm::getPropertyValue(), m_getExpectedPeakPositions, m_numPeaksToFit, m_peakCenters, m_peakCenterWorkspace, m_startWorkspaceIndex, m_stopWorkspaceIndex, m_uniformPeakPositions, and Mantid::Kernel::Logger::notice().

Referenced by processInputs().

◆ processInputPeakTolerance()

void Mantid::Algorithms::FitPeaks::processInputPeakTolerance ( )
private

process inputs about fitted peak positions' tolerance

Processing peak fitting tolerance information from input.

The parameters that are set including

  1. m_peakPosTolerances (vector)

Definition at line 888 of file FitPeaks.cpp.

References Mantid::Kernel::Logger::error(), Mantid::API::Algorithm::g_log, Mantid::API::Algorithm::getProperty(), Mantid::API::Algorithm::isEmpty(), m_minPeakHeight, m_minPeakTotalCount, m_minSignalToNoiseRatio, m_minSignalToSigmaRatio, m_numPeaksToFit, m_peakPosTolCase234, and m_peakPosTolerances.

Referenced by processInputs().

◆ processInputs()

void Mantid::Algorithms::FitPeaks::processInputs ( )
private

◆ processOutputs()

void Mantid::Algorithms::FitPeaks::processOutputs ( std::vector< std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > >  fit_result_vec)
private

◆ processSinglePeakFitResult()

bool Mantid::Algorithms::FitPeaks::processSinglePeakFitResult ( size_t  wsindex,
size_t  peakindex,
const double  cost,
const std::vector< double > &  expected_peak_positions,
const FitPeaksAlgorithm::FitFunction fitfunction,
const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &  fit_result 
)
private

Process the result from fitting a single peak.

retrieve the fitted peak information from functions and set to output vectors

Parameters
wsindex:: workspace index
peakindex:: index of peak in given peak position vector
cost:: cost function value (i.e., chi^2)
expected_peak_positions:: vector of the expected peak positions
fitfunction:: pointer to function to retrieve information from
fit_result:: (output) PeakFitResult instance to set the fitting result to
Returns
:: whether the peak fiting is good or not

Definition at line 1380 of file FitPeaks.cpp.

References Mantid::Kernel::Logger::debug(), fabs, Mantid::API::Algorithm::g_log, m_getPeakFitWindow, m_inputMatrixWS, m_minPeakHeight, m_numPeaksToFit, m_peakPosTolCase234, m_peakPosTolerances, and Mantid::Algorithms::FitPeaksAlgorithm::FitFunction::peakfunction.

Referenced by fitSpectrumPeaks().

◆ setupParameterTableWorkspace()

void Mantid::Algorithms::FitPeaks::setupParameterTableWorkspace ( const API::ITableWorkspace_sptr table_ws,
const std::vector< std::string > &  param_names,
bool  with_chi2 
)
private

Set up parameter table (parameter value or error)

FitPeaks::generateParameterTable

Parameters
table_ws,:an empty workspace
param_names
with_chi2,:flag to append chi^2 to the table

Definition at line 1972 of file FitPeaks.cpp.

References m_fittedParamTable, m_numPeaksToFit, m_startWorkspaceIndex, and m_stopWorkspaceIndex.

Referenced by generateFittedParametersValueWorkspaces().

◆ summary()

const std::string Mantid::Algorithms::FitPeaks::summary ( ) const
inlineoverridevirtual

Summary of algorithms purpose.

Implements Mantid::API::Algorithm.

Definition at line 109 of file FitPeaks.h.

◆ validateInputs()

std::map< std::string, std::string > Mantid::Algorithms::FitPeaks::validateInputs ( void  )
overridevirtual

◆ version()

int Mantid::Algorithms::FitPeaks::version ( ) const
inlineoverridevirtual

Algorithm's version.

Implements Mantid::API::Algorithm.

Definition at line 112 of file FitPeaks.h.

◆ writeFitResult()

void Mantid::Algorithms::FitPeaks::writeFitResult ( size_t  wi,
const std::vector< double > &  expected_positions,
const std::shared_ptr< FitPeaksAlgorithm::PeakFitResult > &  fit_result 
)
private

Write result of peak fit per spectrum to output analysis workspaces.

Write result of peak fit per spectrum to output analysis workspaces including (1) output peak position workspace (2) parameter table workspace and optionally (3) fitting error/uncertainty workspace.

FitPeaks::writeFitResult

Parameters
wi
expected_positions:: vector for expected peak positions
fit_result:: PeakFitResult instance

Definition at line 2261 of file FitPeaks.cpp.

References Mantid::Kernel::Logger::error(), Mantid::API::Algorithm::g_log, m_bkgdFunction, m_fitErrorTable, m_fittedParamTable, m_numPeaksToFit, m_outputPeakPositionWorkspace, m_peakFunction, m_rawPeaksTable, and m_startWorkspaceIndex.

Referenced by fitPeaks().

Member Data Documentation

◆ m_bkgdFunction

API::IBackgroundFunction_sptr Mantid::Algorithms::FitPeaks::m_bkgdFunction
private

◆ m_constrainPeaksPosition

bool Mantid::Algorithms::FitPeaks::m_constrainPeaksPosition
private

Definition at line 310 of file FitPeaks.h.

Referenced by fitFunctionSD(), and processInputs().

◆ m_costFunction

std::string Mantid::Algorithms::FitPeaks::m_costFunction
private

Cost function.

Definition at line 271 of file FitPeaks.h.

Referenced by fitFunctionMD(), fitSpectrumPeaks(), and processInputs().

◆ m_fitErrorTable

API::ITableWorkspace_sptr Mantid::Algorithms::FitPeaks::m_fitErrorTable
private

table workspace for fitted parameters' fitting error. This is optional

Definition at line 251 of file FitPeaks.h.

Referenced by generateFittedParametersValueWorkspaces(), processOutputs(), and writeFitResult().

◆ m_fitIterations

int Mantid::Algorithms::FitPeaks::m_fitIterations
private

Fit iterations.

Definition at line 275 of file FitPeaks.h.

Referenced by fitFunctionMD(), fitFunctionSD(), and processInputs().

◆ m_fitPeaksFromRight

bool Mantid::Algorithms::FitPeaks::m_fitPeaksFromRight
private

Fit from right or left.

Definition at line 273 of file FitPeaks.h.

Referenced by fitSpectrumPeaks(), and processInputs().

◆ m_fittedParamTable

API::ITableWorkspace_sptr Mantid::Algorithms::FitPeaks::m_fittedParamTable
private

output analysis workspaces table workspace for fitted parameters

Definition at line 249 of file FitPeaks.h.

Referenced by calculateFittedPeaks(), generateFittedParametersValueWorkspaces(), processOutputs(), setupParameterTableWorkspace(), and writeFitResult().

◆ m_fittedPeakWS

API::MatrixWorkspace_sptr Mantid::Algorithms::FitPeaks::m_fittedPeakWS
private

matrix workspace contained calcalated peaks+background from fitted result it has same number of spectra of input workspace even if only part of spectra to have peaks to fit

Definition at line 258 of file FitPeaks.h.

Referenced by calculateFittedPeaks(), generateCalculatedPeaksWS(), and processOutputs().

◆ m_getExpectedPeakPositions

std::function<std::vector<double>(std::size_t const &)> Mantid::Algorithms::FitPeaks::m_getExpectedPeakPositions
private

◆ m_getPeakFitWindow

std::function<std::pair<double, double>(std::size_t const &, std::size_t const &)> Mantid::Algorithms::FitPeaks::m_getPeakFitWindow
private

◆ m_highBackground

bool Mantid::Algorithms::FitPeaks::m_highBackground
private

flag for high background

Definition at line 338 of file FitPeaks.h.

Referenced by fitIndividualPeak(), processInputFunctions(), and processInputs().

◆ m_initParamIndexes

std::vector<size_t> Mantid::Algorithms::FitPeaks::m_initParamIndexes
private

input starting parameters' indexes in peak function

Definition at line 279 of file FitPeaks.h.

Referenced by convertParametersNameToIndex(), and decideToEstimatePeakParams().

◆ m_initParamValues

std::vector<double> Mantid::Algorithms::FitPeaks::m_initParamValues
private

input peak parameters' starting values corresponding to above peak parameter names

Definition at line 320 of file FitPeaks.h.

Referenced by decideToEstimatePeakParams(), and processInputFunctions().

◆ m_inputEventWS

DataObjects::EventWorkspace_const_sptr Mantid::Algorithms::FitPeaks::m_inputEventWS
private

event workspace for input

Definition at line 244 of file FitPeaks.h.

◆ m_inputIsDSpace

bool Mantid::Algorithms::FitPeaks::m_inputIsDSpace
private

Definition at line 242 of file FitPeaks.h.

Referenced by processInputFitRanges(), and processInputs().

◆ m_inputMatrixWS

API::MatrixWorkspace_sptr Mantid::Algorithms::FitPeaks::m_inputMatrixWS
private

◆ m_linearBackgroundFunction

API::IBackgroundFunction_sptr Mantid::Algorithms::FitPeaks::m_linearBackgroundFunction
private

Linear background function for high background fitting.

Definition at line 266 of file FitPeaks.h.

Referenced by fitFunctionHighBackground(), and processInputFunctions().

◆ m_minimizer

std::string Mantid::Algorithms::FitPeaks::m_minimizer
private

Minimzer.

Definition at line 269 of file FitPeaks.h.

Referenced by fitFunctionMD(), fitSpectrumPeaks(), and processInputs().

◆ m_minPeakHeight

double Mantid::Algorithms::FitPeaks::m_minPeakHeight
private

minimum peak height without background and it also serves as the criteria for observed peak parameter

Definition at line 329 of file FitPeaks.h.

Referenced by fitFunctionSD(), processInputPeakTolerance(), and processSinglePeakFitResult().

◆ m_minPeakTotalCount

double Mantid::Algorithms::FitPeaks::m_minPeakTotalCount
private

Definition at line 333 of file FitPeaks.h.

Referenced by fitIndividualPeak(), fitSpectrumPeaks(), and processInputPeakTolerance().

◆ m_minSignalToNoiseRatio

double Mantid::Algorithms::FitPeaks::m_minSignalToNoiseRatio
private

Definition at line 332 of file FitPeaks.h.

Referenced by fitIndividualPeak(), and processInputPeakTolerance().

◆ m_minSignalToSigmaRatio

double Mantid::Algorithms::FitPeaks::m_minSignalToSigmaRatio
private

Definition at line 335 of file FitPeaks.h.

Referenced by fitSpectrumPeaks(), and processInputPeakTolerance().

◆ m_numPeaksToFit

std::size_t Mantid::Algorithms::FitPeaks::m_numPeaksToFit
private

◆ m_numSpectraToFit

std::size_t Mantid::Algorithms::FitPeaks::m_numSpectraToFit
private

total number of spectra to be fit

Definition at line 303 of file FitPeaks.h.

Referenced by fitPeaks(), generateOutputPeakPositionWS(), and processInputs().

◆ m_outputPeakPositionWorkspace

API::MatrixWorkspace_sptr Mantid::Algorithms::FitPeaks::m_outputPeakPositionWorkspace
private

output workspace for peak positions

Definition at line 246 of file FitPeaks.h.

Referenced by generateOutputPeakPositionWS(), processOutputs(), and writeFitResult().

◆ m_peakCenters

std::vector<double> Mantid::Algorithms::FitPeaks::m_peakCenters
private

Designed peak positions and tolerance.

Definition at line 282 of file FitPeaks.h.

Referenced by processInputFitRanges(), and processInputPeakCenters().

◆ m_peakCenterWorkspace

API::MatrixWorkspace_const_sptr Mantid::Algorithms::FitPeaks::m_peakCenterWorkspace
private

Definition at line 283 of file FitPeaks.h.

Referenced by processInputFitRanges(), and processInputPeakCenters().

◆ m_peakFunction

API::IPeakFunction_sptr Mantid::Algorithms::FitPeaks::m_peakFunction
private

◆ m_peakParamNames

std::vector<std::string> Mantid::Algorithms::FitPeaks::m_peakParamNames
private

input peak parameters' names

Definition at line 317 of file FitPeaks.h.

Referenced by convertParametersNameToIndex(), and processInputFunctions().

◆ m_peakPosTolCase234

bool Mantid::Algorithms::FitPeaks::m_peakPosTolCase234
private

peak positon tolerance case b, c and d

Definition at line 342 of file FitPeaks.h.

Referenced by processInputPeakTolerance(), and processSinglePeakFitResult().

◆ m_peakPosTolerances

std::vector<double> Mantid::Algorithms::FitPeaks::m_peakPosTolerances
private

tolerances for fitting peak positions

Definition at line 305 of file FitPeaks.h.

Referenced by processInputPeakTolerance(), and processSinglePeakFitResult().

◆ m_peakWidthEstimateApproach

Algorithms::PeakParameterHelper::EstimatePeakWidth Mantid::Algorithms::FitPeaks::m_peakWidthEstimateApproach
private

Flag for observing peak width: there are 3 states (1) no estimation (2) from 'observation' (3) calculated from instrument resolution.

Definition at line 309 of file FitPeaks.h.

Referenced by fitFunctionSD(), fitSpectrumPeaks(), and processInputs().

◆ m_peakWidthPercentage

double Mantid::Algorithms::FitPeaks::m_peakWidthPercentage
private

flag to estimate peak width from

Definition at line 295 of file FitPeaks.h.

Referenced by fitFunctionSD(), processInputFitRanges(), and processInputs().

◆ m_peakWindowVector

std::vector<std::vector<double> > Mantid::Algorithms::FitPeaks::m_peakWindowVector
private

peak windows

Definition at line 313 of file FitPeaks.h.

Referenced by processInputFitRanges().

◆ m_peakWindowWorkspace

API::MatrixWorkspace_const_sptr Mantid::Algorithms::FitPeaks::m_peakWindowWorkspace
private

Definition at line 314 of file FitPeaks.h.

Referenced by processInputFitRanges().

◆ m_profileStartingValueTable

API::ITableWorkspace_const_sptr Mantid::Algorithms::FitPeaks::m_profileStartingValueTable
private

table workspace for profile parameters' starting value

Definition at line 322 of file FitPeaks.h.

Referenced by convertParametersNameToIndex(), processInputFunctions(), and validateInputs().

◆ m_rawPeaksTable

bool Mantid::Algorithms::FitPeaks::m_rawPeaksTable
private

flag to show that the pamarameters in table are raw parameters or effective parameters

Definition at line 254 of file FitPeaks.h.

Referenced by generateFittedParametersValueWorkspaces(), and writeFitResult().

◆ m_startWorkspaceIndex

std::size_t Mantid::Algorithms::FitPeaks::m_startWorkspaceIndex
private

◆ m_stopWorkspaceIndex

std::size_t Mantid::Algorithms::FitPeaks::m_stopWorkspaceIndex
private

stop index (workspace index of the last spectrum included)

Definition at line 301 of file FitPeaks.h.

Referenced by calculateFittedPeaks(), checkWorkspaceIndices(), fitPeaks(), processInputFitRanges(), processInputPeakCenters(), processInputs(), and setupParameterTableWorkspace().

◆ m_uniformPeakPositions

bool Mantid::Algorithms::FitPeaks::m_uniformPeakPositions
private

Definition at line 286 of file FitPeaks.h.

Referenced by processInputFitRanges(), and processInputPeakCenters().

◆ m_uniformProfileStartingValue

bool Mantid::Algorithms::FitPeaks::m_uniformProfileStartingValue
private

flag for profile startng value being uniform or not

Definition at line 324 of file FitPeaks.h.

Referenced by processInputFunctions().


The documentation for this class was generated from the following files: