musrfit 1.10.0
PTheory.h File Reference
#include <TSystem.h>
#include <TString.h>
#include "PMusr.h"
#include "PMsrHandler.h"
#include "PUserFcnBase.h"
Include dependency graph for PTheory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  theo_data_base
 
class  PTheory
 Theory function evaluator and expression tree manager. More...
 

Macros

#define THEORY_UNDEFINED   -1
 Undefined or invalid theory function.
 
#define THEORY_CONST   0
 Constant value (baseline, background)
 
#define THEORY_ASYMMETRY   1
 Initial asymmetry (multiplicative factor)
 
#define THEORY_SIMPLE_EXP   2
 Simple exponential relaxation: exp(-λt)
 
#define THEORY_GENERAL_EXP   3
 General exponential relaxation: exp(-(λt)^β)
 
#define THEORY_SIMPLE_GAUSS   4
 Simple Gaussian relaxation: exp(-σ²t²/2)
 
#define THEORY_STATIC_GAUSS_KT   5
 Static Gaussian Kubo-Toyabe (zero-field)
 
#define THEORY_STATIC_GAUSS_KT_LF   6
 Static Gaussian Kubo-Toyabe in longitudinal field.
 
#define THEORY_DYNAMIC_GAUSS_KT_LF   7
 Dynamic Gaussian Kubo-Toyabe in longitudinal field.
 
#define THEORY_STATIC_LORENTZ_KT   8
 Static Lorentzian Kubo-Toyabe (zero-field)
 
#define THEORY_STATIC_LORENTZ_KT_LF   9
 Static Lorentzian Kubo-Toyabe in longitudinal field.
 
#define THEORY_DYNAMIC_LORENTZ_KT_LF   10
 Dynamic Lorentzian Kubo-Toyabe in longitudinal field.
 
#define THEORY_DYNAMIC_GAULOR_FAST_KT_ZF   11
 Fast dynamic Gauss-Lorentz Kubo-Toyabe (zero-field)
 
#define THEORY_DYNAMIC_GAULOR_FAST_KT_LF   12
 Fast dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
 
#define THEORY_DYNAMIC_GAULOR_KT_LF   13
 Dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
 
#define THEORY_COMBI_LGKT   14
 Combined Lorentzian-Gaussian Kubo-Toyabe.
 
#define THEORY_STR_KT   15
 Stretched Kubo-Toyabe relaxation.
 
#define THEORY_SPIN_GLASS   16
 Spin glass order parameter function.
 
#define THEORY_RANDOM_ANISOTROPIC_HYPERFINE   17
 Random anisotropic hyperfine coupling.
 
#define THEORY_ABRAGAM   18
 Abragam relaxation function (diffusion)
 
#define THEORY_TF_COS   19
 Transverse field cosine precession.
 
#define THEORY_INTERNAL_FIELD   20
 Internal magnetic field distribution (superconductors)
 
#define THEORY_INTERNAL_FIELD_KORNILOV   21
 Internal field (Kornilov vortex lattice model)
 
#define THEORY_INTERNAL_FIELD_LARKIN   22
 Internal field (Larkin-Ovchinnikov model)
 
#define THEORY_BESSEL   23
 Bessel function (modulated precession)
 
#define THEORY_INTERNAL_BESSEL   24
 Internal Bessel (field distribution with Bessel)
 
#define THEORY_SKEWED_GAUSS   25
 Skewed Gaussian relaxation (asymmetric rates)
 
#define THEORY_STATIC_ZF_NK   26
 Static Nakajima zero-field function.
 
#define THEORY_STATIC_TF_NK   27
 Static Nakajima transverse field function.
 
#define THEORY_DYNAMIC_ZF_NK   28
 Dynamic Nakajima zero-field function.
 
#define THEORY_DYNAMIC_TF_NK   29
 Dynamic Nakajima transverse field function.
 
#define THEORY_F_MU_F   30
 F-μ-F (μ-fluorine) oscillation.
 
#define THEORY_MU_MINUS_EXP   31
 Negative muon (μ-) exponential TF decay.
 
