musrfit 1.10.0
PTheory.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PTheory.h
4
5 Author: Andreas Suter
6 e-mail: andreas.suter@psi.ch
7
8***************************************************************************/
9
10/***************************************************************************
11 * Copyright (C) 2007-2026 by Andreas Suter *
12 * andreas.suter@psi.ch *
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29
30#ifndef _PTHEORY_H_
31#define _PTHEORY_H_
32
33#include <TSystem.h>
34#include <TString.h>
35
36#include "PMusr.h"
37#include "PMsrHandler.h"
38#include "PUserFcnBase.h"
39
40//-------------------------------------------------------------
60
62#define THEORY_UNDEFINED -1
64#define THEORY_CONST 0
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
131
132//-------------------------------------------------------------
143#define THEORY_PARAM_CONST 1 // const
144#define THEORY_PARAM_ASYMMETRY 1 // asymmetry
145#define THEORY_PARAM_SIMPLE_EXP 1 // damping (tshift)
146#define THEORY_PARAM_GENERAL_EXP 2 // damping, exponents (tshift)
147#define THEORY_PARAM_SIMPLE_GAUSS 1 // damping (tshift)
148#define THEORY_PARAM_STATIC_GAUSS_KT 1 // damping (tshift)
149#define THEORY_PARAM_STATIC_GAUSS_KT_LF 2 // frequency, damping (tshift)
150#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF 3 // frequency, damping, hop-rate (tshift)
151#define THEORY_PARAM_STATIC_LORENTZ_KT 1 // damping (tshift)
152#define THEORY_PARAM_STATIC_LORENTZ_KT_LF 2 // frequency, damping (tshift)
153#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF 3 // frequency, damping, hop-rate (tshift)
154#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF 2 // damping, hop-rate (tshift)
155#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF 3 // frequency, damping, hop-rate (tshift)
156#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF 3 // frequency, damping, hop-rate (tshift)
157#define THEORY_PARAM_COMBI_LGKT 2 // Lorentz rate, Gauss rate (tshift)
158#define THEORY_PARAM_STR_KT 2 // rate, exponent (tshift)
159#define THEORY_PARAM_SPIN_GLASS 3 // rate, hop-rate, order parameter (tshift)
160#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE 2 // frequency, rate (tshift)
161#define THEORY_PARAM_ABRAGAM 2 // rate, hop-rate (tshift)
162#define THEORY_PARAM_TF_COS 2 // phase, frequency (tshift)
163#define THEORY_PARAM_INTERNAL_FIELD 5 // fraction, phase, frequency, TF damping, damping (tshift)
164#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV 5 // fraction, frequency, TF damping, damping, beta (tshift)
165#define THEORY_PARAM_INTERNAL_FIELD_LARKIN 4 // fraction, frequency, TF damping, damping (tshift)
166#define THEORY_PARAM_BESSEL 2 // phase, frequency (tshift)
167#define THEORY_PARAM_INTERNAL_BESSEL 5 // fraction, phase, frequency, TF damping, LF damping (tshift)
168#define THEORY_PARAM_SKEWED_GAUSS 4 // phase, frequency, rate minus, rate plus (tshift)
169#define THEORY_PARAM_STATIC_ZF_NK 2 // damping D0, R_b=DGbG/D0 (tshift)
170#define THEORY_PARAM_STATIC_TF_NK 4 // phase, frequency, damping D0, R_b=DGbG/D0 (tshift)
171#define THEORY_PARAM_DYNAMIC_ZF_NK 3 // damping D0, R_b=DGbG/D0, nu_c (tshift)
172#define THEORY_PARAM_DYNAMIC_TF_NK 5 // phase, frequency, damping D0, R_b=DGbG/D0, nu_c (tshift)
173#define THEORY_PARAM_F_MU_F 1 // frequency (tshift)
174#define THEORY_PARAM_MU_MINUS_EXP 6 // N0, tau, A, damping, phase, frequency (tshift)
175
176//-------------------------------------------------------------
183#define THEORY_MAX 34
184
185//-------------------------------------------------------------
192#define THEORY_MAX_PARAM 10
193
194//-------------------------------------------------------------
202#define DEG_TO_RAD 0.0174532925199432955
203
210#define TWO_PI 6.28318530717958623
211
212class PTheory;
213
214//--------------------------------------------------------------------------------------
226typedef struct theo_data_base {
227 UInt_t fType;
228 UInt_t fNoOfParam;
229 Bool_t fTable;
230 TString fName;
231 TString fAbbrev;
232 TString fComment;
235
236//--------------------------------------------------------------------------------------
241
243 "const", "c", "", ""},
244
246 "asymmetry", "a", "", ""},
247
249 "simplExpo", "se", "(rate)", "(rate tshift)"},
250
252 "generExpo", "ge", "(rate exponent)", "(rate exponent tshift)"},
253
255 "simpleGss", "sg", "(rate)", "(rate tshift)"},
256
258 "statGssKt", "stg", "(rate)", "(rate tshift)"},
259
261 "statGssKTLF", "sgktlf", "(frequency damping)", "(frequency damping tshift)"},
262
264 "dynGssKTLF", "dgktlf", "(frequency damping hopping-rate)", "(frequency damping hopping-rate tshift)"},
265
267 "statExpKT", "sekt", "(rate)", "(rate tshift)"},
268
270 "statExpKTLF", "sektlf", "(frequency damping)", "(frequency damping tshift)"},
271
273 "dynExpKTLF", "dektlf", "(frequency damping hopping-rate)", "(frequency damping hopping-rate tshift)"},
274
276 "dynGLKT_F_ZF", "dglktfzf", "(damping hopping-rate)", "(damping hopping-rate tshift)"},
277
279 "dynGLKT_F_LF", "dglktflf", "(frequency damping hopping-rate)", "(frequency damping hopping-rate tshift)"},
280
282 "dynGLKT_LF", "dglktlf", "(frequency damping hopping-rate)", "(frequency damping hopping-rate tshift)"},
283
285 "combiLGKT", "lgkt", "(lorentzRate gaussRate)", "(lorentzRate gaussRate tshift)"},
286
288 "strKT", "skt", "(rate beta)", "(rate beta tshift)"},
289
291 "spinGlass", "spg", "(rate hopprate order)", "(rate hopprate order tshift)"},
292
294 "rdAnisoHf", "rahf", "(frequency rate)", "(frequency rate tshift)"},
295
297 "abragam", "ab", "(rate hopprate)", "(rate hopprate tshift)"},
298
300 "TFieldCos", "tf", "(phase frequency)", "(phase frequency tshift)"},
301
303 "internFld", "ifld", "(fraction phase frequency Trate Lrate)", "(fraction phase frequency Trate Lrate tshift)"},
304
306 "internFldGK", "ifgk", "(fraction frequency sigma lambda beta)", "(fraction frequency sigma lambda beta tshift)"},
307
309 "internFldLL", "ifll", "(fraction frequency sigma lambda beta)", "(fraction frequency sigma lambda beta tshift)"},
310
312 "bessel", "b", "(phase frequency)", "(phase frequency tshift)"},
313
315 "internBsl", "ib", "(fraction phase frequency Trate Lrate)", "(fraction phase frequency Trate Lrate tshift)"},
316
318 "skewedGss", "skg", "(phase frequency rate_m rate_p)", "(phase frequency rate_m rate_p tshift)"},
319
321 "staticNKZF", "snkzf", "(damping_D0 R_b)", "(damping_D0 R_b tshift)"},
322
324 "staticNKTF", "snktf", "(phase frequency damping_D0 R_b)", "(phase frequency damping_D0 R_b tshift)"},
325
327 "dynamicNKZF", "dnkzf", "(damping_D0 R_b nu_c)", "(damping_D0 R_b nu_c tshift)"},
328
330 "dynamicNKTF", "dnktf", "(phase frequency damping_D0 R_b nu_c)", "(phase frequency damping_D0 R_b nu_c tshift)"},
331
333 "F_mu_F", "fmuf", "(frequency)", "(frequency tshift)"},
334
336 "muMinusExpTF", "mmsetf", "(N0 tau A lambda phase nu)", "(N0 tau A lambda phase nu tshift)"},
337
338 {THEORY_POLYNOM, 0, false,
339 "polynom", "p", "(tshift p0 p1 ... pn)", "(tshift p0 p1 ... pn)"},
340
341 {THEORY_USER_FCN, 0, false,
342 "userFcn", "u", "", ""}
343};
344
345//--------------------------------------------------------------------------------------
446{
447 public:
474 PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent = false);
475
486 virtual ~PTheory();
487
499 virtual Bool_t IsValid();
500
520 virtual Double_t Func(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
521
522 private:
524 virtual void CleanUp(PTheory *theo);
525
529 virtual Int_t SearchDataBase(TString name);
530
534 virtual Int_t GetUserFcnIdx(UInt_t lineNo) const;
535
537 virtual void MakeCleanAndTidyTheoryBlock(PMsrLines* fullTheoryBlock);
538
540 virtual void MakeCleanAndTidyPolynom(UInt_t i, PMsrLines* fullTheoryBlock);
541
543 virtual void MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines* fullTheoryBlock);
544
545 // -------------------- Theory Function Implementations --------------------
546 // Each function evaluates its specific physical model at time t.
547 // Parameters are resolved from fParamNo using paramValues and funcValues.
548
550 virtual Double_t Constant(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
552 virtual Double_t Asymmetry(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
554 virtual Double_t SimpleExp(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
556 virtual Double_t GeneralExp(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
558 virtual Double_t SimpleGauss(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
560 virtual Double_t StaticGaussKT(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
562 virtual Double_t StaticGaussKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
564 virtual Double_t DynamicGaussKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
566 virtual Double_t StaticLorentzKT(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
568 virtual Double_t StaticLorentzKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
570 virtual Double_t DynamicLorentzKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
572 virtual Double_t DynamicGauLorKTZFFast(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
574 virtual Double_t DynamicGauLorKTLFFast(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
576 virtual Double_t DynamicGauLorKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
578 virtual Double_t CombiLGKT(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
580 virtual Double_t StrKT(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
582 virtual Double_t SpinGlass(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
584 virtual Double_t RandomAnisotropicHyperfine(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
586 virtual Double_t Abragam(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
588 virtual Double_t TFCos(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
590 virtual Double_t InternalField(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
592 virtual Double_t InternalFieldGK(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
594 virtual Double_t InternalFieldLL(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
596 virtual Double_t Bessel(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
598 virtual Double_t InternalBessel(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
600 virtual Double_t SkewedGauss(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
602 virtual Double_t StaticNKZF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
604 virtual Double_t StaticNKTF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
606 virtual Double_t DynamicNKZF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
608 virtual Double_t DynamicNKTF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
610 virtual Double_t FmuF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
612 virtual Double_t MuMinusExpTF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
614 virtual Double_t Polynom(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
616 virtual Double_t UserFcn(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
617
618 // -------------------- LF Calculation Helpers --------------------
620 virtual void CalculateGaussLFIntegral(const Double_t *val) const;
622 virtual void CalculateLorentzLFIntegral(const Double_t *val) const;
624 virtual Double_t GetLFIntegralValue(const Double_t t) const;
626 virtual void CalculateDynKTLF(const Double_t *val, Int_t tag) const;
628 virtual Double_t GetDynKTLFValue(const Double_t t) const;
630 virtual Double_t GetDyn_GL_KTLFValue(const Double_t t) const;
631
632 // -------------------- Member Variables --------------------
633 Bool_t fValid;
634 UInt_t fType;
635 std::vector<UInt_t> fParamNo;
636 UInt_t fNoOfParam;
639
640 // User function members
646
648
649 // LF calculation caching (mutable for const Func() calls)
650 mutable Double_t fSamplingTime;
651 mutable Double_t fPrevParam[THEORY_MAX_PARAM];
653 mutable Double_t fDynLFdt;
656};
657
658#endif // _PTHEORY_H_
std::vector< PMsrLineStructure > PMsrLines
Definition PMusr.h:1007
std::vector< Double_t > PDoubleVector
Definition PMusr.h:399
#define THEORY_PARAM_STATIC_ZF_NK
Definition PTheory.h:169
static PTheoDataBase fgTheoDataBase[THEORY_MAX]
Definition PTheory.h:240
#define THEORY_GENERAL_EXP
General exponential relaxation: exp(-(λt)^β)
Definition PTheory.h:70
#define THEORY_DYNAMIC_LORENTZ_KT_LF
Dynamic Lorentzian Kubo-Toyabe in longitudinal field.
Definition PTheory.h:84
#define THEORY_RANDOM_ANISOTROPIC_HYPERFINE
Random anisotropic hyperfine coupling.
Definition PTheory.h:98
struct theo_data_base PTheoDataBase
#define THEORY_CONST
Constant value (baseline, background)
Definition PTheory.h:64
#define THEORY_DYNAMIC_GAUSS_KT_LF
Dynamic Gaussian Kubo-Toyabe in longitudinal field.
Definition PTheory.h:78
#define THEORY_ABRAGAM
Abragam relaxation function (diffusion)
Definition PTheory.h:100
#define THEORY_ASYMMETRY
Initial asymmetry (multiplicative factor)
Definition PTheory.h:66
#define THEORY_PARAM_SIMPLE_GAUSS
Definition PTheory.h:147
#define THEORY_PARAM_STATIC_LORENTZ_KT_LF
Definition PTheory.h:152
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_LF
Definition PTheory.h:155
#define THEORY_SIMPLE_GAUSS
Simple Gaussian relaxation: exp(-σ²t²/2)
Definition PTheory.h:72
#define THEORY_PARAM_INTERNAL_FIELD_LARKIN
Definition PTheory.h:165
#define THEORY_PARAM_BESSEL
Definition PTheory.h:166
#define THEORY_STATIC_ZF_NK
Static Nakajima zero-field function.
Definition PTheory.h:116
#define THEORY_PARAM_DYNAMIC_LORENTZ_KT_LF
Definition PTheory.h:153
#define THEORY_PARAM_RANDOM_ANISOTROPIC_HYPERFINE
Definition PTheory.h:160
#define THEORY_PARAM_DYNAMIC_GAULOR_KT_LF
Definition PTheory.h:156
#define THEORY_MU_MINUS_EXP
Negative muon (μ-) exponential TF decay.
Definition PTheory.h:126
#define THEORY_PARAM_GENERAL_EXP
Definition PTheory.h:146
#define THEORY_SIMPLE_EXP
Simple exponential relaxation: exp(-λt)
Definition PTheory.h:68
#define THEORY_PARAM_F_MU_F
Definition PTheory.h:173
#define THEORY_INTERNAL_BESSEL
Internal Bessel (field distribution with Bessel)
Definition PTheory.h:112
#define THEORY_SPIN_GLASS
Spin glass order parameter function.
Definition PTheory.h:96
#define THEORY_STATIC_GAUSS_KT
Static Gaussian Kubo-Toyabe (zero-field)
Definition PTheory.h:74
#define THEORY_DYNAMIC_ZF_NK
Dynamic Nakajima zero-field function.
Definition PTheory.h:120
#define THEORY_TF_COS
Transverse field cosine precession.
Definition PTheory.h:102
#define THEORY_PARAM_DYNAMIC_GAUSS_KT_LF
Definition PTheory.h:150
#define THEORY_POLYNOM
Polynomial function (arbitrary order)
Definition PTheory.h:128
#define THEORY_PARAM_INTERNAL_FIELD
Definition PTheory.h:163
#define THEORY_PARAM_ASYMMETRY
Definition PTheory.h:144
#define THEORY_PARAM_SIMPLE_EXP
Definition PTheory.h:145
#define THEORY_STATIC_GAUSS_KT_LF
Static Gaussian Kubo-Toyabe in longitudinal field.
Definition PTheory.h:76
#define THEORY_PARAM_ABRAGAM
Definition PTheory.h:161
#define THEORY_INTERNAL_FIELD_LARKIN
Internal field (Larkin-Ovchinnikov model)
Definition PTheory.h:108
#define THEORY_DYNAMIC_GAULOR_FAST_KT_ZF
Fast dynamic Gauss-Lorentz Kubo-Toyabe (zero-field)
Definition PTheory.h:86
#define THEORY_INTERNAL_FIELD
Internal magnetic field distribution (superconductors)
Definition PTheory.h:104
#define THEORY_INTERNAL_FIELD_KORNILOV
Internal field (Kornilov vortex lattice model)
Definition PTheory.h:106
#define THEORY_PARAM_INTERNAL_FIELD_KORNILOV
Definition PTheory.h:164
#define THEORY_DYNAMIC_TF_NK
Dynamic Nakajima transverse field function.
Definition PTheory.h:122
#define THEORY_PARAM_STATIC_TF_NK
Definition PTheory.h:170
#define THEORY_MAX
Definition PTheory.h:183
#define THEORY_PARAM_COMBI_LGKT
Definition PTheory.h:157
#define THEORY_PARAM_INTERNAL_BESSEL
Definition PTheory.h:167
#define THEORY_BESSEL
Bessel function (modulated precession)
Definition PTheory.h:110
#define THEORY_PARAM_DYNAMIC_TF_NK
Definition PTheory.h:172
#define THEORY_STATIC_TF_NK
Static Nakajima transverse field function.
Definition PTheory.h:118
#define THEORY_PARAM_SKEWED_GAUSS
Definition PTheory.h:168
#define THEORY_DYNAMIC_GAULOR_FAST_KT_LF
Fast dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
Definition PTheory.h:88
#define THEORY_PARAM_STATIC_LORENTZ_KT
Definition PTheory.h:151
#define THEORY_STR_KT
Stretched Kubo-Toyabe relaxation.
Definition PTheory.h:94
#define THEORY_F_MU_F
F-μ-F (μ-fluorine) oscillation.
Definition PTheory.h:124
#define THEORY_PARAM_CONST
Definition PTheory.h:143
#define THEORY_PARAM_STATIC_GAUSS_KT
Definition PTheory.h:148
#define THEORY_PARAM_DYNAMIC_GAULOR_FAST_KT_ZF
Definition PTheory.h:154
#define THEORY_STATIC_LORENTZ_KT
Static Lorentzian Kubo-Toyabe (zero-field)
Definition PTheory.h:80
#define THEORY_MAX_PARAM
Definition PTheory.h:192
#define THEORY_PARAM_MU_MINUS_EXP
Definition PTheory.h:174
#define THEORY_PARAM_STR_KT
Definition PTheory.h:158
#define THEORY_USER_FCN
User-defined external function (shared library)
Definition PTheory.h:130
#define THEORY_PARAM_SPIN_GLASS
Definition PTheory.h:159
#define THEORY_SKEWED_GAUSS
Skewed Gaussian relaxation (asymmetric rates)
Definition PTheory.h:114
#define THEORY_PARAM_TF_COS
Definition PTheory.h:162
#define THEORY_COMBI_LGKT
Combined Lorentzian-Gaussian Kubo-Toyabe.
Definition PTheory.h:92
#define THEORY_PARAM_STATIC_GAUSS_KT_LF
Definition PTheory.h:149
#define THEORY_DYNAMIC_GAULOR_KT_LF
Dynamic Gauss-Lorentz Kubo-Toyabe in longitudinal field.
Definition PTheory.h:90
#define THEORY_STATIC_LORENTZ_KT_LF
Static Lorentzian Kubo-Toyabe in longitudinal field.
Definition PTheory.h:82
#define THEORY_PARAM_DYNAMIC_ZF_NK
Definition PTheory.h:171
MSR file parser and manager for the musrfit framework.
Theory function evaluator and expression tree manager.
Definition PTheory.h:446
virtual Double_t DynamicGauLorKTLF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Dynamic Gaussian-Lorentzian KT (LF). Full numerical calculation.
Definition PTheory.cpp:1906
virtual ~PTheory()
Destructor that recursively cleans up the expression tree.
Definition PTheory.cpp:354
virtual Double_t Constant(const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Returns constant value. Formula: c.
Definition PTheory.cpp:1104
virtual Double_t Abragam(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Abragam relaxation. Motional narrowing formula.
Definition PTheory.cpp:2226
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.
Definition PTheory.h:633
PTheory * fAdd
Pointer to addition child node (left branch of tree)
Definition PTheory.h:637
virtual void MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
Formats a polynomial theory line with proper spacing.
Definition PTheory.cpp:1011
Double_t fDynLFdt
Time step for dynamic LF integral equation.
Definition PTheory.h:653
PUserFcnBase * fUserFcn
Pointer to instantiated user function object.
Definition PTheory.h:644
PDoubleVector fUserParam
Resolved parameter values for user function calls.
Definition PTheory.h:645
virtual Int_t GetUserFcnIdx(UInt_t lineNo) const
Returns the index of user functions up to the given line.
Definition PTheory.cpp:875
Double_t fSamplingTime
Time step for LF integral calculation (default 1 ns = 0.001 μs)
Definition PTheory.h:650
PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent=false)
Constructor that parses the THEORY block and builds the expression tree.
Definition PTheory.cpp:125
virtual Double_t SimpleGauss(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Simple Gaussian relaxation. Formula: exp(-σ²t²/2)
Definition PTheory.cpp:1286
PDoubleVector fLFIntegral
Cached static LF KT integral values.
Definition PTheory.h:652
virtual Int_t SearchDataBase(TString name)
Searches fgTheoDataBase for a function by name or abbreviation.
Definition PTheory.cpp:841
virtual Double_t TFCos(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Transverse field cosine. Formula: cos(φ + 2πνt)
Definition PTheory.cpp:2270
virtual Double_t StaticGaussKTLF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Gaussian Kubo-Toyabe (LF). Requires numerical integration.
Definition PTheory.cpp:1384
virtual Double_t StaticLorentzKT(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Lorentzian Kubo-Toyabe (ZF). Formula: 1/3 + 2/3(1-at)exp(-at)
Definition PTheory.cpp:1571
PDoubleVector fDyn_GL_LFFuncValue
Cached dynamic Gauss-Lorentz LF KT values.
Definition PTheory.h:655
virtual Double_t StaticNKZF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Nakajima-Keren (ZF). Combined nuclear and electronic relaxation.
Definition PTheory.cpp:2636
virtual Double_t DynamicGaussKTLF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Dynamic Gaussian Kubo-Toyabe (LF). Strong collision model.
Definition PTheory.cpp:1473
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 &paramValues, const PDoubleVector &funcValues) const
Returns asymmetry value. Formula: A.
Definition PTheory.cpp:1139
PTheory * fMul
Pointer to multiplication child node (right branch of tree)
Definition PTheory.h:638
virtual Double_t DynamicNKZF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Dynamic Nakajima-Keren (ZF). With spin fluctuations.
Definition PTheory.cpp:2747
virtual Double_t StrKT(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Stretched Kubo-Toyabe. Formula: exp(-(σt)^β) with KT-like recovery.
Definition PTheory.cpp:2081
virtual Double_t GeneralExp(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
General (stretched) exponential. Formula: exp(-(λt)^β)
Definition PTheory.cpp:1229
Double_t fPrevParam[THEORY_MAX_PARAM]
Previous parameter values for cache invalidation check.
Definition PTheory.h:651
virtual Double_t DynamicGauLorKTZFFast(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Fast dynamic Gaussian-Lorentzian KT (ZF). Approximate fast calculation.
Definition PTheory.cpp:1819
virtual Bool_t IsValid()
Checks if the entire theory expression tree is valid.
Definition PTheory.cpp:394
virtual Double_t RandomAnisotropicHyperfine(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Random anisotropic hyperfine coupling. Powder average of anisotropic coupling.
Definition PTheory.cpp:2181
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.
Definition PTheory.h:654
virtual Double_t InternalField(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Internal field distribution. Gaussian field distribution model.
Definition PTheory.cpp:2311
Int_t fUserFcnIdx
Index of this user function among all userFcn entries (for global state)
Definition PTheory.h:641
TString fUserFcnClassName
ROOT class name for user function (e.g., "TMyFunction")
Definition PTheory.h:642
virtual Double_t InternalBessel(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Internal Bessel field distribution. Combines Bessel with relaxation.
Definition PTheory.cpp:2498
virtual Double_t SkewedGauss(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Skewed Gaussian. Asymmetric relaxation rates before/after zero crossing.
Definition PTheory.cpp:2547
virtual Double_t StaticGaussKT(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Gaussian Kubo-Toyabe (ZF). Formula: 1/3 + 2/3(1-σ²t²)exp(-σ²t²/2)
Definition PTheory.cpp:1342
virtual Double_t DynamicLorentzKTLF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Dynamic Lorentzian Kubo-Toyabe (LF). Strong collision model.
Definition PTheory.cpp:1711
virtual void CleanUp(PTheory *theo)
Recursively deletes child theory nodes (fAdd and fMul).
Definition PTheory.cpp:809
virtual Double_t InternalFieldGK(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Internal field (Kornilov model). Vortex lattice field distribution.
Definition PTheory.cpp:2353
virtual void MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
Formats a user function theory line with proper spacing.
Definition PTheory.cpp:1064
virtual Double_t DynamicNKTF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Dynamic Nakajima-Keren (TF). With spin fluctuations and precession.
Definition PTheory.cpp:2808
virtual Double_t SimpleExp(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Simple exponential relaxation. Formula: exp(-λt)
Definition PTheory.cpp:1177
virtual Double_t Func(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Evaluates the theory function at a given time point.
Definition PTheory.cpp:447
UInt_t fType
Theory function type (THEORY_CONST, THEORY_SIMPLE_EXP, etc.)
Definition PTheory.h:634
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.
Definition PTheory.h:635
virtual Double_t DynamicGauLorKTLFFast(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Fast dynamic Gaussian-Lorentzian KT (LF). Approximate fast calculation.
Definition PTheory.cpp:1859
PMsrHandler * fMsrInfo
Pointer to MSR file handler (not owned)
Definition PTheory.h:647
virtual Double_t UserFcn(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
User-defined function. Calls external shared library function.
virtual Double_t Bessel(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Bessel function precession. Formula: J₀(2πνt + φ)
Definition PTheory.cpp:2457
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 &paramValues, const PDoubleVector &funcValues) const
Spin glass relaxation function. Edwards-Anderson order parameter.
Definition PTheory.cpp:2130
virtual Double_t StaticNKTF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Nakajima-Keren (TF). Combined nuclear and electronic relaxation with precession.
Definition PTheory.cpp:2691
virtual Double_t FmuF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
F-μ-F oscillation. Muon bound between two fluorine atoms.
virtual Double_t StaticLorentzKTLF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Static Lorentzian Kubo-Toyabe (LF). Requires numerical integration.
Definition PTheory.cpp:1614
virtual Double_t CombiLGKT(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Combined Lorentzian-Gaussian KT. Product of both relaxation types.
Definition PTheory.cpp:2035
virtual Double_t MuMinusExpTF(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
μ⁻ exponential TF. Negative muon in transverse field.
virtual Double_t Polynom(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Polynomial function. Formula: Σᵢ pᵢtⁱ
UInt_t fNoOfParam
Expected number of parameters for this function type.
Definition PTheory.h:636
virtual Double_t InternalFieldLL(Double_t t, const PDoubleVector &paramValues, const PDoubleVector &funcValues) const
Internal field (Larkin-Ovchinnikov model). Vortex lattice field distribution.
Definition PTheory.cpp:2405
virtual void MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
Reformats the theory block for clean MSR file output.
Definition PTheory.cpp:922
TString fUserFcnSharedLibName
Shared library path (e.g., "libMyFunctions.so")
Definition PTheory.h:643
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.)
Definition PTheory.h:227
TString fCommentTimeShift
Parameter list with time shift included.
Definition PTheory.h:233
Bool_t fTable
True if function requires pre-calculated lookup table (e.g., LF Kubo-Toyabe)
Definition PTheory.h:229
UInt_t fNoOfParam
Number of parameters (excluding optional time shift)
Definition PTheory.h:228
TString fAbbrev
Short abbreviation (e.g., "se", "stg")
Definition PTheory.h:231
TString fComment
Parameter list shown as help text in MSR file.
Definition PTheory.h:232
TString fName
Full function name for MSR files (e.g., "simplExpo", "statGssKt")
Definition PTheory.h:230