musredit 1.0.0
Loading...
Searching...
No Matches
PGetSingleHistoRunBlockDialog Class Reference

Dialog for creating single histogram type RUN blocks in msr files. More...

#include <PGetSingleHistoRunBlockDialog.h>

Inheritance diagram for PGetSingleHistoRunBlockDialog:
Collaboration diagram for PGetSingleHistoRunBlockDialog:

Public Member Functions

 PGetSingleHistoRunBlockDialog (const QString helpUrl="", const bool lifetimeCorrection=true)
 Constructs the single histogram RUN block dialog.
 
RUN Block Generators

Methods to generate formatted msr-file text for each parameter.

QString getRunHeaderInfo ()
 Generates the RUN header line for the single histogram block.
 
QString getMap (bool &valid)
 Generates the parameter map line for the single histogram block.
 
QString getForward ()
 Gets the forward histogram specification line.
 
QString getNorm ()
 Gets the normalization parameter line.
 
QString getData (bool &valid)
 Generates the data range specification for the single histogram block.
 
QString getBackground (bool &valid)
 Generates the background specification for the single histogram block.
 
QString getFitRange (bool &valid)
 Generates the fit range specification for the single histogram block.
 
QString getPacking (bool &present)
 Generates the packing (rebinning) specification for the single histogram block.
 
QString getT0 (bool &present)
 Generates the T0 (time zero) specification for the single histogram block.
 
QString getMuonLifetimeParam (bool &present)
 Generates the muon lifetime parameter line for the single histogram block.
 
QString getLifetimeCorrection (bool &present)
 Generates the lifetime correction flag for the single histogram block.
 

Private Slots

void helpContent ()
 Opens the online help for single histogram RUN blocks.
 

Private Attributes

QString fHelpUrl
 URL to the online documentation for single histogram RUN blocks.
 

Detailed Description

Dialog for creating single histogram type RUN blocks in msr files.

This dialog collects all parameters needed to generate a single histogram RUN block for muon spin rotation data analysis. Single histogram fitting is used when analyzing individual detector counts rather than computing asymmetry from forward/backward detector pairs.

RUN Block Parameters:
  • Run file name, beamline, institute, and file format
  • Forward histogram number
  • Normalization parameter
  • Parameter map
  • Data range (in bins)
  • Background specification (fixed, fitted, or estimated from bins)
  • T0 (time zero) value
  • Fit range (in microseconds)
  • Packing/binning factor
  • Muon lifetime parameter
  • Lifetime correction flag
Generated Output Format:
The dialog generates msr-file formatted text blocks such as:
RUN data001 GPS PSI ROOT (name beamline institute data-file-format)
map 1 2 3
forward 1
norm 1
data 100 8000
background 50 100
t0 250
fit 0.0 10.0
packing 1
Background Options:
Three mutually exclusive background specification methods:
  • background: Bin range for background estimation [start, end]
  • backgr.fix: Fixed background value (counts per bin)
  • backgr.fit: Fit parameter number for background
See also
PGetAsymmetryRunBlockDialog For asymmetry fitting with detector pairs
PGetNonMusrRunBlockDialog For non-muSR generic data

Definition at line 101 of file PGetSingleHistoRunBlockDialog.h.

Constructor & Destructor Documentation

◆ PGetSingleHistoRunBlockDialog()

PGetSingleHistoRunBlockDialog::PGetSingleHistoRunBlockDialog ( const QString helpUrl = "",
const bool lifetimeCorrection = true )

Constructs the single histogram RUN block dialog.

Initializes the dialog UI and sets up input validators for all numeric fields. The dialog is created as modal. The lifetime correction checkbox is initialized based on the provided parameter.

Input Validators:
  • Integer validators: histogram number, norm, data range, background range, background fit parameter, packing, t0, lifetime parameter
  • Double validators: fixed background value, fit range
Parameters
helpUrlURL to the online documentation for single histogram RUN blocks. Defaults to empty string if not provided.
lifetimeCorrectionInitial state of the lifetime correction checkbox. Defaults to true (enabled).

Definition at line 71 of file PGetSingleHistoRunBlockDialog.cpp.

Member Function Documentation

◆ getBackground()

QString PGetSingleHistoRunBlockDialog::getBackground ( bool & valid)

Generates the background specification for the single histogram block.

Creates either a "background" line (bin ranges for background estimation), "backgr.fix" line (fixed background value), or "backgr.fit" line (fit parameter for background). Only one type should be specified; if multiple are provided, the last one takes precedence.

Background Types:
  • background: Two integers specifying bin range [start, end] for background estimation
  • backgr.fix: One double specifying fixed background counts per bin
  • backgr.fit: One integer specifying the fit parameter number for background
Parameters
[out]validSet to true if valid background info is provided, false if no background info given (a default "background 0 10" is returned).
Returns
Formatted background string, e.g.: "background 50 100\\n" or "backgr.fix 15.3\\n" or "backgr.fit 5\\n"

Definition at line 196 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getData()

QString PGetSingleHistoRunBlockDialog::getData ( bool & valid)

Generates the data range specification for the single histogram block.