#define THEORY_POLYNOM   32
 Polynomial function (arbitrary order)
 
#define THEORY_USER_FCN   33
 User-defined external function (shared library)
 
#define THEORY_PARAM_CONST   1
 
#define THEORY_PARAM_ASYMMETRY   1
 
#define THEORY_PARAM_SIMPLE_EXP   1
 
#define THEORY_PARAM_GENERAL_EXP   2
 
#define THEORY_PARAM_SIMPLE_GAUSS   1
 
#define THEORY_PARAM_STATIC_GAUSS_KT   1
 
#define THEORY_PARAM_STATIC_GAUSS_KT_LF   2
 
#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF   3
 
#define THEORY_PARAM_STATIC_LORENTZ_KT   1
 
#define THEORY_PARAM_STATIC_LORENTZ_KT_LF   2
 
#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF   3
 
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF   2
 
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF   3
 
#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF   3
 
#define THEORY_PARAM_COMBI_LGKT   2
 
#define THEORY_PARAM_STR_KT   2
 
#define THEORY_PARAM_SPIN_GLASS   3
 
#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE   2
 
#define THEORY_PARAM_ABRAGAM   2
 
#define THEORY_PARAM_TF_COS   2
 
#define THEORY_PARAM_INTERNAL_FIELD   5
 
#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV   5
 
#define THEORY_PARAM_INTERNAL_FIELD_LARKIN   4
 
#define THEORY_PARAM_BESSEL   2
 
#define THEORY_PARAM_INTERNAL_BESSEL   5
 
#define THEORY_PARAM_SKEWED_GAUSS   4
 
#define THEORY_PARAM_STATIC_ZF_NK   2
 
#define THEORY_PARAM_STATIC_TF_NK   4
 
#define THEORY_PARAM_DYNAMIC_ZF_NK   3
 
#define THEORY_PARAM_DYNAMIC_TF_NK   5
 
#define THEORY_PARAM_F_MU_F   1
 
#define THEORY_PARAM_MU_MINUS_EXP   6
 
#define THEORY_MAX   34
 
#define THEORY_MAX_PARAM   10
 
#define DEG_TO_RAD   0.0174532925199432955
 
#define TWO_PI   6.28318530717958623
 

Typedefs

typedef struct theo_data_base PTheoDataBase
 

Variables

static PTheoDataBase fgTheoDataBase [THEORY_MAX]
 

Macro Definition Documentation

◆ DEG_TO_RAD

#define DEG_TO_RAD   0.0174532925199432955

Conversion factor from degrees to radians.

Value: π/180 = 0.017453292519943295

Used for phase parameters which are specified in degrees in MSR files but converted to radians for calculations.

Definition at line 202 of file PTheory.h.

Referenced by PTheory::Bessel(), PTheory::DynamicNKTF(), PTheory::InternalBessel(), PTheory::InternalField(), PTheory::SkewedGauss(), PTheory::StaticNKTF(), and PTheory::TFCos().

◆ THEORY_ABRAGAM

#define THEORY_ABRAGAM   18

Abragam relaxation function (diffusion)

Definition at line 100 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_ASYMMETRY

#define THEORY_ASYMMETRY   1

Initial asymmetry (multiplicative factor)

Definition at line 66 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_BESSEL

#define THEORY_BESSEL   23

Bessel function (modulated precession)

Definition at line 110 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_COMBI_LGKT

#define THEORY_COMBI_LGKT   14

Combined Lorentzian-Gaussian Kubo-Toyabe.

Definition at line 92 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_CONST

#define THEORY_CONST   0

Constant value (baseline, background)

Definition at line 64 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_GAULOR_FAST_KT_LF

#define THEORY_DYNAMIC_GAULOR_FAST_KT_LF   12

Fast dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.

Definition at line 88 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_GAULOR_FAST_KT_ZF

#define THEORY_DYNAMIC_GAULOR_FAST_KT_ZF   11

Fast dynamic Gauss-Lorentz Kubo-Toyabe (zero-field)

