62#define THEORY_UNDEFINED -1
66#define THEORY_ASYMMETRY 1
68#define THEORY_SIMPLE_EXP 2
70#define THEORY_GENERAL_EXP 3
72#define THEORY_SIMPLE_GAUSS 4
74#define THEORY_STATIC_GAUSS_KT 5
76#define THEORY_STATIC_GAUSS_KT_LF 6
78#define THEORY_DYNAMIC_GAUSS_KT_LF 7
80#define THEORY_STATIC_LORENTZ_KT 8
82#define THEORY_STATIC_LORENTZ_KT_LF 9
84#define THEORY_DYNAMIC_LORENTZ_KT_LF 10
86#define THEORY_DYNAMIC_GAULOR_FAST_KT_ZF 11
88#define THEORY_DYNAMIC_GAULOR_FAST_KT_LF 12
90#define THEORY_DYNAMIC_GAULOR_KT_LF 13
92#define THEORY_COMBI_LGKT 14
94#define THEORY_STR_KT 15
96#define THEORY_SPIN_GLASS 16
98#define THEORY_RANDOM_ANISOTROPIC_HYPERFINE 17
100#define THEORY_ABRAGAM 18
102#define THEORY_TF_COS 19
104#define THEORY_INTERNAL_FIELD 20
106#define THEORY_INTERNAL_FIELD_KORNILOV 21
108#define THEORY_INTERNAL_FIELD_LARKIN 22
110#define THEORY_BESSEL 23
112#define THEORY_INTERNAL_BESSEL 24
114#define THEORY_SKEWED_GAUSS 25
116#define THEORY_STATIC_ZF_NK 26
118#define THEORY_STATIC_TF_NK 27
120#define THEORY_DYNAMIC_ZF_NK 28
122#define THEORY_DYNAMIC_TF_NK 29
124#define THEORY_F_MU_F 30
126#define THEORY_MU_MINUS_EXP 31
128#define THEORY_POLYNOM 32
130#define THEORY_USER_FCN 33
143#define THEORY_PARAM_CONST 1
144#define THEORY_PARAM_ASYMMETRY 1
145#define THEORY_PARAM_SIMPLE_EXP 1
146#define THEORY_PARAM_GENERAL_EXP 2
147#define THEORY_PARAM_SIMPLE_GAUSS 1
148#define THEORY_PARAM_STATIC_GAUSS_KT 1
149#define THEORY_PARAM_STATIC_GAUSS_KT_LF 2
150#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF 3
151#define THEORY_PARAM_STATIC_LORENTZ_KT 1
152#define THEORY_PARAM_STATIC_LORENTZ_KT_LF 2
153#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF 3
154#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF 2
155#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF 3
156#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF 3
157#define THEORY_PARAM_COMBI_LGKT 2
158#define THEORY_PARAM_STR_KT 2
159#define THEORY_PARAM_SPIN_GLASS 3
160#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE 2
161#define THEORY_PARAM_ABRAGAM 2
162#define THEORY_PARAM_TF_COS 2
163#define THEORY_PARAM_INTERNAL_FIELD 5
164#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV 5
165#define THEORY_PARAM_INTERNAL_FIELD_LARKIN 4
166#define THEORY_PARAM_BESSEL 2
167#define THEORY_PARAM_INTERNAL_BESSEL 5
168#define THEORY_PARAM_SKEWED_GAUSS 4
169#define THEORY_PARAM_STATIC_ZF_NK 2
170#define THEORY_PARAM_STATIC_TF_NK 4
171#define THEORY_PARAM_DYNAMIC_ZF_NK 3
172#define THEORY_PARAM_DYNAMIC_TF_NK 5
173#define THEORY_PARAM_F_MU_F 1
174#define THEORY_PARAM_MU_MINUS_EXP 6
192#define THEORY_MAX_PARAM 10
202#define DEG_TO_RAD 0.0174532925199432955
210#define TWO_PI 6.28318530717958623
243 "const",
"c",
"",
""},
246 "asymmetry",
"a",
"",
""},
249 "simplExpo",
"se",
"(rate)",
"(rate tshift)"},
252 "generExpo",
"ge",
"(rate exponent)",
"(rate exponent tshift)"},
255 "simpleGss",
"sg",
"(rate)",
"(rate tshift)"},
258 "statGssKt",
"stg",
"(rate)",
"(rate tshift)"},
261 "statGssKTLF",
"sgktlf",
"(frequency damping)",
"(frequency damping tshift)"},
264 "dynGssKTLF",
"dgktlf",
"(frequency damping hopping-rate)",
"(frequency damping hopping-rate tshift)"},
267 "statExpKT",
"sekt",
"(rate)",
"(rate tshift)"},
270 "statExpKTLF",
"sektlf",
"(frequency damping)",
"(frequency damping tshift)"},
273 "dynExpKTLF",
"dektlf",
"(frequency damping hopping-rate)",
"(frequency damping hopping-rate tshift)"},
276 "dynGLKT_F_ZF",
"dglktfzf",
"(damping hopping-rate)",
"(damping hopping-rate tshift)"},
279 "dynGLKT_F_LF",
"dglktflf",
"(frequency damping hopping-rate)",
"(frequency damping hopping-rate tshift)"},
282 "dynGLKT_LF",
"dglktlf",
"(frequency damping hopping-rate)",
"(frequency damping hopping-rate tshift)"},
285 "combiLGKT",
"lgkt",
"(lorentzRate gaussRate)",
"(lorentzRate gaussRate tshift)"},
288 "strKT",
"skt",
"(rate beta)",
"(rate beta tshift)"},
291 "spinGlass",
"spg",
"(rate hopprate order)",
"(rate hopprate order tshift)"},
294 "rdAnisoHf",
"rahf",
"(frequency rate)",
"(frequency rate tshift)"},
297 "abragam",
"ab",
"(rate hopprate)",
"(rate hopprate tshift)"},
300 "TFieldCos",
"tf",
"(phase frequency)",
"(phase frequency tshift)"},
303 "internFld",
"ifld",
"(fraction phase frequency Trate Lrate)",
"(fraction phase frequency Trate Lrate tshift)"},
306 "internFldGK",
"ifgk",
"(fraction frequency sigma lambda beta)",
"(fraction frequency sigma lambda beta tshift)"},
309 "internFldLL",
"ifll",
"(fraction frequency sigma lambda beta)",
"(fraction frequency sigma lambda beta tshift)"},
312 "bessel",
"b",
"(phase frequency)",
"(phase frequency tshift)"},
315 "internBsl",
"ib",
"(fraction phase frequency Trate Lrate)",
"(fraction phase frequency Trate Lrate tshift)"},
318 "skewedGss",
"skg",
"(phase frequency rate_m rate_p)",
"(phase frequency rate_m rate_p tshift)"},
321 "staticNKZF",
"snkzf",
"(damping_D0 R_b)",
"(damping_D0 R_b tshift)"},
324 "staticNKTF",
"snktf",
"(phase frequency damping_D0 R_b)",
"(phase frequency damping_D0 R_b tshift)"},
327 "dynamicNKZF",
"dnkzf",
"(damping_D0 R_b nu_c)",
"(damping_D0 R_b nu_c tshift)"},
330 "dynamicNKTF",
"dnktf",
"(phase frequency damping_D0 R_b nu_c)",
"(phase frequency damping_D0 R_b nu_c tshift)"},
333 "F_mu_F",
"fmuf",
"(frequency)",
"(frequency tshift)"},
336 "muMinusExpTF",
"mmsetf",
"(N0 tau A lambda phase nu)",
"(N0 tau A lambda phase nu tshift)"},
339 "polynom",
"p",
"(tshift p0 p1 ... pn)",
"(tshift p0 p1 ... pn)"},
342 "userFcn",
"u",
"",
""}
std::vector< PMsrLineStructure > PMsrLines
std::vector< Double_t > PDoubleVector
#define THEORY_PARAM_STATIC_ZF_NK
static PTheoDataBase fgTheoDataBase[THEORY_MAX]
#define THEORY_GENERAL_EXP
General exponential relaxation: exp(-(λt)^β)
#define THEORY_DYNAMIC_LORENTZ_KT_LF
Dynamic Lorentzian Kubo-Toyabe in longitudinal field.
#define THEORY_RANDOM_ANISOTROPIC_HYPERFINE
Random anisotropic hyperfine coupling.
struct theo_data_base PTheoDataBase
#define THEORY_CONST
Constant value (baseline, background)
#define THEORY_DYNAMIC_GAUSS_KT_LF
Dynamic Gaussian Kubo-Toyabe in longitudinal field.
#define THEORY_ABRAGAM
Abragam relaxation function (diffusion)
#define THEORY_ASYMMETRY
Initial asymmetry (multiplicative factor)
#define THEORY_PARAM_SIMPLE_GAUSS
#define THEORY_PARAM_STATIC_LORENTZ_KT_LF
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF
#define THEORY_SIMPLE_GAUSS
Simple Gaussian relaxation: exp(-σ²t²/2)
#define THEORY_PARAM_INTERNAL_FIELD_LARKIN
#define THEORY_PARAM_BESSEL
#define THEORY_STATIC_ZF_NK
Static Nakajima zero-field function.
#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF
#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE
#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF
#define THEORY_MU_MINUS_EXP
Negative muon (μ-) exponential TF decay.
#define THEORY_PARAM_GENERAL_EXP
#define THEORY_SIMPLE_EXP
Simple exponential relaxation: exp(-λt)
#define THEORY_PARAM_F_MU_F
#define THEORY_INTERNAL_BESSEL
Internal Bessel (field distribution with Bessel)
#define THEORY_SPIN_GLASS
Spin glass order parameter function.
#define THEORY_STATIC_GAUSS_KT
Static Gaussian Kubo-Toyabe (zero-field)
#define THEORY_DYNAMIC_ZF_NK
Dynamic Nakajima zero-field function.
#define THEORY_TF_COS
Transverse field cosine precession.
#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF
#define THEORY_POLYNOM
Polynomial function (arbitrary order)
#define THEORY_PARAM_INTERNAL_FIELD
#define THEORY_PARAM_ASYMMETRY
#define THEORY_PARAM_SIMPLE_EXP
#define THEORY_STATIC_GAUSS_KT_LF
Static Gaussian Kubo-Toyabe in longitudinal field.
#define THEORY_PARAM_ABRAGAM
#define THEORY_INTERNAL_FIELD_LARKIN
Internal field (Larkin-Ovchinnikov model)
#define THEORY_DYNAMIC_GAULOR_FAST_KT_ZF
Fast dynamic Gauss-Lorentz Kubo-Toyabe (zero-field)
#define THEORY_INTERNAL_FIELD
Internal magnetic field distribution (superconductors)
#define THEORY_INTERNAL_FIELD_KORNILOV
Internal field (Kornilov vortex lattice model)
#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV
#define THEORY_DYNAMIC_TF_NK
Dynamic Nakajima transverse field function.
#define THEORY_PARAM_STATIC_TF_NK
#define THEORY_PARAM_COMBI_LGKT
#define THEORY_PARAM_INTERNAL_BESSEL
#define THEORY_BESSEL
Bessel function (modulated precession)
#define THEORY_PARAM_DYNAMIC_TF_NK
#define THEORY_STATIC_TF_NK
Static Nakajima transverse field function.
#define THEORY_PARAM_SKEWED_GAUSS
#define THEORY_DYNAMIC_GAULOR_FAST_KT_LF
Fast dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
#define THEORY_PARAM_STATIC_LORENTZ_KT
#define THEORY_STR_KT
Stretched Kubo-Toyabe relaxation.
#define THEORY_F_MU_F
F-μ-F (μ-fluorine) oscillation.
#define THEORY_PARAM_CONST
#define THEORY_PARAM_STATIC_GAUSS_KT
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF
#define THEORY_STATIC_LORENTZ_KT
Static Lorentzian Kubo-Toyabe (zero-field)
#define THEORY_PARAM_MU_MINUS_EXP
#define THEORY_PARAM_STR_KT
#define THEORY_USER_FCN
User-defined external function (shared library)
#define THEORY_PARAM_SPIN_GLASS
#define THEORY_SKEWED_GAUSS
Skewed Gaussian relaxation (asymmetric rates)
#define THEORY_PARAM_TF_COS
#define THEORY_COMBI_LGKT
Combined Lorentzian-Gaussian Kubo-Toyabe.
#define THEORY_PARAM_STATIC_GAUSS_KT_LF
#define THEORY_DYNAMIC_GAULOR_KT_LF
Dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
#define THEORY_STATIC_LORENTZ_KT_LF
Static Lorentzian Kubo-Toyabe in longitudinal field.
#define THEORY_PARAM_DYNAMIC_ZF_NK
MSR file parser and manager for the musrfit framework.
Theory function evaluator and expression tree manager.
virtual Double_t DynamicGauLorKTLF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Dynamic Gaussian-Lorentzian KT (LF). Full numerical calculation.
virtual ~PTheory()
Destructor that recursively cleans up the expression tree.
virtual Double_t Constant(const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Returns constant value. Formula: c.
virtual Double_t Abragam(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Abragam relaxation. Motional narrowing formula.
virtual void CalculateGaussLFIntegral(const Double_t *val) const
Calculates and caches Gaussian LF integral for static KT.
Bool_t fValid
True if this theory node and its parse state are valid.
PTheory * fAdd
Pointer to addition child node (left branch of tree)
virtual void MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
Formats a polynomial theory line with proper spacing.
Double_t fDynLFdt
Time step for dynamic LF integral equation.
PUserFcnBase * fUserFcn
Pointer to instantiated user function object.
PDoubleVector fUserParam
Resolved parameter values for user function calls.
virtual Int_t GetUserFcnIdx(UInt_t lineNo) const
Returns the index of user functions up to the given line.
Double_t fSamplingTime
Time step for LF integral calculation (default 1 ns = 0.001 μs)
PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent=false)
Constructor that parses the THEORY block and builds the expression tree.
virtual Double_t SimpleGauss(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Simple Gaussian relaxation. Formula: exp(-σ²t²/2)
PDoubleVector fLFIntegral
Cached static LF KT integral values.
virtual Int_t SearchDataBase(TString name)
Searches fgTheoDataBase for a function by name or abbreviation.
virtual Double_t TFCos(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Transverse field cosine. Formula: cos(φ + 2πνt)
virtual Double_t StaticGaussKTLF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Gaussian Kubo-Toyabe (LF). Requires numerical integration.
virtual Double_t StaticLorentzKT(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Lorentzian Kubo-Toyabe (ZF). Formula: 1/3 + 2/3(1-at)exp(-at)
PDoubleVector fDyn_GL_LFFuncValue
Cached dynamic Gauss-Lorentz LF KT values.
virtual Double_t StaticNKZF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Nakajima-Keren (ZF). Combined nuclear and electronic relaxation.
virtual Double_t DynamicGaussKTLF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Dynamic Gaussian Kubo-Toyabe (LF). Strong collision model.
virtual Double_t GetLFIntegralValue(const Double_t t) const
Retrieves cached LF integral value at time t using interpolation.
virtual Double_t Asymmetry(const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Returns asymmetry value. Formula: A.
PTheory * fMul
Pointer to multiplication child node (right branch of tree)
virtual Double_t DynamicNKZF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Dynamic Nakajima-Keren (ZF). With spin fluctuations.
virtual Double_t StrKT(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Stretched Kubo-Toyabe. Formula: exp(-(σt)^β) with KT-like recovery.
virtual Double_t GeneralExp(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
General (stretched) exponential. Formula: exp(-(λt)^β)
Double_t fPrevParam[THEORY_MAX_PARAM]
Previous parameter values for cache invalidation check.
virtual Double_t DynamicGauLorKTZFFast(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Fast dynamic Gaussian-Lorentzian KT (ZF). Approximate fast calculation.
virtual Bool_t IsValid()
Checks if the entire theory expression tree is valid.
virtual Double_t RandomAnisotropicHyperfine(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Random anisotropic hyperfine coupling. Powder average of anisotropic coupling.
virtual void CalculateDynKTLF(const Double_t *val, Int_t tag) const
Calculates dynamic KT in LF using integral equation approach.
PDoubleVector fDynLFFuncValue
Cached dynamic Gaussian/Lorentzian LF KT values.
virtual Double_t InternalField(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Internal field distribution. Gaussian field distribution model.
Int_t fUserFcnIdx
Index of this user function among all userFcn entries (for global state)
TString fUserFcnClassName
ROOT class name for user function (e.g., "TMyFunction")
virtual Double_t InternalBessel(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Internal Bessel field distribution. Combines Bessel with relaxation.
virtual Double_t SkewedGauss(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Skewed Gaussian. Asymmetric relaxation rates before/after zero crossing.
virtual Double_t StaticGaussKT(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Gaussian Kubo-Toyabe (ZF). Formula: 1/3 + 2/3(1-σ²t²)exp(-σ²t²/2)
virtual Double_t DynamicLorentzKTLF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Dynamic Lorentzian Kubo-Toyabe (LF). Strong collision model.
virtual void CleanUp(PTheory *theo)
Recursively deletes child theory nodes (fAdd and fMul).
virtual Double_t InternalFieldGK(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Internal field (Kornilov model). Vortex lattice field distribution.
virtual void MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
Formats a user function theory line with proper spacing.
virtual Double_t DynamicNKTF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Dynamic Nakajima-Keren (TF). With spin fluctuations and precession.
virtual Double_t SimpleExp(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Simple exponential relaxation. Formula: exp(-λt)
virtual Double_t Func(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Evaluates the theory function at a given time point.
UInt_t fType
Theory function type (THEORY_CONST, THEORY_SIMPLE_EXP, etc.)
virtual Double_t GetDyn_GL_KTLFValue(const Double_t t) const
Retrieves cached dynamic Gauss-Lorentz KT LF value at time t.
std::vector< UInt_t > fParamNo
Resolved parameter indices (0-based). Values >= MSR_PARAM_FUN_OFFSET are function references.
virtual Double_t DynamicGauLorKTLFFast(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Fast dynamic Gaussian-Lorentzian KT (LF). Approximate fast calculation.
PMsrHandler * fMsrInfo
Pointer to MSR file handler (not owned)
virtual Double_t UserFcn(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
User-defined function. Calls external shared library function.
virtual Double_t Bessel(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Bessel function precession. Formula: J₀(2πνt + φ)
virtual void CalculateLorentzLFIntegral(const Double_t *val) const
Calculates and caches Lorentzian LF integral for static KT.
virtual Double_t SpinGlass(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Spin glass relaxation function. Edwards-Anderson order parameter.
virtual Double_t StaticNKTF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Nakajima-Keren (TF). Combined nuclear and electronic relaxation with precession.
virtual Double_t FmuF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
F-μ-F oscillation. Muon bound between two fluorine atoms.
virtual Double_t StaticLorentzKTLF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Static Lorentzian Kubo-Toyabe (LF). Requires numerical integration.
virtual Double_t CombiLGKT(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Combined Lorentzian-Gaussian KT. Product of both relaxation types.
virtual Double_t MuMinusExpTF(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
μ⁻ exponential TF. Negative muon in transverse field.
virtual Double_t Polynom(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Polynomial function. Formula: Σᵢ pᵢtⁱ
UInt_t fNoOfParam
Expected number of parameters for this function type.
virtual Double_t InternalFieldLL(Double_t t, const PDoubleVector ¶mValues, const PDoubleVector &funcValues) const
Internal field (Larkin-Ovchinnikov model). Vortex lattice field distribution.
virtual void MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
Reformats the theory block for clean MSR file output.
TString fUserFcnSharedLibName
Shared library path (e.g., "libMyFunctions.so")
virtual Double_t GetDynKTLFValue(const Double_t t) const
Retrieves cached dynamic KT LF value at time t.
Abstract base class for user-defined theory functions in musrfit.
UInt_t fType
Theory function type tag (THEORY_CONST, THEORY_SIMPLE_EXP, etc.)
TString fCommentTimeShift
Parameter list with time shift included.
Bool_t fTable
True if function requires pre-calculated lookup table (e.g., LF Kubo-Toyabe)
UInt_t fNoOfParam
Number of parameters (excluding optional time shift)
TString fAbbrev
Short abbreviation (e.g., "se", "stg")
TString fComment
Parameter list shown as help text in MSR file.
TString fName
Full function name for MSR files (e.g., "simplExpo", "statGssKt")