|
Mantid
|
RefinePowderInstrumentParameters3 : More...
#include <RefinePowderInstrumentParameters3.h>
Public Member Functions | |
| const std::string | category () const override |
| Algorithm's category for identification overriding a virtual method. | |
| const std::string | name () const override |
| Algorithm's name for identification overriding a virtual method. | |
| RefinePowderInstrumentParameters3 () | |
| Constructor. | |
| 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 | summary () const override |
| Summary of algorithms purpose. | |
| int | version () const override |
| Algorithm's version for identification overriding a virtual method. | |
Public Member Functions inherited from Mantid::API::Algorithm | |
| Algorithm () | |
| Constructor. | |
| Algorithm (const Algorithm &)=delete | |
| Algorithm & | operator= (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::Logger & | getLogger () 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< Algorithm > | createChildAlgorithm (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::Property > | takeProperty (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::Property * | getPointerToProperty (const std::string &name) const override |
| Get a property by name. | |
| Kernel::Property * | getPointerToPropertyOrdinal (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::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::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. | |
| IPropertyManager * | setProperty (const std::string &name, const char *value) |
| Specialised version of setProperty template method to handle const char *. | |
| IPropertyManager * | setProperty (const std::string &name, const std::string &value) |
| Specialised version of setProperty template method to handle std::string. | |
| template<typename T > | |
| IPropertyManager * | setProperty (const std::string &name, const T &value) |
| Templated method to set the value of a PropertyWithValue. | |
| template<typename T > | |
| IPropertyManager * | setProperty (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 Types | |
| enum | { FIT , MONTECARLO } |
| Fit mode. More... | |
| enum | { CONSTANT , USEINPUT } |
| Standard error mode. More... | |
Private Member Functions | |
| bool | acceptOrDenyChange (double curchisq, double newchisq, double temperature) |
| Determine whether the proposed value should be accepted or denied. | |
| void | addOrReplace (std::map< std::string, Parameter > ¶meters, const std::string &parname, double parvalue) |
| Add a parameter to parameter map. | |
| void | addParameterToMCMinimize (std::vector< std::string > &parnamesforMC, const std::string &parname, std::map< std::string, Parameter > parammap) |
| Add parameter (to a vector of string/name) for MC random walk. | |
| void | bookKeepMCResult (std::map< std::string, Parameter > parammap, double chisq, int istep, int igroup, std::map< std::string, Parameter > &bestparammap) |
| Book keep the best fitting result. | |
| double | calculateFunction (const std::map< std::string, Parameter > ¶mmap, std::vector< double > &vecY) |
| Implement parameter values, calculate function and its chi square. | |
| double | calculateFunctionError (const API::IFunction_sptr &function, const DataObjects::Workspace2D_sptr &dataws, int wsindex) |
| Calculate Chi^2 of the a function with all parameters are fixed. | |
| bool | doFitFunction (const API::IFunction_sptr &function, const DataObjects::Workspace2D_sptr &dataws, int wsindex, const std::string &minimizer, int numiters, double &chi2, std::string &fitstatus) |
| Fit function (single step) | |
| double | doSimulatedAnnealing (std::map< std::string, Parameter > inparammap) |
| Do MC/simulated annealing to refine parameters. | |
| void | exec () override |
| Implement abstract Algorithm methods. | |
| double | execFitParametersMC () |
| Refine instrument parameters by Monte Carlo/simulated annealing method. | |
| double | execFitParametersNonMC () |
| Fit instrument parameters by non Monte Carlo algorithm. | |
| double | fitFunction (const API::IFunction_sptr &function, const DataObjects::Workspace2D_sptr &dataws, int wsindex, bool powerfit) |
| Fit function by non MC minimzer(s) | |
| DataObjects::TableWorkspace_sptr | genOutputProfileTable (std::map< std::string, Parameter > parameters, double startchi2, double finalchi2) |
| Construct an output TableWorkspace for refined peak profile parameters. | |
| DataObjects::Workspace2D_sptr | genOutputWorkspace (const API::FunctionDomain1DVector &domain, const API::FunctionValues &rawvalues) |
| Construct output. | |
| void | init () override |
| Implement abstract Algorithm methods. | |
| void | parseTableWorkspace (const DataObjects::TableWorkspace_sptr &tablews, std::map< std::string, Parameter > ¶mmap) |
| Parse table workspace to a map of Parameters. | |
| void | parseTableWorkspaces () |
| Parse TableWorkspaces. | |
| void | processInputProperties () |
| Process input properties. | |
| void | proposeNewValues (const std::vector< std::string > &mcgroup, std::map< std::string, Parameter > &curparammap, std::map< std::string, Parameter > &newparammap, double currchisq) |
| Propose new parameters. | |
| void | setFunctionParameterFitSetups (const API::IFunction_sptr &function, std::map< std::string, Parameter > params) |
| Set parameter fitting setup (boundary, fix or unfix) to function from Parameter map. | |
| void | setFunctionParameterValues (const API::IFunction_sptr &function, std::map< std::string, Parameter > params) |
| Set parameter values to function from Parameter map. | |
| void | setupRandomWalkStrategy (std::map< std::string, Parameter > ¶mmap, std::vector< std::vector< std::string > > &mcgroups) |
| Set up Monte Carlo random walk strategy. | |
| void | updateFunctionParameterValues (API::IFunction_sptr function, std::map< std::string, Parameter > ¶ms) |
| Update parameter values to Parameter map from fuction map. | |
Private Attributes | |
| double | m_bestChiSq |
| Book keep for MC. | |
| int | m_bestChiSqGroup |
| int | m_bestChiSqStep |
| double | m_dampingFactor |
| Damping factor. | |
| DataObjects::Workspace2D_sptr | m_dataWS |
| Data workspace containg peak positions. | |
| enum Mantid::CurveFitting::Algorithms::RefinePowderInstrumentParameters3:: { ... } | m_fitMode |
| Fit mode. | |
| int | m_numWalkSteps |
| Monte Carlo random walk steps. | |
| DataObjects::TableWorkspace_sptr | m_paramTable |
| TableWorkspace containing peak parameters value and fit information. | |
| Functions::ThermalNeutronDtoTOFFunction_sptr | m_positionFunc |
| My function for peak positions. | |
| std::map< std::string, Parameter > | m_profileParameters |
| Data structure (map of Parameters) to hold parameters. | |
| int | m_randomSeed |
| Random seed. | |
| enum Mantid::CurveFitting::Algorithms::RefinePowderInstrumentParameters3:: { ... } | m_stdMode |
| Standard error mode. | |
| int | m_wsIndex |
| Workspace index of the peak positions. | |
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 > | |
| 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< AlgorithmHistory > | m_history |
| Pointer to the history for the algorithm being executed. | |
| Kernel::Logger | m_log |
| Logger for this algorithm. | |
| Kernel::Logger & | g_log |
| std::shared_ptr< AlgorithmHistory > | m_parentHistory |
| Pointer to the parent history object (if set) | |
| std::vector< WorkspaceVector > | m_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. | |
RefinePowderInstrumentParameters3 :
Definition at line 25 of file RefinePowderInstrumentParameters3.h.
|
private |
Fit mode.
| Enumerator | |
|---|---|
| FIT | |
| MONTECARLO | |
Definition at line 135 of file RefinePowderInstrumentParameters3.h.
|
private |
Standard error mode.
| Enumerator | |
|---|---|
| CONSTANT | |
| USEINPUT | |
Definition at line 138 of file RefinePowderInstrumentParameters3.h.
| Mantid::CurveFitting::Algorithms::RefinePowderInstrumentParameters3::RefinePowderInstrumentParameters3 | ( | ) |
Constructor.
Definition at line 32 of file RefinePowderInstrumentParameters3.cpp.
|
private |
Determine whether the proposed value should be accepted or denied.
| curchisq | present chi^2 (as a factor in step size) |
| newchisq | new chi^2 (as a factor in step size) |
| temperature | annealing temperature |
Definition at line 581 of file RefinePowderInstrumentParameters3.cpp.
Referenced by doSimulatedAnnealing().
|
private |
Add a parameter to parameter map.
If this parametere does exist, then replace the value of it
If this parametere does exist, then replace the value of it.
| parameters | map |
| parname | string, parameter name |
| parvalue | double, parameter value |
Definition at line 1016 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::Parameter::curvalue, and Mantid::CurveFitting::Algorithms::Parameter::name.
Referenced by genOutputProfileTable().
|
private |
Add parameter (to a vector of string/name) for MC random walk.
Add parameter (to a vector of string/name) for MC random walk according to Fit in Parameter.
| parnamesforMC | vector of parameter for MC minimizer |
| parname | name of parameter to check whether to put into refinement list |
| parammap | :: parammap |
Definition at line 718 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::Kernel::Logger::error(), and Mantid::API::Algorithm::g_log.
Referenced by setupRandomWalkStrategy().
|
private |
Book keep the best fitting result.
Definition at line 600 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::duplicateParameters(), m_bestChiSq, m_bestChiSqGroup, and m_bestChiSqStep.
Referenced by doSimulatedAnnealing().
|
private |
Implement parameter values, calculate function and its chi square.
| parammap | if size = 0, there is no action to set function parameter. |
| vecY | :: vecY Return: chi^2 |
Definition at line 740 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::calculateFunctionChiSquare(), m_dataWS, m_positionFunc, m_wsIndex, and setFunctionParameterValues().
Referenced by doSimulatedAnnealing().
|
private |
Calculate Chi^2 of the a function with all parameters are fixed.
Definition at line 785 of file RefinePowderInstrumentParameters3.cpp.
References doFitFunction(), Mantid::API::Algorithm::g_log, and Mantid::Kernel::Logger::warning().
Referenced by doSimulatedAnnealing(), exec(), and fitFunction().
|
inlineoverridevirtual |
Algorithm's category for identification overriding a virtual method.
Reimplemented from Mantid::API::Algorithm.
Definition at line 39 of file RefinePowderInstrumentParameters3.h.
|
private |
Fit function (single step)
Fit function Minimizer: "Levenberg-MarquardtMD"/"Simplex".
Definition at line 918 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::API::Algorithm::createChildAlgorithm(), Mantid::Kernel::Logger::debug(), Mantid::API::Algorithm::g_log, Mantid::Kernel::Logger::information(), m_positionFunc, and Mantid::Kernel::Logger::warning().
Referenced by calculateFunctionError(), doSimulatedAnnealing(), and fitFunction().
|
private |
Do MC/simulated annealing to refine parameters.
Helpful: double curchi2 = calculateD2TOFFunction(mFunction, domain, values, rawY, rawE);
Definition at line 318 of file RefinePowderInstrumentParameters3.cpp.
References acceptOrDenyChange(), bookKeepMCResult(), calculateFunction(), calculateFunctionError(), doFitFunction(), Mantid::CurveFitting::Algorithms::duplicateParameters(), Mantid::API::Algorithm::g_log, Mantid::API::Algorithm::getProperty(), m_bestChiSq, m_bestChiSqGroup, m_bestChiSqStep, m_dataWS, m_positionFunc, m_wsIndex, Mantid::Kernel::Logger::notice(), proposeNewValues(), setFunctionParameterValues(), setupRandomWalkStrategy(), and Mantid::Kernel::Logger::warning().
Referenced by execFitParametersMC().
|
overrideprivatevirtual |
Implement abstract Algorithm methods.
Main execution body.
Implements Mantid::API::Algorithm.
Definition at line 100 of file RefinePowderInstrumentParameters3.cpp.
References calculateFunctionError(), execFitParametersMC(), execFitParametersNonMC(), FIT, Mantid::API::Algorithm::g_log, genOutputProfileTable(), genOutputWorkspace(), m_dataWS, m_fitMode, m_positionFunc, m_profileParameters, m_wsIndex, MONTECARLO, Mantid::Kernel::Logger::notice(), parseTableWorkspaces(), processInputProperties(), setFunctionParameterValues(), and Mantid::Kernel::IPropertyManager::setProperty().
|
private |
Refine instrument parameters by Monte Carlo/simulated annealing method.
Definition at line 299 of file RefinePowderInstrumentParameters3.cpp.
References doSimulatedAnnealing(), Mantid::API::Algorithm::g_log, m_bestChiSqGroup, m_bestChiSqStep, m_profileParameters, and Mantid::Kernel::Logger::notice().
Referenced by exec().
|
private |
Fit instrument parameters by non Monte Carlo algorithm.
Fit instrument parameters by non Monte Carlo algorithm Requirement: m_positionFunc should have the best fit result;.
Definition at line 278 of file RefinePowderInstrumentParameters3.cpp.
References fitFunction(), Mantid::API::Algorithm::g_log, m_dataWS, m_positionFunc, m_profileParameters, m_wsIndex, Mantid::Kernel::Logger::notice(), and setFunctionParameterFitSetups().
Referenced by exec().
|
private |
Fit function by non MC minimzer(s)
Fit a function by trying various minimizer or minimizer combination.
| function | :: an instance of a function to fit |
| dataws | :: a workspace with the data |
| wsindex | :: a histogram index |
| powerfit | :: a flag to choose a robust algorithm to fit function |
Return: double chi2 of the final (best) solution. If fitting fails, chi2 wil be maximum double
Definition at line 828 of file RefinePowderInstrumentParameters3.cpp.
References calculateFunctionError(), doFitFunction(), Mantid::API::Algorithm::g_log, m_profileParameters, Mantid::Kernel::Logger::notice(), Mantid::CurveFitting::Algorithms::restoreFunctionParameterValue(), Mantid::CurveFitting::Algorithms::storeFunctionParameterValue(), and Mantid::Kernel::Logger::warning().
Referenced by execFitParametersNonMC().
|
private |
Construct an output TableWorkspace for refined peak profile parameters.
Construct an output TableWorkspace for fitting result (profile parameters)
Definition at line 972 of file RefinePowderInstrumentParameters3.cpp.
References addOrReplace(), Mantid::CurveFitting::Algorithms::Parameter::curvalue, Mantid::CurveFitting::Algorithms::Parameter::fit, Mantid::CurveFitting::Algorithms::Parameter::fiterror, Mantid::CurveFitting::Algorithms::Parameter::maxvalue, Mantid::CurveFitting::Algorithms::Parameter::minvalue, Mantid::CurveFitting::Algorithms::Parameter::name, and Mantid::CurveFitting::Algorithms::Parameter::stepsize.
Referenced by exec().
|
private |
Construct output.
Definition at line 1032 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::DataObjects::create(), Mantid::Kernel::getZscore(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_dataWS, m_positionFunc, m_wsIndex, Mantid::API::FunctionDomain1D::toVector(), and Mantid::API::FunctionValues::toVector().
Referenced by exec().
|
overrideprivatevirtual |
Implement abstract Algorithm methods.
Declare properties.
Implements Mantid::API::Algorithm.
Definition at line 40 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::API::Algorithm::declareProperty(), Mantid::Kernel::Direction::Input, and Mantid::Kernel::Direction::Output.
|
inlineoverridevirtual |
Algorithm's name for identification overriding a virtual method.
Implements Mantid::API::Algorithm.
Definition at line 30 of file RefinePowderInstrumentParameters3.h.
|
private |
Parse table workspace to a map of Parameters.
Definition at line 213 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::convertToDict(), Mantid::CurveFitting::Algorithms::Parameter::curvalue, Mantid::CurveFitting::Algorithms::Parameter::fit, Mantid::CurveFitting::Algorithms::getStringIndex(), Mantid::CurveFitting::Algorithms::Parameter::maxvalue, Mantid::CurveFitting::Algorithms::Parameter::minvalue, Mantid::CurveFitting::Algorithms::Parameter::name, and Mantid::CurveFitting::Algorithms::Parameter::stepsize.
Referenced by parseTableWorkspaces().
|
private |
Parse TableWorkspaces.
Definition at line 204 of file RefinePowderInstrumentParameters3.cpp.
References m_paramTable, m_profileParameters, and parseTableWorkspace().
Referenced by exec().
|
private |
Process input properties.
Definition at line 157 of file RefinePowderInstrumentParameters3.cpp.
References CONSTANT, FIT, Mantid::API::Algorithm::getProperty(), m_dampingFactor, m_dataWS, m_fitMode, m_numWalkSteps, m_paramTable, m_randomSeed, m_stdMode, m_wsIndex, MONTECARLO, and USEINPUT.
Referenced by exec().
|
private |
Propose new parameters.
| mcgroup | list of parameters to have new values proposed |
| currchisq | present chi^2 (as a factor in step size) |
| curparammap | current parameter maps |
| newparammap | parameters map containing new/proposed value |
Definition at line 478 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::Parameter::curvalue, Mantid::Kernel::Logger::debug(), fabs, Mantid::API::Algorithm::g_log, m_bestChiSq, m_dampingFactor, Mantid::CurveFitting::Algorithms::Parameter::maxabsstepsize, Mantid::CurveFitting::Algorithms::Parameter::mcA0, Mantid::CurveFitting::Algorithms::Parameter::mcA1, Mantid::CurveFitting::Algorithms::Parameter::movedirection, Mantid::CurveFitting::Algorithms::Parameter::nonnegative, Mantid::CurveFitting::Algorithms::Parameter::numnegativemove, Mantid::CurveFitting::Algorithms::Parameter::numnomove, Mantid::CurveFitting::Algorithms::Parameter::numpositivemove, and Mantid::CurveFitting::Algorithms::Parameter::sumstepsize.
Referenced by doSimulatedAnnealing().
|
inlineoverridevirtual |
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm.A default implementation is provided.
Reimplemented from Mantid::API::Algorithm.
Definition at line 36 of file RefinePowderInstrumentParameters3.h.
|
private |
Set parameter fitting setup (boundary, fix or unfix) to function from Parameter map.
Update parameter values to Parameter map from fuction map void RefinePowderInstrumentParameters3::updateFunctionParameterValues(IFunction_sptr function, map<string, Parameter>& params) {.
Set up stringstream msgss; msgss << "Update Instrument Function Parameter To Storage Map : \n";
std::map<std::string, Parameter>::iterator paramiter; for (size_t i = 0; i < funparamnames.size(); ++i) { string parname = funparamnames[i]; paramiter = params.find(parname);
if (paramiter != params.end()) { Found, set up the parameter Parameter& param = paramiter->second; param.prevalue = param.value; param.value = function->getParameter(parname);
msgss << setw(10) << parname << " = " << param.value << '
'; } } // ENDFOR parameter name
g_log.information(msgss.str());
return; } Set parameter fitting setup (boundary, fix or unfix) to function from Parameter map
Definition at line 1151 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::Kernel::Logger::error(), Mantid::CurveFitting::Algorithms::Parameter::fit, Mantid::API::Algorithm::g_log, m_positionFunc, Mantid::CurveFitting::Algorithms::Parameter::maxvalue, Mantid::CurveFitting::Algorithms::Parameter::minvalue, and Mantid::Kernel::Logger::notice().
Referenced by execFitParametersNonMC().
|
private |
Set parameter values to function from Parameter map.
Definition at line 1080 of file RefinePowderInstrumentParameters3.cpp.
References Mantid::CurveFitting::Algorithms::Parameter::curvalue, Mantid::Kernel::Logger::error(), Mantid::API::Algorithm::g_log, and Mantid::Kernel::Logger::information().
Referenced by calculateFunction(), doSimulatedAnnealing(), and exec().
|
private |
Set up Monte Carlo random walk strategy.
Definition at line 644 of file RefinePowderInstrumentParameters3.cpp.
References addParameterToMCMinimize(), Mantid::API::Algorithm::g_log, and Mantid::Kernel::Logger::notice().
Referenced by doSimulatedAnnealing().
|
inlineoverridevirtual |
Summary of algorithms purpose.
Implements Mantid::API::Algorithm.
Definition at line 32 of file RefinePowderInstrumentParameters3.h.
|
private |
Update parameter values to Parameter map from fuction map.
|
inlineoverridevirtual |
Algorithm's version for identification overriding a virtual method.
Implements Mantid::API::Algorithm.
Definition at line 35 of file RefinePowderInstrumentParameters3.h.
|
private |
Book keep for MC.
Definition at line 156 of file RefinePowderInstrumentParameters3.h.
Referenced by bookKeepMCResult(), doSimulatedAnnealing(), and proposeNewValues().
|
private |
Definition at line 158 of file RefinePowderInstrumentParameters3.h.
Referenced by bookKeepMCResult(), doSimulatedAnnealing(), and execFitParametersMC().
|
private |
Definition at line 157 of file RefinePowderInstrumentParameters3.h.
Referenced by bookKeepMCResult(), doSimulatedAnnealing(), and execFitParametersMC().
|
private |
Damping factor.
Definition at line 153 of file RefinePowderInstrumentParameters3.h.
Referenced by processInputProperties(), and proposeNewValues().
|
private |
Data workspace containg peak positions.
Definition at line 126 of file RefinePowderInstrumentParameters3.h.
Referenced by calculateFunction(), doSimulatedAnnealing(), exec(), execFitParametersNonMC(), genOutputWorkspace(), and processInputProperties().
| enum { ... } Mantid::CurveFitting::Algorithms::RefinePowderInstrumentParameters3::m_fitMode |
Fit mode.
Referenced by exec(), and processInputProperties().
|
private |
Monte Carlo random walk steps.
Definition at line 141 of file RefinePowderInstrumentParameters3.h.
Referenced by processInputProperties().
|
private |
TableWorkspace containing peak parameters value and fit information.
Definition at line 132 of file RefinePowderInstrumentParameters3.h.
Referenced by parseTableWorkspaces(), and processInputProperties().
|
private |
My function for peak positions.
Definition at line 150 of file RefinePowderInstrumentParameters3.h.
Referenced by calculateFunction(), doFitFunction(), doSimulatedAnnealing(), exec(), execFitParametersNonMC(), genOutputWorkspace(), and setFunctionParameterFitSetups().
|
private |
Data structure (map of Parameters) to hold parameters.
Definition at line 147 of file RefinePowderInstrumentParameters3.h.
Referenced by exec(), execFitParametersMC(), execFitParametersNonMC(), fitFunction(), and parseTableWorkspaces().
|
private |
Random seed.
Definition at line 144 of file RefinePowderInstrumentParameters3.h.
Referenced by processInputProperties().
| enum { ... } Mantid::CurveFitting::Algorithms::RefinePowderInstrumentParameters3::m_stdMode |
Standard error mode.
Referenced by processInputProperties().
|
private |
Workspace index of the peak positions.
Definition at line 129 of file RefinePowderInstrumentParameters3.h.
Referenced by calculateFunction(), doSimulatedAnnealing(), exec(), execFitParametersNonMC(), genOutputWorkspace(), and processInputProperties().