|
| | PParamDataHandler () |
| | Default constructor.
|
| |
| int | GetNoOfCollections () |
| | Gets the total number of loaded collections.
|
| |
| void | NewCollection (const QString name) |
| | Creates and adds an empty collection with the specified name.
|
| |
| bool | ReadParamFile (const QStringList fln, QString &errorMsg) |
| | Reads parameter file(s) and loads them into collections.
|
| |
| PmuppCollection | ReadDbFile (const QString fln, bool &valid, QString &errorMsg) |
| | Reads and parses a db-format parameter file.
|
| |
| PmuppCollection | ReadColumnParamFile (const QString fln, bool &valid, QString &errorMsg) |
| | Reads and parses a column-based parameter file (dat/txt format).
|
| |
| PmuppCollection | GetCollection (const int idx, bool &valid) |
| | Retrieves a collection by index (by value).
|
| |
| PmuppCollection | GetCollection (const QString name, bool &valid) |
| | PParamDataHandler::GetCollection. Get collection by name.
|
| |
| PmuppCollection * | GetCollection (const int idx) |
| | PParamDataHandler::GetCollection. Get a pointer of the requested collection.
|
| |
| PmuppCollection * | GetCollection (const QString name) |
| | PParamDataHandler::GetCollection. Get collection pointer by name.
|
| |
| int | GetCollectionIndex (const QString name) |
| | PParamDataHandler::GetCollectionIndex. Get the collection index of a given collection name.
|
| |
| QString | GetCollectionName (const int idx) |
| | PParamDataHandler::GetCollectionName.
|
| |
| QVector< double > | GetValues (QString collName, QString paramName) |
| | Retrieves all values for a specific parameter across all runs.
|
| |
| QVector< double > | GetPosErr (QString collName, QString paramName) |
| | Retrieves all positive errors for a specific parameter across all runs.
|
| |
| QVector< double > | GetNegErr (QString collName, QString paramName) |
| | Retrieves all negative errors for a specific parameter across all runs.
|
| |
| void | RemoveCollection (QString name) |
| | Removes a collection from the handler by name.
|
| |
| void | ReplaceCollection (PmuppCollection coll, int idx) |
| | Replaces a collection at the specified index.
|
| |
| void | Dump () |
| | Dumps all collection data to stdout for debugging.
|
| |
Central manager class for loading and accessing parameter collections.
The PParamDataHandler class is responsible for managing all loaded parameter collections in mupp. It provides functionality for:
- Reading and parsing parameter files (db, dat, msr formats)
- Managing multiple collections simultaneously
- Providing access to parameter data by collection and parameter name
- Handling conversion of msr files via msr2data external process
This class acts as the primary interface between the data storage and the GUI or scripting components of mupp. It maintains a vector of all loaded collections and provides various query methods to extract parameter values and errors.
File format support:
- .db files: muSR database format with structured parameter entries
- .dat/.txt files: Column-based parameter files
- .msr files: muSR fit input files (converted via msr2data)
Definition at line 306 of file Pmupp.h.
| bool PParamDataHandler::analyzeFileList |
( |
const QStringList & | fln, |
|
|
QString & | collectionName, |
|
|
QStringList & | arg, |
|
|
QString & | workDir, |
|
|
QString & | errorMsg ) |
|
private |
Analyzes a list of msr-files to prepare arguments for msr2data.
When parameter data is provided as msr-files (muSR fit input files), this function analyzes their structure to extract run numbers and extensions, preparing the argument list needed to invoke the msr2data external tool for conversion to db format.
The function expects msr-files with names following the pattern: <runNumber><extension>.msr where <extension> starts with '_'. All msr-files in the list must have the same extension.
- Parameters
-
| fln | list of msr-file paths to be analyzed |
| collectionName | output parameter: name for the resulting db/dat collection file |
| arg | output parameter: argument list to be passed to msr2data |
| workDir | output parameter: working directory where files are located |
| errorMsg | output parameter: error message if analysis fails |
- Returns
- true if analysis is successful, false otherwise
Definition at line 252 of file Pmupp.cpp.
| void PParamDataHandler::Dump |
( |
| ) |
|
Dumps all collection data to stdout for debugging.
Prints a formatted representation of all loaded collections, including collection names, run numbers, run names, and all parameters with their values and errors. This is primarily used for debugging and verification purposes.
Output format shows:
- Collection separator and name
- For each run: run number, run name
- For each parameter: name, value, negative error, positive error
Definition at line 1165 of file Pmupp.cpp.
| QVector< double > PParamDataHandler::GetNegErr |
( |
QString | collName, |
|
|
QString | paramName ) |
Retrieves all negative errors for a specific parameter across all runs.
This method extracts the negative (lower) error values of a named parameter from all runs in the specified collection. The returned vector has one entry per run, in the order they appear in the collection.
Used in conjunction with GetValues() and GetPosErr() for plotting parameters with asymmetric error bars.
- Parameters
-
| collName | name of the collection to query |
| paramName | name of the parameter whose negative errors to extract |
- Returns
- vector of negative error values, one per run in the collection. Returns an empty vector if the collection or parameter is not found.
- See also
- GetValues(), GetPosErr()
Definition at line 1077 of file Pmupp.cpp.
| QVector< double > PParamDataHandler::GetPosErr |
( |
QString | collName, |
|
|
QString | paramName ) |
Retrieves all positive errors for a specific parameter across all runs.
This method extracts the positive (upper) error values of a named parameter from all runs in the specified collection. The returned vector has one entry per run, in the order they appear in the collection.
Used in conjunction with GetValues() for plotting parameters with error bars.
- Parameters
-
| collName | name of the collection to query |
| paramName | name of the parameter whose positive errors to extract |
- Returns
- vector of positive error values, one per run in the collection. Returns an empty vector if the collection or parameter is not found.
- See also
- GetValues(), GetNegErr()
Definition at line 1022 of file Pmupp.cpp.
| QVector< double > PParamDataHandler::GetValues |
( |
QString | collName, |
|
|
QString | paramName ) |
Retrieves all values for a specific parameter across all runs.
This method extracts the central values of a named parameter from all runs in the specified collection. The returned vector has one entry per run, in the order they appear in the collection.
This is useful for plotting parameter evolution (e.g., relaxation rate vs. temperature) where each run represents a different experimental condition.
- Parameters
-
| collName | name of the collection to query |
| paramName | name of the parameter to extract (e.g., "alpha", "lambda") |
- Returns
- vector of parameter values, one per run in the collection. Returns an empty vector if the collection or parameter is not found.
- See also
- GetPosErr(), GetNegErr()
Definition at line 968 of file Pmupp.cpp.
| PmuppCollection PParamDataHandler::ReadColumnParamFile |
( |
const QString | fln, |
|
|
bool & | valid, |
|
|
QString & | errorMsg ) |
Reads and parses a column-based parameter file (dat/txt format).
The column format is a simple text format where:
- First line: Header with column names
- Following lines: Data values (one row per run)
- Columns are whitespace-separated
Column naming conventions:
- Parameter names without suffix: parameter values
- Names ending with "Err": symmetric errors
- Names ending with "PosErr": positive (upper) errors
- Names ending with "NegErr": negative (lower) errors
- Column named "RUN": run number identifier
Error handling supports both symmetric (single error column) and asymmetric (separate PosErr/NegErr columns) error specifications.
- Parameters
-
| fln | path to the dat/txt-file to be read |
| valid | output parameter: set to true on success, false on failure |
| errorMsg | output parameter: error message describing any failures |
- Returns
- a PmuppCollection object containing all runs and parameters from the file. Returns an empty collection if reading fails (valid will be false).
- See also
- ReadParamFile(), ReadDbFile()
Definition at line 679 of file Pmupp.cpp.
| bool PParamDataHandler::ReadParamFile |
( |
const QStringList | fln, |
|
|
QString & | errorMsg ) |
Reads parameter file(s) and loads them into collections.
This is the main entry point for loading parameter data. It handles multiple file formats (msr, db, dat) and dispatches to the appropriate reader function. For msr-files, it invokes msr2data to convert them to db format first.
File format handling:
Multiple files can be loaded in a single call. Each file becomes a separate collection in the handler.
- Parameters
-
| fln | list of file names (with paths) to be loaded |
| errorMsg | output parameter: error message if reading fails |
- Returns
- true on success, false on any error
- See also
- ReadDbFile(), ReadColumnParamFile(), analyzeFileList()
Definition at line 346 of file Pmupp.cpp.