Definition at line 86 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_GAULOR_KT_LF

#define THEORY_DYNAMIC_GAULOR_KT_LF   13

Dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.

Definition at line 90 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_GAUSS_KT_LF

#define THEORY_DYNAMIC_GAUSS_KT_LF   7

Dynamic Gaussian Kubo-Toyabe in longitudinal field.

Definition at line 78 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_LORENTZ_KT_LF

#define THEORY_DYNAMIC_LORENTZ_KT_LF   10

Dynamic Lorentzian Kubo-Toyabe in longitudinal field.

Definition at line 84 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_TF_NK

#define THEORY_DYNAMIC_TF_NK   29

Dynamic Nakajima transverse field function.

Definition at line 122 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_DYNAMIC_ZF_NK

#define THEORY_DYNAMIC_ZF_NK   28

Dynamic Nakajima zero-field function.

Definition at line 120 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_F_MU_F

#define THEORY_F_MU_F   30

F-μ-F (μ-fluorine) oscillation.

Definition at line 124 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_GENERAL_EXP

#define THEORY_GENERAL_EXP   3

General exponential relaxation: exp(-(λt)^β)

Definition at line 70 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_INTERNAL_BESSEL

#define THEORY_INTERNAL_BESSEL   24

Internal Bessel (field distribution with Bessel)

Definition at line 112 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_INTERNAL_FIELD

#define THEORY_INTERNAL_FIELD   20

Internal magnetic field distribution (superconductors)

Definition at line 104 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_INTERNAL_FIELD_KORNILOV

#define THEORY_INTERNAL_FIELD_KORNILOV   21

Internal field (Kornilov vortex lattice model)

Definition at line 106 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_INTERNAL_FIELD_LARKIN

#define THEORY_INTERNAL_FIELD_LARKIN   22

Internal field (Larkin-Ovchinnikov model)

Definition at line 108 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_MAX

#define THEORY_MAX   34

Maximum number of theory functions in database.

This is the total number of built-in theory functions available, including all relaxation, precession, and special functions.

Definition at line 183 of file PTheory.h.

Referenced by PTheory::MakeCleanAndTidyTheoryBlock(), and PTheory::SearchDataBase().

◆ THEORY_MAX_PARAM

#define THEORY_MAX_PARAM   10

Maximum number of parameters for any theory function.

Used to allocate arrays for longitudinal field calculations where parameter values from previous iterations must be cached.

Definition at line 192 of file PTheory.h.

Referenced by PTheory::PTheory().

◆ THEORY_MU_MINUS_EXP

#define THEORY_MU_MINUS_EXP   31

Negative muon (μ-) exponential TF decay.

Definition at line 126 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_PARAM_ABRAGAM

#define THEORY_PARAM_ABRAGAM   2

Definition at line 161 of file PTheory.h.

◆ THEORY_PARAM_ASYMMETRY

#define THEORY_PARAM_ASYMMETRY   1

Definition at line 144 of file PTheory.h.

◆ THEORY_PARAM_BESSEL

#define THEORY_PARAM_BESSEL   2

Definition at line 166 of file PTheory.h.

◆ THEORY_PARAM_COMBI_LGKT

#define THEORY_PARAM_COMBI_LGKT   2

Definition at line 157 of file PTheory.h.

◆ THEORY_PARAM_CONST

#define THEORY_PARAM_CONST   1

Number of parameters for each theory function.

These constants define how many parameters each theory function requires, excluding optional time shift. If a function includes time shift, add 1 to the parameter count.

Parameters typically include: rates (λ, σ), frequencies (ω, ν), phases (φ), fractions, exponents (β), hopping rates (ν_hop), etc.

Definition at line 143 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF

#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF   3

Definition at line 155 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF

#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF   2

Definition at line 154 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_GAULOR_KT_LF

#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF   3

Definition at line 156 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_GAUSS_KT_LF

#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF   3

Definition at line 150 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF

#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF   3

Definition at line 153 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_TF_NK

#define THEORY_PARAM_DYNAMIC_TF_NK   5

Definition at line 172 of file PTheory.h.

