improve the doxygen docu of musrWiz.

This commit is contained in:
2025-11-23 18:41:03 +01:00
parent 594d080490
commit 8d41f47540
8 changed files with 902 additions and 102 deletions

View File

@@ -33,52 +33,159 @@
#include <QString>
#include <QVector>
//---------------------------------------------------------------------------
/**
* @brief The PFuncParam class represents a parameter of a musrfit function.
*
* This class holds information about a single parameter of a musrfit theory function,
* including its name, default value, and whether it should be treated as a map
* (run-specific parameter) rather than a global parameter.
*/
class PFuncParam {
public:
/**
* @brief Constructor. Initializes to default values.
*/
PFuncParam() { initParam(); }
/**
* @brief Destructor.
*/
~PFuncParam() {}
/**
* @brief Initializes all member variables to default values.
*
* Sets name to "UnDef", value to 0.0, and map flag to false.
*/
void initParam() { fName = "UnDef"; fValue = 0.0; fMap = false; }
/**
* @brief Sets the parameter name.
* @param name Parameter name (e.g., "rate", "phase", "sigma").
*/
void setParamName(QString name) { fName = name; }
/**
* @brief Sets the default parameter value.
* @param dval Default value.
*/
void setParamValue(double dval) { fValue = dval; }
/**
* @brief Sets whether this parameter should be a map.
* @param isMap true if this is a run-specific (map) parameter.
*/
void setParamMap(bool isMap) { fMap = isMap; }
/**
* @brief Returns the parameter name.
* @return Parameter name.
*/
QString getParamName() { return fName; }
/**
* @brief Returns the default parameter value.
* @return Default value.
*/
double getParamValue() { return fValue; }
/**
* @brief Checks if this is a map parameter.
* @return true if this is a run-specific (map) parameter.
*/
bool isMap() { return fMap; }
private:
QString fName;
double fValue;
bool fMap;
QString fName; ///< parameter name
double fValue; ///< default parameter value
bool fMap; ///< flag indicating if this is a map (run-specific) parameter
};
//---------------------------------------------------------------------------
/**
* @brief The PMusrfitFunc class represents a musrfit theory function.
*
* This class holds the definition of a musrfit theory function including its
* full name, abbreviation (used in msr-files), number of parameters, and
* the parameter definitions. Examples include simpleGss (sg), simpleLor (sl),
* TFieldCos (tf), etc.
*/
class PMusrfitFunc {
public:
/**
* @brief Constructor. Initializes to default values.
*/
PMusrfitFunc() { initFunc(); }
/**
* @brief Destructor.
*/
~PMusrfitFunc() {}
/**
* @brief Initializes all member variables to default values.
*/
void initFunc();
/**
* @brief Sets the function name.
* @param name Full function name (e.g., "simpleGss").
*/
void setName(QString name) { fName = name; }
/**
* @brief Sets the function abbreviation.
* @param abbrv Abbreviation used in msr-files (e.g., "sg").
*/
void setAbbrv(QString abbrv) { fAbbrv = abbrv; }
/**
* @brief Sets the number of parameters this function takes.
* @param ival Number of parameters.
*/
void setNoOfParam(int ival) { fNoOfParam = ival; }
/**
* @brief Adds a parameter definition to this function.
* @param param Parameter object to add.
*/
void addFuncParam(PFuncParam param) { fParam.push_back(param); }
/**
* @brief Returns the function name.
* @return Full function name.
*/
QString getName() { return fName; }
/**
* @brief Returns the function abbreviation.
* @return Abbreviation string.
*/
QString getAbbrv() { return fAbbrv; }
/**
* @brief Returns the number of parameters.
* @return Number of parameters.
*/
int getNoOfParam() { return fNoOfParam; }
/**
* @brief Returns a function parameter by index.
* @param idx Index of the parameter.
* @return PFuncParam at the given index, or default param if out of range.
*/
PFuncParam getFuncParam(int idx);
/**
* @brief Returns a pointer to the parameter vector.
* @return Pointer to the QVector of PFuncParam.
*/
QVector<PFuncParam> *getFuncParams() { return &fParam; }
private:
QString fName;
QString fAbbrv;
int fNoOfParam;
QVector<PFuncParam> fParam;
QString fName; ///< full function name
QString fAbbrv; ///< abbreviation for msr-files
int fNoOfParam; ///< number of parameters
QVector<PFuncParam> fParam; ///< parameter definitions
};
#endif // _PMUSRFITFUNC_H_