musrfit 1.10.0
PRunListCollection Class Reference

Manager class for all processed μSR run data during fitting. More...

#include <PRunListCollection.h>

Collaboration diagram for PRunListCollection:

Public Types

enum  EDataSwitch { kIndex , kRunNo }
 Enumeration for data access mode. More...
 

Public Member Functions

 PRunListCollection (PMsrHandler *msrInfo, PRunDataHandler *data, Bool_t theoAsdata=false)
 Constructor that initializes the collection.
 
virtual ~PRunListCollection ()
 Virtual destructor that cleans up all run objects.
 
virtual Bool_t Add (Int_t runNo, EPMusrHandleTag tag)
 Adds a run to the appropriate list based on fit type.
 
virtual void SetFitRange (const PDoublePairVector fitRange)
 Sets fit range for all runs (time-based or bin-based).
 
virtual void SetFitRange (const TString fitRange)
 Sets fit range from string specification (bin-based).
 
virtual Double_t GetSingleHistoChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all single histogram runs.
 
virtual Double_t GetSingleHistoRRFChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all single histogram RRF runs.
 
virtual Double_t GetAsymmetryChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all asymmetry runs.
 
virtual Double_t GetAsymmetryRRFChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all asymmetry RRF runs.
 
virtual Double_t GetAsymmetryBNMRChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all β-NMR asymmetry runs.
 
virtual Double_t GetMuMinusChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all mu-minus runs.
 
virtual Double_t GetNonMusrChisq (const std::vector< Double_t > &par) const
 Calculates total χ² for all non-μSR runs.
 
virtual Double_t GetSingleRunChisqExpected (const std::vector< Double_t > &par, const UInt_t idx) const
 Calculates expected χ² for a single run by index.
 
virtual Double_t GetSingleRunChisq (const std::vector< Double_t > &par, const UInt_t idx) const
 Calculates χ² for a single run by index.
 
Maximum Likelihood Calculation Methods (Global Fits)
virtual Double_t GetSingleHistoMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all single histogram runs.
 
virtual Double_t GetSingleHistoRRFMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all single histogram RRF runs.
 
virtual Double_t GetAsymmetryMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all asymmetry runs.
 
virtual Double_t GetAsymmetryRRFMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all asymmetry RRF runs.
 
virtual Double_t GetAsymmetryBNMRMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all β-NMR asymmetry runs.
 
virtual Double_t GetMuMinusMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all μ⁻ runs.
 
virtual Double_t GetNonMusrMaximumLikelihood (const std::vector< Double_t > &par) const
 Calculates total maximum likelihood for all non-μSR runs.
 
Single Run Maximum Likelihood Methods
virtual Double_t GetSingleRunMaximumLikelihoodExpected (const std::vector< Double_t > &par, const UInt_t idx) const
 Calculates expected maximum likelihood for a single run (theoretical expectation).
 
virtual Double_t GetSingleRunMaximumLikelihood (const std::vector< Double_t > &par, const UInt_t idx) const
 Calculates maximum likelihood for a single run.
 
Fit Statistics Methods
virtual UInt_t GetNoOfBinsFitted (const UInt_t idx) const
 Returns the number of bins fitted for a specific run.
 
virtual UInt_t GetTotalNoOfBinsFitted () const
 Returns total number of bins fitted across all runs.
 
Run Count Accessors
virtual UInt_t GetNoOfSingleHisto () const
 Returns the number of single histogram runs in the collection.
 
virtual UInt_t GetNoOfSingleHistoRRF () const
 Returns the number of single histogram RRF runs in the collection.
 
virtual UInt_t GetNoOfAsymmetry () const
 Returns the number of asymmetry runs in the collection.
 
virtual UInt_t GetNoOfAsymmetryRRF () const
 Returns the number of asymmetry RRF runs in the collection.
 
virtual UInt_t GetNoOfAsymmetryBNMR () const
 Returns the number of β-NMR asymmetry runs in the collection.
 
virtual UInt_t GetNoOfMuMinus () const
 Returns the number of μ⁻ runs in the collection.
 
virtual UInt_t GetNoOfNonMusr () const
 Returns the number of non-μSR runs in the collection.
 
