diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h index a2c73187eb4b012022744b000761bbd7c776c217..82b950b0107adefe971f6e10185a7bc84e8cf800 100644 --- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h +++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h @@ -44,7 +44,7 @@ private: API::MatrixWorkspace_sptr removeExpDecay(const API::Workspace_sptr &inputWS, const int index) const; API::MatrixWorkspace_sptr EstimateAsymmetry(const API::Workspace_sptr &inputWS, - const int index)const;// , const double StartX, const double EndX) const; + const int index)const; }; std::vector<double> convertToVec(std::string const &list); } // namespace WorkflowAlgorithms diff --git a/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp b/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp index 6108ef7e3ab2123612e2ca61badd7efd34d7b4b5..f54fda648f456008c0153af264b0829701244d08 100644 --- a/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp +++ b/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp @@ -106,8 +106,8 @@ MuonGroupAsymmetryCalculator::removeExpDecay(const Workspace_sptr &inputWS, return outWS; } /** -* Removes exponential decay from the given workspace. -* @param inputWS :: [input] Workspace to remove decay from +* Estimate the asymmetrey for the given workspace (TF data). +* @param inputWS :: [input] Workspace to calculate asymmetry for * @param index :: [input] GroupIndex (fit only the requested spectrum): use -1 * for "unset" * @returns Result of the removal @@ -117,16 +117,13 @@ MuonGroupAsymmetryCalculator::EstimateAsymmetry(const Workspace_sptr &inputWS, const int index) const { std::vector<double> normEst; MatrixWorkspace_sptr outWS; - // Remove decay + // calculate asymmetry if (inputWS) { IAlgorithm_sptr asym = AlgorithmManager::Instance().create("EstimateMuonAsymmetryFromCounts"); asym->setChild(true); asym->setProperty("InputWorkspace", inputWS); if (index > -1) { - // GroupIndex as vector - // Necessary if we want RemoveExpDecay to fit only the requested - // spectrum std::vector<int> spec(1, index); asym->setProperty("Spectra", spec); } diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp index 3b200fc796547e4c48024692f90e464495c3e2af..95ddfa081515d7a15a4700634e6e99f0bdfb32bb 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp @@ -2089,7 +2089,7 @@ void MuonAnalysis::loadFittings() { // Add Data Selector widget to the fit tab m_dataSelector = new MuonFitDataSelector(m_uiForm.fitBrowser); m_dataSelector->sizePolicy().setVerticalStretch(0); - m_uiForm.fitBrowser->addExtraWidget(m_dataSelector);// need to add my widget (maybe to a new list?) + m_uiForm.fitBrowser->addExtraWidget(m_dataSelector); // Set up fit data and function presenters m_fitDataPresenter = Mantid::Kernel::make_unique<MuonAnalysisFitDataPresenter>( @@ -3039,7 +3039,7 @@ void MuonAnalysis::multiFitCheckboxChanged(int state) { : Muon::MultiFitState::Disabled; // If both multiFit and TFAsymm are checked // uncheck the TFAsymm - if (m_uiForm.chkEnableMultiFit->isChecked() && state!=0)//m_uiForm.chkTFAsymm->isChecked()) + if (m_uiForm.chkEnableMultiFit->isChecked() && state!=0) { //uncheck the box m_uiForm.chkTFAsymm->setChecked(false); @@ -3063,7 +3063,7 @@ void MuonAnalysis::TFAsymmCheckboxChanged(int state) { : Muon::TFAsymmState::Disabled; // If both multiFit and TFAsymm are checked // uncheck the multiFit - if (m_uiForm.chkEnableMultiFit->isChecked() && state!=0)//m_uiForm.chkTFAsymm->isChecked()) + if (m_uiForm.chkEnableMultiFit->isChecked() && state!=0) { //uncheck the box m_uiForm.chkEnableMultiFit->setChecked(false); diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisOptionTab.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisOptionTab.cpp index aba159649cfa0785087d081e31d19b130224a2c2..c27705f40e5b9f2f90faa4bb7983a953648d7314 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisOptionTab.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisOptionTab.cpp @@ -412,7 +412,7 @@ namespace MantidQt { } } /** - * Returns whether or not "enable multiple fitting" is set. + * Returns whether or not "enable TFAsymmetry" is set. * @returns whether the checkbox is ticked */ Muon::TFAsymmState MuonAnalysisOptionTab::getTFAsymmState() const { diff --git a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h index 666c2ab47d8dbbe6ff248a4ffe6074ad9a236926..aae00617ac6af97c63185ef6fca55a78c05a145f 100644 --- a/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h +++ b/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h @@ -383,7 +383,6 @@ protected: void setWorkspace(boost::shared_ptr<Mantid::API::IFunction> f) const; /// Display properties relevant to the selected workspace void setWorkspaceProperties(); - QtProperty *addStringProperty(const QString &name) const; /// Create a double property and set some settings QtProperty *addDoubleProperty(const QString &name, @@ -503,6 +502,7 @@ private: /// Enable/disable the Fit button; virtual void setFitEnabled(bool yes); /// Create a string property and set some settings + QtProperty *addStringProperty(const QString &name) const; void setStringPropertyValue(QtProperty *prop, const QString &value) const; QString getStringPropertyValue(QtProperty *prop) const; /// Check that the properties match the function diff --git a/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp index 2b124acbfe35d828e79c346f08a18e9b5a97112d..7e7229546c00cb68384c0aac6916b6ceb9fc7a77 100644 --- a/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp +++ b/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp @@ -278,13 +278,12 @@ void FitPropertyBrowser::initLayout(QWidget *w) { } /** -* @brief Initialise the layout. +* @brief Initialise the layout for the fit button. * This initialization includes: * 1. SIGNALs/SLOTs when properties change. -* 2. Action menus and associated SIGNALs/SLOTs. -* 3. Initialize the CompositeFunction, the root from which to build the Model. -* 4. Update the list of available functions +* 2. Actions and associated SIGNALs/SLOTs. * @param w widget parenting the action menus and the property tree browser +* @return push botton for the fit menu */ QPushButton *FitPropertyBrowser::createFitMenuButton(QWidget *w) { QPushButton *btnFit = new QPushButton("Fit"); @@ -326,6 +325,7 @@ QPushButton *FitPropertyBrowser::createFitMenuButton(QWidget *w) { * 3. Initialize the CompositeFunction, the root from which to build the Model. * 4. Update the list of available functions * @param w widget parenting the action menus and the property tree browser +* @param btnFit the fit push button */ void FitPropertyBrowser::initBasicLayout(QWidget *w, QPushButton *btnFit) { // to be able to change windows title from tread diff --git a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp index a616b127779e0d25526268df92d5951a8efb2dde..d8b4cbda6788d4574a1a1ec08033b74131d8f98c 100644 --- a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp +++ b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp @@ -127,7 +127,7 @@ void MuonFitPropertyBrowser::init() { settingsGroup->addSubProperty(m_workspace); settingsGroup->addSubProperty(m_workspaceIndex); settingsGroup->addSubProperty(m_startX); - settingsGroup->addSubProperty(m_endX); // add to settings group here..... + settingsGroup->addSubProperty(m_endX); settingsGroup->addSubProperty(m_normalization); connect(m_browser, SIGNAL(currentItemChanged(QtBrowserItem *)), this, SLOT(currentItemChanged(QtBrowserItem *))); @@ -205,13 +205,12 @@ void MuonFitPropertyBrowser::executeMuonFitMenu(const QString &item) { } } /** -* @brief Initialise the layout. +* @brief Initialise the layout of the fit menu button. * This initialization includes: * 1. SIGNALs/SLOTs when properties change. * 2. Action menus and associated SIGNALs/SLOTs. -* 3. Initialize the CompositeFunction, the root from which to build the Model. -* 4. Update the list of available functions * @param w widget parenting the action menus and the property tree browser +* @return QPushButton for the fit menu */ QPushButton *MuonFitPropertyBrowser::createMuonFitMenuButton(QWidget *w) { QPushButton *btnFit = new QPushButton("Fit"); @@ -250,7 +249,7 @@ QPushButton *MuonFitPropertyBrowser::createMuonFitMenuButton(QWidget *w) { return btnFit; } - +/// Enable/disable the Fit button; void MuonFitPropertyBrowser::setFitEnabled(bool yes) { m_fitActionFit->setEnabled(yes); m_fitActionSeqFit->setEnabled(yes); @@ -316,7 +315,8 @@ void MuonFitPropertyBrowser::doubleChanged(QtProperty *prop) { } } } -/// Get the normalization +/** @returns the normalization +*/ double MuonFitPropertyBrowser::Normalization() const { return readNormalization()[0]; } @@ -385,9 +385,9 @@ std::vector<double> convertToVec(std::string const &list) { [](std::string const &element) { return std::stod(element); }); return vec; } -//#include "../FitDialog.h" /** * Creates an instance of Fit algorithm, sets its properties and launches it. +* @params maxIterations is the maximum number of iterations for the fit */ void MuonFitPropertyBrowser::TFAsymmFit(int maxIterations) { const std::string wsName = workspaceName(); @@ -797,12 +797,10 @@ void MuonFitPropertyBrowser::setMultiFittingMode(bool enabled) { } } /** -* Set multiple fitting mode on or off. -* If turned off, all parts of the fit property browser are shown and all extra -* widgets (like the function browser or data selector) are hidden, so it looks -* just like it used to before the changes in Mantid 3.8. -* If turned on, the "Function" and "Data" sections of the fit property browser -* are hidden and the extra widgets are shown. +* Set TF asymmetry mode on or off. +* If turned off, the fit property browser looks like Mantid 3.8. +* If turned on, the fit menu has an extra button and +* normalization is shown in the data table * @param enabled :: [input] Whether to turn this mode on or off */ void MuonFitPropertyBrowser::setTFAsymmMode(bool enabled) {