Creates the "data" line specifying the histogram bin range to be used for fitting. Both start and end bins are required.

Parameters
[out]validSet to true if both data range values are provided, false if either is missing.
Returns
Formatted data range string, e.g.: "data 100 8000\\n" Returns empty string if values are missing.

Definition at line 160 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getFitRange()

QString PGetSingleHistoRunBlockDialog::getFitRange ( bool & valid)

Generates the fit range specification for the single histogram block.

Creates the "fit" line specifying the time range (in microseconds) over which the fit will be performed. If no fit range is provided by the user, a default range of [0.0, 10.0] is returned.

Parameters
[out]validSet to true if both fit range values are provided by the user, false if using the default range.
Returns
Formatted fit range string, e.g.: "fit 0.5 9.5\\n"

Definition at line 240 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getForward()

QString PGetSingleHistoRunBlockDialog::getForward ( )
inline

Gets the forward histogram specification line.

Returns
Formatted "forward" line for the msr file.

Definition at line 119 of file PGetSingleHistoRunBlockDialog.h.

◆ getLifetimeCorrection()

QString PGetSingleHistoRunBlockDialog::getLifetimeCorrection ( bool & present)

Generates the lifetime correction flag for the single histogram block.

Creates the "lifetimecorrection" line if the checkbox is enabled. When present, musrfit will apply muon lifetime correction to the data, effectively removing the exponential decay component from the signal.

Parameters
[out]presentSet to true if lifetime correction is enabled, false otherwise.
Returns
"lifetimecorrection\\n" if enabled, empty string if disabled.

Definition at line 352 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getMap()

QString PGetSingleHistoRunBlockDialog::getMap ( bool & valid)

Generates the parameter map line for the single histogram block.

The map line defines the mapping between theory function parameters and the fit parameters defined in the FITPARAMETER block. It should contain only space-separated integers.

Parameters
[out]validSet to true if the map contains only digits and spaces, false if invalid characters are found.
Returns
Formatted map string, e.g.: "map 1 2 3 4\\n"

Definition at line 130 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getMuonLifetimeParam()

QString PGetSingleHistoRunBlockDialog::getMuonLifetimeParam ( bool & present)

Generates the muon lifetime parameter line for the single histogram block.

Creates the "lifetime" line specifying which fit parameter contains the muon lifetime value. This is used when the muon lifetime should be fitted rather than using the fixed standard value. This parameter is optional.

Parameters
[out]presentSet to true if a lifetime parameter was provided, false otherwise.
Returns
Formatted lifetime string, e.g.: "lifetime 3\\n" Returns empty string if lifetime parameter is not specified.

Definition at line 325 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getNorm()

QString PGetSingleHistoRunBlockDialog::getNorm ( )
inline

Gets the normalization parameter line.

Returns
Formatted "norm" line for the msr file.

Definition at line 125 of file PGetSingleHistoRunBlockDialog.h.

◆ getPacking()

QString PGetSingleHistoRunBlockDialog::getPacking ( bool & present)

Generates the packing (rebinning) specification for the single histogram block.

Creates the "packing" line specifying how many histogram bins should be combined into one. A packing of 1 means no rebinning, 2 means combine pairs of bins, etc. If no packing is provided, a default value of 1 is used.

Parameters
[out]presentSet to true if a packing value was provided by the user, false if using the default value.
Returns
Formatted packing string, e.g.: "packing 10\\n"

Definition at line 270 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getRunHeaderInfo()

QString PGetSingleHistoRunBlockDialog::getRunHeaderInfo ( )

Generates the RUN header line for the single histogram block.

Creates the first line of the RUN block containing the run file name, beamline identifier, institute name, and data file format. The beamline is converted to uppercase.

Returns
Formatted RUN header string, e.g.: "RUN data001 GPS PSI ROOT (name beamline institute data-file-format)\\n"

Definition at line 105 of file PGetSingleHistoRunBlockDialog.cpp.

◆ getT0()

QString PGetSingleHistoRunBlockDialog::getT0 ( bool & present)

Generates the T0 (time zero) specification for the single histogram block.

Creates the "t0" line specifying the time zero bin for the histogram. T0 is the bin corresponding to muon implantation time. This parameter is optional.

Parameters
[out]presentSet to true if a t0 value was provided, false if not specified.
Returns
Formatted t0 string, e.g.: "t0 250\\n" Returns empty string if t0 is not specified.

Definition at line 297 of file PGetSingleHistoRunBlockDialog.cpp.

◆ helpContent

void PGetSingleHistoRunBlockDialog::helpContent ( )
privateslot

Opens the online help for single histogram RUN blocks.

Opens the online help documentation for single histogram RUN blocks.

Attempts to open the help URL in the system's default web browser using QDesktopServices. If the URL is empty, displays an informational message. If the browser fails to open, displays an error message with a clickable link.

Definition at line 374 of file PGetSingleHistoRunBlockDialog.cpp.

Member Data Documentation

◆ fHelpUrl

QString PGetSingleHistoRunBlockDialog::fHelpUrl
private

URL to the online documentation for single histogram RUN blocks.

Definition at line 143 of file PGetSingleHistoRunBlockDialog.h.


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