◆ THEORY_PARAM_DYNAMIC_ZF_NK

#define THEORY_PARAM_DYNAMIC_ZF_NK   3

Definition at line 171 of file PTheory.h.

◆ THEORY_PARAM_F_MU_F

#define THEORY_PARAM_F_MU_F   1

Definition at line 173 of file PTheory.h.

◆ THEORY_PARAM_GENERAL_EXP

#define THEORY_PARAM_GENERAL_EXP   2

Definition at line 146 of file PTheory.h.

◆ THEORY_PARAM_INTERNAL_BESSEL

#define THEORY_PARAM_INTERNAL_BESSEL   5

Definition at line 167 of file PTheory.h.

◆ THEORY_PARAM_INTERNAL_FIELD

#define THEORY_PARAM_INTERNAL_FIELD   5

Definition at line 163 of file PTheory.h.

◆ THEORY_PARAM_INTERNAL_FIELD_KORNILOV

#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV   5

Definition at line 164 of file PTheory.h.

◆ THEORY_PARAM_INTERNAL_FIELD_LARKIN

#define THEORY_PARAM_INTERNAL_FIELD_LARKIN   4

Definition at line 165 of file PTheory.h.

◆ THEORY_PARAM_MU_MINUS_EXP

#define THEORY_PARAM_MU_MINUS_EXP   6

Definition at line 174 of file PTheory.h.

◆ THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE

#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE   2

Definition at line 160 of file PTheory.h.

◆ THEORY_PARAM_SIMPLE_EXP

#define THEORY_PARAM_SIMPLE_EXP   1

Definition at line 145 of file PTheory.h.

◆ THEORY_PARAM_SIMPLE_GAUSS

#define THEORY_PARAM_SIMPLE_GAUSS   1

Definition at line 147 of file PTheory.h.

◆ THEORY_PARAM_SKEWED_GAUSS

#define THEORY_PARAM_SKEWED_GAUSS   4

Definition at line 168 of file PTheory.h.

◆ THEORY_PARAM_SPIN_GLASS

#define THEORY_PARAM_SPIN_GLASS   3

Definition at line 159 of file PTheory.h.

◆ THEORY_PARAM_STATIC_GAUSS_KT

#define THEORY_PARAM_STATIC_GAUSS_KT   1

Definition at line 148 of file PTheory.h.

◆ THEORY_PARAM_STATIC_GAUSS_KT_LF

#define THEORY_PARAM_STATIC_GAUSS_KT_LF   2

Definition at line 149 of file PTheory.h.

◆ THEORY_PARAM_STATIC_LORENTZ_KT

#define THEORY_PARAM_STATIC_LORENTZ_KT   1

Definition at line 151 of file PTheory.h.

◆ THEORY_PARAM_STATIC_LORENTZ_KT_LF

#define THEORY_PARAM_STATIC_LORENTZ_KT_LF   2

Definition at line 152 of file PTheory.h.

◆ THEORY_PARAM_STATIC_TF_NK

#define THEORY_PARAM_STATIC_TF_NK   4

Definition at line 170 of file PTheory.h.

◆ THEORY_PARAM_STATIC_ZF_NK

#define THEORY_PARAM_STATIC_ZF_NK   2

Definition at line 169 of file PTheory.h.

◆ THEORY_PARAM_STR_KT

#define THEORY_PARAM_STR_KT   2

Definition at line 158 of file PTheory.h.

◆ THEORY_PARAM_TF_COS

#define THEORY_PARAM_TF_COS   2

Definition at line 162 of file PTheory.h.

◆ THEORY_POLYNOM

#define THEORY_POLYNOM   32

Polynomial function (arbitrary order)

Definition at line 128 of file PTheory.h.

Referenced by PTheory::Func(), and PTheory::PTheory().

◆ THEORY_RANDOM_ANISOTROPIC_HYPERFINE

#define THEORY_RANDOM_ANISOTROPIC_HYPERFINE   17

Random anisotropic hyperfine coupling.

Definition at line 98 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_SIMPLE_EXP