Processed Data Accessors
virtual PRunDataGetSingleHisto (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for a single histogram run.
 
virtual PRunDataGetSingleHistoRRF (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for a single histogram RRF run.
 
virtual PRunDataGetAsymmetry (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for an asymmetry run.
 
virtual PRunDataGetAsymmetryRRF (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for an asymmetry RRF run.
 
virtual PRunDataGetAsymmetryBNMR (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for a β-NMR asymmetry run.
 
virtual PRunDataGetMuMinus (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for a μ⁻ run.
 
virtual PRunDataGetNonMusr (UInt_t index, EDataSwitch tag=kIndex)
 Retrieves processed data for a non-μSR run.
 

Experimental Metadata Accessors

Bool_t fTheoAsData
 Theory calculation mode flag.
 
PMsrHandlerfMsrInfo
 Pointer to MSR file handler (not owned).
 
PRunDataHandlerfData
 Pointer to raw data handler (not owned).
 
std::vector< PRunSingleHisto * > fRunSingleHistoList
 Collection of single histogram run objects.
 
std::vector< PRunSingleHistoRRF * > fRunSingleHistoRRFList
 Collection of single histogram RRF run objects.
 
std::vector< PRunAsymmetry * > fRunAsymmetryList
 Collection of asymmetry run objects.
 
std::vector< PRunAsymmetryRRF * > fRunAsymmetryRRFList
 Collection of asymmetry RRF run objects.
 
std::vector< PRunAsymmetryBNMR * > fRunAsymmetryBNMRList
 Collection of β-NMR asymmetry run objects.
 
std::vector< PRunMuMinus * > fRunMuMinusList
 Collection of μ⁻ (negative muon) run objects.
 
std::vector< PRunNonMusr * > fRunNonMusrList
 Collection of non-μSR run objects.
 
virtual const PDoublePairVectorGetTemp (const TString &runName) const
 Retrieves temperature information for a specific run.
 
virtual Double_t GetField (const TString &runName) const
 Retrieves magnetic field value for a specific run.
 
virtual Double_t GetEnergy (const TString &runName) const
 Retrieves beam energy for a specific run.
 
virtual const Char_t * GetSetup (const TString &runName) const
 Retrieves experimental setup identifier for a specific run.
 
virtual const Char_t * GetXAxisTitle (const TString &runName, const UInt_t idx) const
 Retrieves x-axis label for plotting.
 
virtual const Char_t * GetYAxisTitle (const TString &runName, const UInt_t idx) const
 Retrieves y-axis label for plotting.
 

Detailed Description

Manager class for all processed μSR run data during fitting.

PRunListCollection is the central orchestrator for musrfit, managing all processed run data and serving as the interface between the MINUIT minimizer and the various run types. It acts as a container and dispatcher for different fit types, routing χ² and maximum likelihood calculations to the appropriate run objects.

Architecture

The collection maintains separate lists for each fit type:

  • Single Histogram: Basic time-differential μSR (one detector)
  • Single Histogram RRF: Single detector in rotating reference frame
  • Asymmetry: Forward-backward asymmetry fits
  • Asymmetry RRF: Asymmetry in rotating reference frame
  • Asymmetry β-NMR: Beta-detected NMR asymmetry
  • Mu-Minus: Negative muon fits (different lifetime)
  • Non-μSR: General time-series data fits

Core Responsibilities

Run management:

  • Creating and storing PRunBase-derived objects for each run
  • Organizing runs by fit type for efficient access
  • Managing run lifetime and cleanup

MINUIT interface:

  • Aggregating χ² from all runs of each type
  • Providing maximum likelihood calculations
  • Supporting both global fits (all runs) and single run evaluation
  • Calculating degrees of freedom (total bins fitted)

Fit range management:

  • Dynamically updating fit ranges via COMMAND block
  • Supporting both time-based and bin-based range specifications
  • Applying ranges to appropriate run lists

Data access:

  • Retrieving processed data for plotting
  • Accessing metadata (field, temperature, energy)
  • Supporting access by index or run number

Processing Workflow

  1. Construction: Pass MSR handler and data handler
  2. Add runs: Call Add() for each RUN block to create appropriate run objects
  3. Fitting: MINUIT calls Get*Chisq() methods to evaluate fit quality
  4. Visualization: Retrieve processed data via Get*() methods for plotting

Fit Type Dispatching

The collection routes operations based on fit type:

  • fittype 0: Single histogram → fRunSingleHistoList
  • fittype 1: Asymmetry → fRunAsymmetryList
  • fittype 2: Single histogram RRF → fRunSingleHistoRRFList
  • fittype 3: Asymmetry RRF → fRunAsymmetryRRFList
  • fittype 4: Mu-minus → fRunMuMinusList
  • fittype 5: β-NMR asymmetry → fRunAsymmetryBNMRList
  • fittype 6: Non-μSR → fRunNonMusrList

Global Fitting

For global fits (multiple runs sharing parameters):

  • Get*Chisq() methods sum χ² over all runs of that type
  • Each run is fitted with the same parameter set
  • Total χ² = Σ χ²_i across all runs
  • Degrees of freedom = Σ N_bins,i - N_parameters

Example Usage

// Create collection
PRunListCollection collection(msrInfo, dataHandler);
// Add all runs from MSR file
for (UInt_t i = 0; i < msrInfo->GetMsrRunList()->size(); i++) {
collection.Add(i, kFit);
}
// MINUIT minimization (called internally)
Double_t chisq = collection.GetAsymmetryChisq(parameters);
// Retrieve data for plotting
PRunData *data = collection.GetAsymmetry(0);
@ kFit
Fitting mode - perform least-squares fit to data.
Definition PMusr.h:415
PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data, Bool_t theoAsdata=false)
Constructor that initializes the collection.

Thread Safety

NOT thread-safe. MINUIT evaluation must be serialized. For parallel fitting of independent datasets, create separate PRunListCollection instances.

See also
PRunBase for individual run processing
PMsrHandler for MSR file configuration
PRunDataHandler for raw data access

Definition at line 140 of file PRunListCollection.h.

Member Enumeration Documentation

◆ EDataSwitch

Enumeration for data access mode.

Controls how runs are retrieved by Get*() methods:

  • kIndex: Retrieve by position in the list (0-based)
  • kRunNo: Retrieve by run number from MSR file
Enumerator
kIndex 
kRunNo 

Definition at line 170 of file PRunListCollection.h.

Constructor & Destructor Documentation

◆ PRunListCollection()

PRunListCollection::PRunListCollection ( PMsrHandler * msrInfo,
PRunDataHandler * data,
Bool_t theoAsData = false )

Constructor that initializes the collection.

Constructor initializing the run collection manager.

Creates an empty collection ready to receive runs via Add(). Does not automatically load runs - caller must explicitly add each run.

Parameters
msrInfoPointer to MSR file handler (must remain valid for object lifetime)
dataPointer to raw data handler (must remain valid for object lifetime)
theoAsDataIf true, theory calculated only at data points; if false, extra points for visualization

Creates an empty collection ready to receive processed run objects via Add() calls. The collection maintains separate lists for each fit type (single histogram, asymmetry, RRF variants, etc.) and dispatches operations to the appropriate lists.

Initialization:

  • Stores pointers to MSR file handler and raw data handler (not owned)
  • Sets theory calculation mode flag (for plotting vs. fitting)
  • All run lists start empty; populated via subsequent Add() calls

The typical workflow is:

  1. Create PRunListCollection
  2. Call Add() for each RUN block in MSR file
  3. Use Get*Chisq() or Get*MaximumLikelihood() during fitting
  4. Use Get*() accessors for visualization and analysis
Parameters
msrInfoPointer to MSR file handler (must remain valid for object lifetime)
dataPointer to raw data handler for loading histogram files
theoAsDataTheory calculation mode: true = at data points only, false = high-resolution grid
See also
Add() for adding processed runs to the collection

Definition at line 61 of file PRunListCollection.cpp.

References fData, fMsrInfo, and fTheoAsData.

◆ ~PRunListCollection()

PRunListCollection::~PRunListCollection ( )
virtual

Virtual destructor that cleans up all run objects.

Destructor that cleans up all run objects.

Calls CleanUp() and destructor for all run objects in all lists. Clears all run vectors. Does NOT delete fMsrInfo or fData (owned externally).

Systematically destroys all PRunBase-derived objects in the collection:

  1. Calls CleanUp() on each run object to release internal resources
  2. Explicitly calls destructor to free memory
  3. Clears the vector to release the pointer storage

This process is repeated for all seven run type lists:

  • Single histogram runs
  • Single histogram RRF runs
  • Asymmetry runs
  • Asymmetry RRF runs
  • β-NMR asymmetry runs
  • μ⁻ (mu-minus) runs
  • Non-μSR runs

The MSR handler (fMsrInfo) and data handler (fData) are NOT deleted as they are owned by the calling code.

Definition at line 89 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, and fRunSingleHistoRRFList.

Member Function Documentation

◆ Add()

Bool_t PRunListCollection::Add ( Int_t runNo,
EPMusrHandleTag tag )
virtual

Adds a run to the appropriate list based on fit type.

Adds a processed run to the appropriate list based on fit type.

Creates a PRunBase-derived object matching the fit type specified in the MSR file RUN block, processes the data, and adds it to the corresponding internal list. This is the primary method for populating the collection.

The method:

  1. Determines fit type from MSR RUN block (fittype 0-6)
  2. Creates appropriate PRunBase-derived object (PRunAsymmetry, etc.)
  3. Object loads and processes data in its constructor
  4. Adds object to correct list (fRunAsymmetryList, etc.)
Parameters
runNoRun number (0-based index into MSR file RUN blocks)
tagOperation mode: kFit (fitting), kView (visualization only)
Returns
True if run added successfully, false if creation/processing failed
Note
Invalid runs (failed data loading) are still added but marked invalid

Creates a new PRunBase-derived object for the specified MSR file RUN block and adds it to the appropriate type-specific list. The method performs fit type dispatching by:

  1. Reading fit type from the RUN block (if specified)
  2. Falling back to GLOBAL block fit type if not specified in RUN
  3. Creating the appropriate run object based on fit type
  4. Calling PrepareData() on the new object to load and process data
  5. Checking validity and returning success/failure status

Supported fit types and corresponding classes:

If data preprocessing fails (e.g., file not found, invalid t0, theory errors), the run object is still added to the list but marked as invalid, and this method returns false.

Parameters
runNoMSR file run number (0-based index into RUN blocks)
tagOperation mode: kFit (for fitting), kView (for display/plotting)
Returns
True if run was added and initialized successfully, false if initialization failed
See also
PRunBase::PrepareData() for data preprocessing details

Definition at line 168 of file PRunListCollection.cpp.

References fData, fMsrInfo, fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, fRunSingleHistoRRFList, fTheoAsData, PRUN_ASYMMETRY, PRUN_ASYMMETRY_BNMR, PRUN_ASYMMETRY_RRF, PRUN_MU_MINUS, PRUN_NON_MUSR, PRUN_SINGLE_HISTO, and PRUN_SINGLE_HISTO_RRF.

◆ GetAsymmetry()

PRunData * PRunListCollection::GetAsymmetry ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for an asymmetry run.

Provides access to calculated asymmetry data with proper error propagation, including α-corrected forward/backward combinations.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into asymmetry list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed asymmetry data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1069 of file PRunListCollection.cpp.

References fRunAsymmetryList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetAsymmetryBNMR()

PRunData * PRunListCollection::GetAsymmetryBNMR ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for a β-NMR asymmetry run.

Provides access to beta-detected NMR asymmetry data with helicity-dependent analysis and appropriate error handling.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into β-NMR asymmetry list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed asymmetry from beta-NMR data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1112 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList, kIndex, and kRunNo.

◆ GetAsymmetryBNMRChisq()

Double_t PRunListCollection::GetAsymmetryBNMRChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all β-NMR asymmetry runs.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all β-NMR runs

Calculates chi-square of all asymmetry BNMR runs of a msr-file.

return:

  • chi-square of all asymmetry BNMR runs of the msr-file
Parameters
parfit parameter vector

Definition at line 444 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList.

◆ GetAsymmetryBNMRMaximumLikelihood()

Double_t PRunListCollection::GetAsymmetryBNMRMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all β-NMR asymmetry runs.

Computes -2×ln(L) summed over all beta-detected NMR asymmetry runs. Handles helicity-dependent measurements with appropriate likelihood formula.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all β-NMR asymmetry runs

Since it is not clear yet how to handle asymmetry fits with max likelihood the chi square will be used!

return:

  • chi-square of all asymmetry BNMR runs of the msr-file
Parameters
parfit parameter vector

Definition at line 723 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList.

◆ GetAsymmetryChisq()

Double_t PRunListCollection::GetAsymmetryChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all asymmetry runs.

Calculates total χ² for all asymmetry runs (global fit metric).

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all asymmetry runs

Sums the chi-squared statistic over all asymmetry runs in the collection. For asymmetry fits, χ² is calculated from the asymmetry values:

\[ A_i = \frac{F_i - \alpha B_i}{F_i + \alpha B_i} \]

with proper error propagation. This is the objective function for global asymmetry fits involving multiple runs (e.g., temperature or field scans).

Parameters
parParameter vector from MINUIT with current parameter values
Returns
Total χ² summed over all asymmetry runs
See also
PRunAsymmetry::CalcChiSquare() for per-run asymmetry χ² calculation

Definition at line 402 of file PRunListCollection.cpp.

References fRunAsymmetryList.

◆ GetAsymmetryMaximumLikelihood()

Double_t PRunListCollection::GetAsymmetryMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all asymmetry runs.

Computes -2×ln(L) summed over all asymmetry runs. For asymmetry data, the likelihood is applied to the reconstructed forward/backward histograms rather than directly to the asymmetry values.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all asymmetry runs

Since it is not clear yet how to handle asymmetry fits with max likelihood the chi square will be used!

return:

  • chi-square of all asymmetry runs of the msr-file
Parameters
parfit parameter vector

Definition at line 679 of file PRunListCollection.cpp.

References fRunAsymmetryList.

◆ GetAsymmetryRRF()

PRunData * PRunListCollection::GetAsymmetryRRF ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for an asymmetry RRF run.

Provides access to RRF-transformed asymmetry data combining asymmetry calculation with rotating reference frame analysis.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into asymmetry RRF list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed asymmetry RRF data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1155 of file PRunListCollection.cpp.

References fRunAsymmetryRRFList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetAsymmetryRRFChisq()

Double_t PRunListCollection::GetAsymmetryRRFChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all asymmetry RRF runs.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all RRF asymmetry runs

Calculates chi-square of all asymmetry RRF runs of a msr-file.

return:

  • chi-square of all asymmetry RRF runs of the msr-file
Parameters
parfit parameter vector

Definition at line 423 of file PRunListCollection.cpp.

References fRunAsymmetryRRFList.

◆ GetAsymmetryRRFMaximumLikelihood()

Double_t PRunListCollection::GetAsymmetryRRFMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all asymmetry RRF runs.

Computes -2×ln(L) summed over all asymmetry rotating reference frame runs. Combines RRF transformation with asymmetry analysis in likelihood calculation.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all asymmetry RRF runs

Since it is not clear yet how to handle asymmetry fits with max likelihood the chi square will be used!

return:

  • chi-square of all asymmetry RRF runs of the msr-file
Parameters
parfit parameter vector

Definition at line 701 of file PRunListCollection.cpp.

References fRunAsymmetryRRFList.

◆ GetEnergy()

Double_t PRunListCollection::GetEnergy ( const TString & runName) const
virtual

Retrieves beam energy for a specific run.

Returns the muon beam implantation energy extracted from the raw data file header. Energy determines the stopping profile (implantation depth) in the sample.

Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
Returns
Beam energy in keV, or PMUSR_UNDEFINED if not available
Note
Low-energy muons (LE-μSR) typically: 1-30 keV; surface muons: ~4 MeV

Get the muon implantation energy from the data set.

return:

  • muon implantation energy stored in the data file.
Parameters
runNamename of the run from which to extract the muon implantation energy

Definition at line 1310 of file PRunListCollection.cpp.

References fData.

◆ GetField()

Double_t PRunListCollection::GetField ( const TString & runName) const
virtual

Retrieves magnetic field value for a specific run.

Returns the applied magnetic field extracted from the raw data file header. This is typically the field measured at the sample position.

Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
Returns
Magnetic field value in Gauss, or PMUSR_UNDEFINED if not available
Note
Field values may be recorded in various units (G, T, Oe) depending on facility

Get the magnetic field from the data set.

return:

  • magnetic field stored in the data file.
Parameters
runNamename of the run from which to extract the magnetic field

Definition at line 1294 of file PRunListCollection.cpp.

References fData.

◆ GetMuMinus()

PRunData * PRunListCollection::GetMuMinus ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for a μ⁻ run.

Provides access to negative muon data accounting for different decay properties compared to positive muons.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into μ⁻ list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed mu minus data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1198 of file PRunListCollection.cpp.

References fRunMuMinusList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetMuMinusChisq()

Double_t PRunListCollection::GetMuMinusChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all mu-minus runs.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all mu-minus runs

Calculates chi-square of all mu minus runs of a msr-file.

return:

  • chi-square of all mu minus runs of the msr-file
Parameters
parfit parameter vector

Definition at line 465 of file PRunListCollection.cpp.

References fRunMuMinusList.

◆ GetMuMinusMaximumLikelihood()

Double_t PRunListCollection::GetMuMinusMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all μ⁻ runs.

Computes -2×ln(L) summed over all negative muon runs. Negative muons have different decay characteristics than positive muons.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all μ⁻ runs

Calculates log max-likelihood of all mu minus runs of a msr-file.

return:

  • log max-likelihood of all mu minus runs of the msr-file
Parameters
parfit parameter vector

Definition at line 744 of file PRunListCollection.cpp.

References fRunMuMinusList.

◆ GetNonMusr()

PRunData * PRunListCollection::GetNonMusr ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for a non-μSR run.

Provides access to general time-series data (x-y pairs) processed through the same framework as μSR data but without μSR-specific assumptions.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into non-μSR list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed non-muSR data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1240 of file PRunListCollection.cpp.

References fRunNonMusrList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNonMusrChisq()

Double_t PRunListCollection::GetNonMusrChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all non-μSR runs.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all non-μSR runs

Calculates chi-square of all non-muSR runs of a msr-file.

return:

  • chi-square of all non-muSR runs of the msr-file
Parameters
parfit parameter vector

Definition at line 486 of file PRunListCollection.cpp.

References fRunNonMusrList.

◆ GetNonMusrMaximumLikelihood()

Double_t PRunListCollection::GetNonMusrMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all non-μSR runs.

Computes -2×ln(L) summed over all general time-series (non-μSR) data runs. Uses the same Poisson likelihood framework applied to generic x-y data.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all non-μSR runs

Since it is not clear yet how to handle non musr fits with max likelihood the chi square will be used!

return:

  • chi-square of all asymmetry runs of the msr-file
Parameters
parfit parameter vector

Definition at line 766 of file PRunListCollection.cpp.

References fRunNonMusrList.

◆ GetNoOfAsymmetry()

virtual UInt_t PRunListCollection::GetNoOfAsymmetry ( ) const
inlinevirtual

Returns the number of asymmetry runs in the collection.

Returns
Count of asymmetry data sets from MSR file

Definition at line 466 of file PRunListCollection.h.

References fRunAsymmetryList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNoOfAsymmetryBNMR()

virtual UInt_t PRunListCollection::GetNoOfAsymmetryBNMR ( ) const
inlinevirtual

Returns the number of β-NMR asymmetry runs in the collection.

Returns
Count of beta-detected NMR asymmetry data sets from MSR file

Definition at line 478 of file PRunListCollection.h.

References fRunAsymmetryBNMRList.

◆ GetNoOfAsymmetryRRF()

virtual UInt_t PRunListCollection::GetNoOfAsymmetryRRF ( ) const
inlinevirtual

Returns the number of asymmetry RRF runs in the collection.

Returns
Count of asymmetry rotating reference frame data sets from MSR file

Definition at line 472 of file PRunListCollection.h.

References fRunAsymmetryRRFList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNoOfBinsFitted()

UInt_t PRunListCollection::GetNoOfBinsFitted ( const UInt_t idx) const
virtual

Returns the number of bins fitted for a specific run.

Queries a single run to determine how many data bins fall within its fit range. This depends on:

  • The fit time range (start/end times from FIT block)
  • Time resolution and bin packing settings
  • Valid data range after background subtraction

Used for calculating degrees of freedom: ν = N_bins_total - N_params

Parameters
idxRun index (absolute index across all run lists)
Returns
Number of bins included in the fit for this run
See also
GetTotalNoOfBinsFitted() for total across all runs

Number of bins in run block idx to be fitted. Only used for single histogram fitting together with the expected chisq.

return:

  • number of bins fitted.
Parameters
idxrun block index

Definition at line 880 of file PRunListCollection.cpp.

References fMsrInfo, fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, fRunSingleHistoRRFList, PRUN_ASYMMETRY, PRUN_ASYMMETRY_BNMR, PRUN_ASYMMETRY_RRF, PRUN_MU_MINUS, PRUN_NON_MUSR, PRUN_SINGLE_HISTO, and PRUN_SINGLE_HISTO_RRF.

◆ GetNoOfMuMinus()

virtual UInt_t PRunListCollection::GetNoOfMuMinus ( ) const
inlinevirtual

Returns the number of μ⁻ runs in the collection.

Returns
Count of negative muon data sets from MSR file

Definition at line 484 of file PRunListCollection.h.

References fRunMuMinusList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNoOfNonMusr()

virtual UInt_t PRunListCollection::GetNoOfNonMusr ( ) const
inlinevirtual

Returns the number of non-μSR runs in the collection.

Returns
Count of general time-series (non-μSR) data sets from MSR file

Definition at line 490 of file PRunListCollection.h.

References fRunNonMusrList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNoOfSingleHisto()

virtual UInt_t PRunListCollection::GetNoOfSingleHisto ( ) const
inlinevirtual

Returns the number of single histogram runs in the collection.

Returns
Count of single histogram data sets from MSR file

Definition at line 454 of file PRunListCollection.h.

References fRunSingleHistoList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetNoOfSingleHistoRRF()

virtual UInt_t PRunListCollection::GetNoOfSingleHistoRRF ( ) const
inlinevirtual

Returns the number of single histogram RRF runs in the collection.

Returns
Count of single histogram rotating reference frame data sets from MSR file

Definition at line 460 of file PRunListCollection.h.

References fRunSingleHistoRRFList.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetSetup()

const Char_t * PRunListCollection::GetSetup ( const TString & runName) const
virtual

Retrieves experimental setup identifier for a specific run.

Returns the beamline or spectrometer name extracted from the raw data file header. This identifies the experimental station where data was collected.

Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
Returns
Setup name string (e.g., "GPS", "LTF", "DOLLY"), or nullptr if not available
Note
Setup names are facility-specific (PSI: GPS, LTF, HAL-9500; ISIS: EMU, ARGUS, etc.)

Get the setup information from the data set.

return:

  • setup information stored in the data file.
Parameters
runNamename of the run from which to extract the setup information

Definition at line 1326 of file PRunListCollection.cpp.

References fData.

◆ GetSingleHisto()

PRunData * PRunListCollection::GetSingleHisto ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for a single histogram run.

Provides access to the PRunData object containing background-corrected, packed histogram data with theory values and error bars.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into single histogram list (0-based)
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid
See also
PRunData for data structure contents

Get a processed single histogram data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 983 of file PRunListCollection.cpp.

References fRunSingleHistoList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetSingleHistoChisq()

Double_t PRunListCollection::GetSingleHistoChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all single histogram runs.

Calculates total χ² for all single histogram runs (global fit metric).

Sums χ² over all runs in fRunSingleHistoList. Each run compares its measured data with theory at the given parameters.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all single histogram runs

Sums the chi-squared statistic over all single histogram runs in the collection:

\[ \chi^2_{\rm total} = \sum_{i=1}^{N_{\rm runs}} \chi^2_i \]

where each run's χ² is:

\[ \chi^2_i = \sum_{j=1}^{N_{\rm bins,i}} \frac{(y_j^{\rm data} - y_j^{\rm theory})^2}{\sigma_j^2} \]

This is the objective function minimized by MINUIT during global fitting of multiple single histogram runs. Called repeatedly during each fit iteration.

Parameters
parParameter vector from MINUIT with current parameter values
Returns
Total χ² summed over all single histogram runs
See also
PRunSingleHisto::CalcChiSquare() for per-run χ² calculation

Definition at line 353 of file PRunListCollection.cpp.

References fRunSingleHistoList.

◆ GetSingleHistoMaximumLikelihood()

Double_t PRunListCollection::GetSingleHistoMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all single histogram runs.

Computes the negative 2×log-likelihood summed over all single histogram runs:

\[ -2\ln L_{\rm total} = \sum_{i=1}^{N_{\rm runs}} (-2\ln L_i) \]

For each run, the maximum likelihood is calculated using Poisson statistics:

\[ -2\ln L = 2\sum_{j=1}^{N_{\rm bins}} \left[y_j^{\rm theory} - y_j^{\rm data} \ln(y_j^{\rm theory})\right] \]

Maximum likelihood fitting is preferred over χ² for low-count data (< 10-20 counts/bin) where Gaussian approximations break down. It naturally handles Poisson statistics without requiring error estimates.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all single histogram runs
See also
CalcMaxLikelihood() in PRunBase for implementation details

Calculates log max-likelihood of all single histogram runs of a msr-file.

return:

  • log max-likelihood of all single histogram runs of the msr-file
Parameters
parfit parameter vector

Definition at line 636 of file PRunListCollection.cpp.

References fRunSingleHistoList.

◆ GetSingleHistoRRF()

PRunData * PRunListCollection::GetSingleHistoRRF ( UInt_t index,
EDataSwitch tag = kIndex )
virtual

Retrieves processed data for a single histogram RRF run.

Provides access to RRF-transformed single histogram data including filtered theory curves and RRF-specific metadata.

Parameters
indexRun identifier (interpretation depends on tag parameter)
tagAccess mode:
  • kIndex (default): Direct index into single histogram RRF list
  • kRunNumber: MSR file run number
Returns
Pointer to PRunData object, or nullptr if index is invalid

Get a processed single histogram RRF data set.

return:

  • pointer to the run data set (processed data) if data set is found
  • null pointer otherwise
Parameters
indexmsr-file run index
tagkIndex -> data at index, kRunNo -> data of given run no

Definition at line 1026 of file PRunListCollection.cpp.

References fRunSingleHistoRRFList, kIndex, and kRunNo.

Referenced by musrfit_dump_ascii(), and musrfit_dump_root().

◆ GetSingleHistoRRFChisq()

Double_t PRunListCollection::GetSingleHistoRRFChisq ( const std::vector< Double_t > & par) const
virtual

Calculates total χ² for all single histogram RRF runs.

Parameters
parParameter vector from MINUIT
Returns
Σ χ²_i for all RRF single histogram runs

Calculates chi-square of all single histogram RRF runs of a msr-file.

return:

  • chi-square of all single histogram RRF runs of the msr-file
Parameters
parfit parameter vector

Definition at line 374 of file PRunListCollection.cpp.

References fRunSingleHistoRRFList.

◆ GetSingleHistoRRFMaximumLikelihood()

Double_t PRunListCollection::GetSingleHistoRRFMaximumLikelihood ( const std::vector< Double_t > & par) const
virtual

Calculates total maximum likelihood for all single histogram RRF runs.

Computes -2×ln(L) summed over all single histogram rotating reference frame runs. Uses the same Poisson likelihood formula as GetSingleHistoMaximumLikelihood(), but applied to RRF-transformed data.

Parameters
parParameter vector from MINUIT
Returns
Total -2×ln(L) summed over all single histogram RRF runs

Calculates log max-likelihood of all single histogram RRF runs of a msr-file.

return:

  • log max-likelihood of all single histogram runs of the msr-file
Parameters
parfit parameter vector

Definition at line 657 of file PRunListCollection.cpp.

References fRunSingleHistoRRFList.

◆ GetSingleRunChisq()

Double_t PRunListCollection::GetSingleRunChisq ( const std::vector< Double_t > & par,
const UInt_t idx ) const
virtual

Calculates χ² for a single run by index.

Evaluates χ² for one specific run, searching across all fit type lists. Used for individual run analysis or diagnostics.

Parameters
parParameter vector from MINUIT
idxRun index (absolute index across all run lists)
Returns
χ² for the specified run

Calculates chi-square of a single run-block entry of the msr-file.

return:

  • chi-square of single run-block entry with index idx
Parameters
parfit parameter vector
idxrun block index

Definition at line 573 of file PRunListCollection.cpp.

References fMsrInfo, fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, fRunSingleHistoRRFList, PRUN_ASYMMETRY, PRUN_ASYMMETRY_BNMR, PRUN_ASYMMETRY_RRF, PRUN_MU_MINUS, PRUN_NON_MUSR, PRUN_SINGLE_HISTO, and PRUN_SINGLE_HISTO_RRF.

◆ GetSingleRunChisqExpected()

Double_t PRunListCollection::GetSingleRunChisqExpected ( const std::vector< Double_t > & par,
const UInt_t idx ) const
virtual

Calculates expected χ² for a single run by index.

Returns expected χ² based on theory and error estimates for one run. Useful for evaluating fit quality and error bar estimation.

Parameters
parParameter vector from MINUIT
idxRun index (searches all lists sequentially)
Returns
Expected χ² for the specified run

Calculates expected chi-square of the run block index idx of a msr-file.

return:

  • expected chi-square of for a single run block
Parameters
parfit parameter vector
idxrun block index

Definition at line 508 of file PRunListCollection.cpp.

References fMsrInfo, fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, fRunSingleHistoRRFList, PRUN_ASYMMETRY, PRUN_ASYMMETRY_BNMR, PRUN_ASYMMETRY_RRF, PRUN_MU_MINUS, PRUN_NON_MUSR, PRUN_SINGLE_HISTO, and PRUN_SINGLE_HISTO_RRF.

◆ GetSingleRunMaximumLikelihood()

Double_t PRunListCollection::GetSingleRunMaximumLikelihood ( const std::vector< Double_t > & par,
const UInt_t idx ) const
virtual

Calculates maximum likelihood for a single run.

Computes -2×ln(L) for a specific run identified by absolute index. This is useful for identifying problematic runs in a global fit or for analyzing individual run contributions to the total likelihood.

Parameters
parParameter vector from MINUIT
idxRun index (absolute index across all run lists)
Returns
-2×ln(L) for the specified run

Calculates mlh of a single run-block entry of the msr-file.

return:

  • mlh of single run-block entry with index idx
Parameters
parfit parameter vector
idxrun block index

Definition at line 834 of file PRunListCollection.cpp.

References fMsrInfo, fRunSingleHistoList, and PRUN_SINGLE_HISTO.

◆ GetSingleRunMaximumLikelihoodExpected()

Double_t PRunListCollection::GetSingleRunMaximumLikelihoodExpected ( const std::vector< Double_t > & par,
const UInt_t idx ) const
virtual

Calculates expected maximum likelihood for a single run (theoretical expectation).

Computes the expected -2×ln(L) value based on the theory predictions and error estimates for a specific run. Useful for statistical diagnostics and validating error bars. For properly estimated errors and valid model, expected likelihood should be comparable to actual likelihood.

Parameters
parParameter vector from MINUIT
idxRun index (absolute index across all run lists)
Returns
Expected -2×ln(L) for the specified run
Note
Not all run types implement this method; some may return 0.0

Calculates expected mlh of the run block index idx of a msr-file.

return:

  • expected mlh of for a single run block
Parameters
parfit parameter vector
idxrun block index

Definition at line 788 of file PRunListCollection.cpp.

References fMsrInfo, fRunSingleHistoList, and PRUN_SINGLE_HISTO.

◆ GetTemp()

const PDoublePairVector * PRunListCollection::GetTemp ( const TString & runName) const
virtual

Retrieves temperature information for a specific run.

Returns temperature data extracted from the raw data file header. Temperature may be recorded as a time-series (multiple values) or a single value depending on the data acquisition system.

Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
Returns
Pointer to vector of (time, temperature) pairs, or nullptr if not available
Note
Temperature units depend on the data file format (typically Kelvin or Celsius)

Get the temperature from the data set.

return:

  • temperature pair (T, dT) vector from temperatures stored in the data file.
Parameters
runNamename of the run from which to extract the temperature

Definition at line 1278 of file PRunListCollection.cpp.

References fData.

◆ GetTotalNoOfBinsFitted()

UInt_t PRunListCollection::GetTotalNoOfBinsFitted ( ) const
virtual

Returns total number of bins fitted across all runs.

Sums the number of fitted bins over all runs in the collection:

\[ N_{\rm bins,total} = \sum_{i=1}^{N_{\rm runs}} N_{\rm bins,i} \]

This is the numerator for calculating reduced chi-squared:

\[ \chi^2_{\rm red} = \frac{\chi^2}{N_{\rm bins,total} - N_{\rm params}} \]

For a good fit: χ²_red ≈ 1.0

Returns
Total number of bins across all runs within fit ranges
See also
GetNoOfBinsFitted() for single run bin count

Counts the total number of bins to be fitted.

return:

  • total number of bins fitted.

Definition at line 942 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, and fRunSingleHistoRRFList.

◆ GetXAxisTitle()

const Char_t * PRunListCollection::GetXAxisTitle ( const TString & runName,
const UInt_t idx ) const
virtual

Retrieves x-axis label for plotting.

Returns the appropriate x-axis title based on fit type and run settings. Typically "Time (μs)" for time-domain fits, "Frequency (MHz)" for Fourier transforms, or custom labels for non-μSR data.

Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
idxRun index within the specified fit type
Returns
X-axis title string, or nullptr if not available
See also
PRunData for plot axis information storage

Get the x-axis title (used with non-muSR fit).

return:

  • x-axis title
Parameters
runNamename of the run file
idxmsr-file run index

Definition at line 1343 of file PRunListCollection.cpp.

References fData, PRawRunData::fDataNonMusr, PNonMusrRawRunData::FromAscii(), fRunNonMusrList, and PNonMusrRawRunData::GetLabels().

◆ GetYAxisTitle()

const Char_t * PRunListCollection::GetYAxisTitle ( const TString & runName,
const UInt_t idx ) const
virtual

Retrieves y-axis label for plotting.

Returns the appropriate y-axis title based on fit type:

  • Single histogram: "Counts" or "Positron Rate (MHz)"
  • Asymmetry: "Asymmetry" or "Asymmetry (%)"
  • Custom labels for non-μSR data
Parameters
runNameRun identifier string (e.g., "2425" or "/path/to/run2425.root")
idxRun index within the specified fit type
Returns
Y-axis title string, or nullptr if not available
See also
PRunData for plot axis information storage

Get the y-axis title (used with non-muSR fit).

return:

  • y-axis title
Parameters
runNamename of the run file
idxmsr-file run index

Definition at line 1376 of file PRunListCollection.cpp.

References fData, PRawRunData::fDataNonMusr, PNonMusrRawRunData::FromAscii(), fRunNonMusrList, and PNonMusrRawRunData::GetLabels().

◆ SetFitRange() [1/2]

void PRunListCollection::SetFitRange ( const PDoublePairVector fitRange)
virtual

Sets fit range for all runs (time-based or bin-based).

Sets fit range in time units (microseconds from t0).

Updates the fitting window for all runs in the collection. Supports:

  • Single range applied to all runs
  • Individual ranges per run
Parameters
fitRangeVector of (start, end) pairs in microseconds

If one pair: applies to all runs. If multiple: fitRange[i] applies to run i.

Applies time-based fit ranges to all runs in the collection. This is the standard method for specifying fit ranges in the MSR file FIT block or during interactive range adjustments.

Range specification modes:

  • Global range: fitRange.size() == 1
    • Same (start, end) time pair applies to all runs
    • Example: {(0.1, 10.0)} → All runs fit from 0.1 μs to 10.0 μs after t0
  • Individual ranges: fitRange.size() == number of MSR file runs
    • Each run gets its own (start, end) time pair
    • fitRange[i] corresponds to MSR file RUN block i
    • Example: {(0.1, 10.0), (0.2, 8.0)} → Run 0: 0.1-10.0 μs, Run 1: 0.2-8.0 μs

Processing steps for each run:

  1. SetFitRange() updates internal start/end time members
  2. CalcNoOfFitBins() recalculates bin indices (fStartTimeBin, fEndTimeBin)

The bin recalculation is necessary because the fit range is initially specified in time but χ² calculation operates on bin indices.

Parameters
fitRangeVector of (start_time, end_time) pairs in microseconds (μs) from t0
See also
SetFitRange(TString) for bin-based range specification
PRunBase::CalcNoOfFitBins() for time-to-bin conversion

Definition at line 303 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, fRunSingleHistoRRFList, and SetFitRange().

Referenced by SetFitRange().

◆ SetFitRange() [2/2]

void PRunListCollection::SetFitRange ( const TString fitRange)
virtual

Sets fit range from string specification (bin-based).

Sets fit range in bin units using string specification (COMMANDS block syntax).

Parses and applies bin-based fit ranges from FIT_RANGE command. Format: "fgb[+offset] lgb[-offset]" for each run.

Parameters
fitRangeString with fit range specification

Example: "10+5 200-10" → bins [15, 190]

Parses and applies fit range specified in bin offsets from t0 markers. This method supports the COMMANDS block FIT_RANGE syntax used for dynamic range adjustments during optimization.

String format:

  • Single range: "fit_range fgb+n0 lgb-n1"
  • Multiple ranges: "fit_range fgb0+n00 lgb0-n01 fgb1+n10 lgb1-n11 ..."

Where:

  • fgb = first good bin (t0 marker from MSR file)
  • lgb = last good bin (end marker, often from data_range or automatic)
  • nXY = offset in bins (can be positive or negative)

Example:

  • "fit_range fgb+10 lgb-20" → Start 10 bins after t0, end 20 bins before last good bin
  • For multiple runs, each gets its own fgb/lgb pair in sequence

This method broadcasts the range specification to all run objects in all lists. Each run's SetFitRangeBin() method interprets the string based on its position in the MSR file.

Parameters
fitRangeString holding fit range specification in bin offsets
See also
SetFitRange(PDoublePairVector) for time-based range specification

Definition at line 253 of file PRunListCollection.cpp.

References fRunAsymmetryBNMRList, fRunAsymmetryList, fRunAsymmetryRRFList, fRunMuMinusList, fRunNonMusrList, fRunSingleHistoList, and fRunSingleHistoRRFList.

Member Data Documentation

◆ fData

PRunDataHandler* PRunListCollection::fData
private

Pointer to raw data handler (not owned).

Provides access to raw histogram data files via unified interface supporting multiple formats (ROOT, NeXus, MUD, PSI-BIN, etc.). Used during Add() calls to load data for each run.

Warning
This pointer is NOT owned by PRunListCollection and will not be deleted.

Definition at line 716 of file PRunListCollection.h.

Referenced by Add(), GetEnergy(), GetField(), GetSetup(), GetTemp(), GetXAxisTitle(), GetYAxisTitle(), and PRunListCollection().

◆ fMsrInfo

PMsrHandler* PRunListCollection::fMsrInfo
private

Pointer to MSR file handler (not owned).

Provides access to all MSR file content including PARAMETER, THEORY, FUNCTIONS, RUN, COMMANDS, FOURIER, and PLOT blocks. Must remain valid for the lifetime of this PRunListCollection object.

Warning
This pointer is NOT owned by PRunListCollection and will not be deleted.

Definition at line 705 of file PRunListCollection.h.

Referenced by Add(), GetNoOfBinsFitted(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetSingleRunMaximumLikelihood(), GetSingleRunMaximumLikelihoodExpected(), and PRunListCollection().

◆ fRunAsymmetryBNMRList

std::vector<PRunAsymmetryBNMR*> PRunListCollection::fRunAsymmetryBNMRList
private

Collection of β-NMR asymmetry run objects.

Each element is a PRunAsymmetryBNMR object for beta-detected NMR measurements with helicity-dependent analysis. Objects are owned by this vector.

See also
PRunAsymmetryBNMR for β-NMR asymmetry implementation

Definition at line 767 of file PRunListCollection.h.

Referenced by Add(), GetAsymmetryBNMR(), GetAsymmetryBNMRChisq(), GetAsymmetryBNMRMaximumLikelihood(), GetNoOfAsymmetryBNMR(), GetNoOfBinsFitted(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunAsymmetryList

std::vector<PRunAsymmetry*> PRunListCollection::fRunAsymmetryList
private

Collection of asymmetry run objects.

Each element is a PRunAsymmetry object containing calculated asymmetry data from forward/backward detector pairs. Objects are owned by this vector.

See also
PRunAsymmetry for asymmetry fit implementation

Definition at line 747 of file PRunListCollection.h.

Referenced by Add(), GetAsymmetry(), GetAsymmetryChisq(), GetAsymmetryMaximumLikelihood(), GetNoOfAsymmetry(), GetNoOfBinsFitted(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunAsymmetryRRFList

std::vector<PRunAsymmetryRRF*> PRunListCollection::fRunAsymmetryRRFList
private

Collection of asymmetry RRF run objects.

Each element is a PRunAsymmetryRRF object combining asymmetry calculation with RRF transformation for high-frequency analysis. Objects are owned by this vector.

See also
PRunAsymmetryRRF for RRF asymmetry implementation

Definition at line 757 of file PRunListCollection.h.

Referenced by Add(), GetAsymmetryRRF(), GetAsymmetryRRFChisq(), GetAsymmetryRRFMaximumLikelihood(), GetNoOfAsymmetryRRF(), GetNoOfBinsFitted(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunMuMinusList

std::vector<PRunMuMinus*> PRunListCollection::fRunMuMinusList
private

Collection of μ⁻ (negative muon) run objects.

Each element is a PRunMuMinus object for negative muon measurements with different decay characteristics than μ⁺. Objects are owned by this vector.

See also
PRunMuMinus for negative muon fit implementation

Definition at line 777 of file PRunListCollection.h.

Referenced by Add(), GetMuMinus(), GetMuMinusChisq(), GetMuMinusMaximumLikelihood(), GetNoOfBinsFitted(), GetNoOfMuMinus(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunNonMusrList

std::vector<PRunNonMusr*> PRunListCollection::fRunNonMusrList
private

Collection of non-μSR run objects.

Each element is a PRunNonMusr object for general time-series (x-y) data fits using the musrfit framework without μSR-specific assumptions. Objects are owned.

See also
PRunNonMusr for generic time-series fit implementation

Definition at line 787 of file PRunListCollection.h.

Referenced by Add(), GetNonMusr(), GetNonMusrChisq(), GetNonMusrMaximumLikelihood(), GetNoOfBinsFitted(), GetNoOfNonMusr(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), GetXAxisTitle(), GetYAxisTitle(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunSingleHistoList

std::vector<PRunSingleHisto*> PRunListCollection::fRunSingleHistoList
private

Collection of single histogram run objects.

Each element is a PRunSingleHisto object containing processed data for one single-detector histogram fit. Objects are heap-allocated and owned by this vector; deleted in destructor.

See also
PRunSingleHisto for single histogram fit implementation

Definition at line 727 of file PRunListCollection.h.

Referenced by Add(), GetNoOfBinsFitted(), GetNoOfSingleHisto(), GetSingleHisto(), GetSingleHistoChisq(), GetSingleHistoMaximumLikelihood(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetSingleRunMaximumLikelihood(), GetSingleRunMaximumLikelihoodExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fRunSingleHistoRRFList

std::vector<PRunSingleHistoRRF*> PRunListCollection::fRunSingleHistoRRFList
private

Collection of single histogram RRF run objects.

Each element is a PRunSingleHistoRRF object containing RRF-transformed single histogram data with Kaiser filtering. Objects are owned by this vector.

See also
PRunSingleHistoRRF for RRF single histogram implementation

Definition at line 737 of file PRunListCollection.h.

Referenced by Add(), GetNoOfBinsFitted(), GetNoOfSingleHistoRRF(), GetSingleHistoRRF(), GetSingleHistoRRFChisq(), GetSingleHistoRRFMaximumLikelihood(), GetSingleRunChisq(), GetSingleRunChisqExpected(), GetTotalNoOfBinsFitted(), SetFitRange(), SetFitRange(), and ~PRunListCollection().

◆ fTheoAsData

Bool_t PRunListCollection::fTheoAsData
private

Theory calculation mode flag.

Controls whether theory is calculated at:

  • true: Only at data point times (efficient for fitting, exact data-theory comparison)
  • false: On a high-resolution grid (smooth curves for visualization)

Set from MSR PLOT block. For fitting, always uses fTheoAsData=true internally regardless of this setting. This flag primarily affects plotting and export.

Definition at line 694 of file PRunListCollection.h.

Referenced by Add(), and PRunListCollection().


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