start adding more standard theory functions. Not all ready yet.

This commit is contained in:
2025-06-04 17:39:02 +02:00
parent 072c0b63bc
commit 7a923d2f01
2 changed files with 167 additions and 20 deletions

View File

@@ -425,6 +425,15 @@ Double_t PTheory::Func(Double_t t, const PDoubleVector& paramValues, const PDoub
case THEORY_DYNAMIC_LORENTZ_KT_LF:
return DynamicLorentzKTLF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_ZF:
return DynamicGauLorKTZFFast(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_LF:
return DynamicGauLorKTLFFast(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_KT_LF:
return DynamicGauLorKTLF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
case THEORY_COMBI_LGKT:
return CombiLGKT(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
@@ -511,6 +520,12 @@ Double_t PTheory::Func(Double_t t, const PDoubleVector& paramValues, const PDoub
return StaticLorentzKTLF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_LORENTZ_KT_LF:
return DynamicLorentzKTLF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_ZF:
return DynamicGauLorKTZFFast(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_LF:
return DynamicGauLorKTLFFast(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_KT_LF:
return DynamicGauLorKTLF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_COMBI_LGKT:
return CombiLGKT(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
case THEORY_STR_KT:
@@ -580,6 +595,12 @@ Double_t PTheory::Func(Double_t t, const PDoubleVector& paramValues, const PDoub
return StaticLorentzKTLF(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_LORENTZ_KT_LF:
return DynamicLorentzKTLF(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_ZF:
return DynamicGauLorKTZFFast(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_LF:
return DynamicGauLorKTLFFast(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_KT_LF:
return DynamicGauLorKTLF(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_COMBI_LGKT:
return CombiLGKT(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
case THEORY_STR_KT:
@@ -647,6 +668,12 @@ Double_t PTheory::Func(Double_t t, const PDoubleVector& paramValues, const PDoub
return StaticLorentzKTLF(t, paramValues, funcValues);
case THEORY_DYNAMIC_LORENTZ_KT_LF:
return DynamicLorentzKTLF(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_ZF:
return DynamicGauLorKTZFFast(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_FAST_KT_LF:
return DynamicGauLorKTLFFast(t, paramValues, funcValues);
case THEORY_DYNAMIC_GAULOR_KT_LF:
return DynamicGauLorKTLF(t, paramValues, funcValues);
case THEORY_COMBI_LGKT:
return CombiLGKT(t, paramValues, funcValues);
case THEORY_STR_KT:
@@ -1633,6 +1660,108 @@ Double_t PTheory::DynamicLorentzKTLF(Double_t t, const PDoubleVector& paramValue
}
//--------------------------------------------------------------------------
/**
* <p>Local Gaussian, global Lorentzian approximation in the limit
* \f[ \nu_c \gg \gamma_\mu \Delta_{\rm L} \f] in ZF.
* For details see "Muon Spin Rotation, Relaxation, and Resonance",
* A. Yaouanc and P. Dalmas Sec. 6.4, Eq.(6.89).
*
* @param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* @param paramValues parameter values
* @param funcValues vector with the functions (i.e. functions of the parameters)
*
* @return Polarization value of this function
*/
Double_t PTheory::DynamicGauLorKTZFFast(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{
// expected parameters: damping hopping [tshift]
Double_t val[3];
assert(fParamNo.size() <= 3);
// check if FUNCTIONS are used
for (UInt_t i=0; i<fParamNo.size(); i++) {
if (fParamNo[i] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map
val[i] = paramValues[fParamNo[i]];
} else { // function
val[i] = funcValues[fParamNo[i]-MSR_PARAM_FUN_OFFSET];
}
}
Double_t tt;
if (fParamNo.size() == 2) // no tshift
tt = t;
else // tshift present
tt = t-val[2];
Double_t nut = val[1]*tt;
return exp(-sqrt(4.0*pow(val[0]/val[1], 2.0)*(exp(-nut)-1.0+nut)));
}
//--------------------------------------------------------------------------
/**
* <p>Local Gaussian, global Lorentzian approximation in the limit
* \f[ \nu_c \gg \gamma_\mu \Delta_{\rm L} \f] in LF.
* For details see "Muon Spin Rotation, Relaxation, and Resonance",
* A. Yaouanc and P. Dalmas Sec. 6.4, Eq.(6.93).
*
* @param t time in \f$(\mu\mathrm{s})\f$, or x-axis value for non-muSR fit
* @param paramValues parameter values
* @param funcValues vector with the functions (i.e. functions of the parameters)
*
* @return Polarization value of this function
*/
Double_t PTheory::DynamicGauLorKTLFFast(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{
// expected parameters: frequency damping hopping [tshift]
Double_t val[4];
assert(fParamNo.size() <= 4);
// check if FUNCTIONS are used
for (UInt_t i=0; i<fParamNo.size(); i++) {
if (fParamNo[i] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map
val[i] = paramValues[fParamNo[i]];
} else { // function
val[i] = funcValues[fParamNo[i]-MSR_PARAM_FUN_OFFSET];
}
}
Double_t tt;
if (fParamNo.size() == 3) // no tshift
tt = t;
else // tshift present
tt = t-val[3];
Double_t w0 = TMath::TwoPi()*val[0];
Double_t w0_2 = w0*w0;
Double_t nu_2 = val[2]*val[2];
Double_t nu_t = val[2]*tt;
Double_t w0_t = w0*tt;
Double_t Gamma_t = ((w0_2+nu_2)*nu_t+(w0_2-nu_2)*(1.0-exp(-nu_t)*cos(w0_t))-2.0*val[2]*w0*exp(-nu_t)*sin(w0_t))/pow(w0_2+nu_2,2.0);
if (Gamma_t < 0.0)
Gamma_t = 0.0;
return exp(-sqrt(4.0*val[1]*val[1]*Gamma_t));
}
//--------------------------------------------------------------------------
/**
* @brief PTheory::DynamicGauLorKTLF
* @param t
* @param paramValues
* @param funcValues
* @return
*/
Double_t PTheory::DynamicGauLorKTLF(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{
// NOT YET IMPLEMENTED. Will be Eq.(6.86)
return 0.0;
}
//--------------------------------------------------------------------------
/**
* <p> theory function: dynamic Lorentzain Kubo-Toyabe in longitudinal applied field