#define THEORY_SIMPLE_EXP   2

Simple exponential relaxation: exp(-λt)

Definition at line 68 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_SIMPLE_GAUSS

#define THEORY_SIMPLE_GAUSS   4

Simple Gaussian relaxation: exp(-σ²t²/2)

Definition at line 72 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_SKEWED_GAUSS

#define THEORY_SKEWED_GAUSS   25

Skewed Gaussian relaxation (asymmetric rates)

Definition at line 114 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_SPIN_GLASS

#define THEORY_SPIN_GLASS   16

Spin glass order parameter function.

Definition at line 96 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_GAUSS_KT

#define THEORY_STATIC_GAUSS_KT   5

Static Gaussian Kubo-Toyabe (zero-field)

Definition at line 74 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_GAUSS_KT_LF

#define THEORY_STATIC_GAUSS_KT_LF   6

Static Gaussian Kubo-Toyabe in longitudinal field.

Definition at line 76 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_LORENTZ_KT

#define THEORY_STATIC_LORENTZ_KT   8

Static Lorentzian Kubo-Toyabe (zero-field)

Definition at line 80 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_LORENTZ_KT_LF

#define THEORY_STATIC_LORENTZ_KT_LF   9

Static Lorentzian Kubo-Toyabe in longitudinal field.

Definition at line 82 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_TF_NK

#define THEORY_STATIC_TF_NK   27

Static Nakajima transverse field function.

Definition at line 118 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STATIC_ZF_NK

#define THEORY_STATIC_ZF_NK   26

Static Nakajima zero-field function.

Definition at line 116 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_STR_KT

#define THEORY_STR_KT   15

Stretched Kubo-Toyabe relaxation.

Definition at line 94 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_TF_COS

#define THEORY_TF_COS   19

Transverse field cosine precession.

Definition at line 102 of file PTheory.h.

Referenced by PTheory::Func().

◆ THEORY_UNDEFINED

#define THEORY_UNDEFINED   -1

Undefined or invalid theory function.

Theory function type tags.

These constants identify the built-in theory functions available in the THEORY block of MSR files. Each function represents a specific physical model for muon spin relaxation, precession, or depolarization.

Theory functions can be combined using addition (+) and multiplication (*):

  • Addition: Independent relaxation channels (e.g., 1/3 fast + 2/3 slow)
  • Multiplication: Multiple relaxation mechanisms (e.g., precession * damping)

Categories:

  • Basic: Constants, asymmetries, simple exponentials
  • Static relaxation: Gaussian, Lorentzian (Kubo-Toyabe)
  • Dynamic relaxation: Motional narrowing, spin fluctuations
  • Precession: Cosine, Bessel functions for oscillations
  • Vortex lattice: Internal field distributions in superconductors
  • Special: Spin glass, Abragam, mu-minus, polynomials, user functions

Definition at line 62 of file PTheory.h.

Referenced by PTheory::MakeCleanAndTidyTheoryBlock(), PTheory::PTheory(), and PTheory::SearchDataBase().

◆ THEORY_USER_FCN

#define THEORY_USER_FCN   33

User-defined external function (shared library)

Definition at line 130 of file PTheory.h.

Referenced by PTheory::Func(), and PTheory::PTheory().

◆ TWO_PI

#define TWO_PI   6.28318530717958623

Typedef Documentation

◆ PTheoDataBase

typedef struct theo_data_base PTheoDataBase

Database entry for a theory function definition.

This structure stores metadata about each built-in theory function, including its identifier, parameter count, name, abbreviation, and help text. The database is used for:

  • Parsing THEORY block entries in MSR files
  • Validating parameter counts
  • Generating help text and documentation
  • Writing theory blocks with correct syntax

Variable Documentation

◆ fgTheoDataBase

PTheoDataBase fgTheoDataBase[THEORY_MAX]
static

Holds the functions available for the user.

Definition at line 240 of file PTheory.h.

Referenced by PTheory::MakeCleanAndTidyTheoryBlock(), PTheory::PTheory(), and PTheory::SearchDataBase().