Added the theory function muMinusExpTF for mu minus fits
This commit is contained in:
parent
3dfd348d5e
commit
ee064fc504
@ -4,6 +4,7 @@
|
||||
|
||||
changes since 0.17.0
|
||||
===================================
|
||||
NEW 2016-04-22 Added the theory function muMinusExpTF for mu minus fits
|
||||
NEW 2016-02-23 It is now possible to export the averaged data/Fourier
|
||||
|
||||
changes since 0.16.0
|
||||
|
@ -507,6 +507,10 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
|
||||
return Polynom(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
|
||||
fAdd->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_MU_MINUS_EXP:
|
||||
return MuMinusExpTF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
|
||||
fAdd->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_USER_FCN:
|
||||
return UserFcn(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
|
||||
fAdd->Func(t, paramValues, funcValues);
|
||||
@ -599,6 +603,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
|
||||
case THEORY_DYNAMIC_TF_NK:
|
||||
return DynamicNKTF (t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_MU_MINUS_EXP:
|
||||
return MuMinusExpTF(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_POLYNOM:
|
||||
return Polynom(t, paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
@ -695,6 +702,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
|
||||
case THEORY_DYNAMIC_TF_NK:
|
||||
return DynamicNKTF (t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_MU_MINUS_EXP:
|
||||
return MuMinusExpTF(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_POLYNOM:
|
||||
return Polynom(t, paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
|
||||
break;
|
||||
@ -789,6 +799,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
|
||||
case THEORY_DYNAMIC_TF_NK:
|
||||
return DynamicNKTF(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_MU_MINUS_EXP:
|
||||
return MuMinusExpTF(t, paramValues, funcValues);
|
||||
break;
|
||||
case THEORY_POLYNOM:
|
||||
return Polynom(t, paramValues, funcValues);
|
||||
break;
|
||||
@ -2942,6 +2955,46 @@ Double_t PTheory::GetDynKTLFValue(const Double_t t) const
|
||||
return fDynLFFuncValue[idx]+df;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> theory function: MuMinusExpTF
|
||||
*
|
||||
* \f[ = N_0 \exp(-t/tau) [1 + A \exp(-\lambda t) \cos(2\pi\nu t + \phi)] \f]
|
||||
*
|
||||
* <b>meaning of paramValues:</b> \f$t_{\rm shift}\f$, \f$N_0\f$, \f$\tau\f$, \f$A\f$, \f$\lambda\f$, \f$\phi\f$, \f$\nu\f$
|
||||
*
|
||||
* <b>return:</b> function value
|
||||
*
|
||||
* \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)
|
||||
*/
|
||||
Double_t PTheory::MuMinusExpTF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
|
||||
{
|
||||
// expected parameters: N0 tau A lambda phase frequency [tshift]
|
||||
|
||||
Double_t val[7];
|
||||
|
||||
assert(fParamNo.size() <= 7);
|
||||
|
||||
// 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() == 6) // no tshift
|
||||
tt = t;
|
||||
else // tshift present
|
||||
tt = t-val[6];
|
||||
|
||||
return val[0]*exp(-tt/val[1])*(1.0+val[2]*exp(-val[3]*tt)*cos(TWO_PI*val[5]*tt+DEG_TO_RAD*val[4]));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// END
|
||||
//--------------------------------------------------------------------------
|
||||
|
@ -70,8 +70,9 @@
|
||||
#define THEORY_STATIC_TF_NK 24
|
||||
#define THEORY_DYNAMIC_ZF_NK 25
|
||||
#define THEORY_DYNAMIC_TF_NK 26
|
||||
#define THEORY_POLYNOM 27
|
||||
#define THEORY_USER_FCN 28
|
||||
#define THEORY_MU_MINUS_EXP 27
|
||||
#define THEORY_POLYNOM 28
|
||||
#define THEORY_USER_FCN 29
|
||||
|
||||
// function parameter tags, i.e. how many parameters has a specific function
|
||||
// if there is a comment with a (tshift), the number of parameters is increased by one
|
||||
@ -102,9 +103,10 @@
|
||||
#define THEORY_PARAM_STATIC_TF_NK 4 // phase, frequency, damping D0, R_b=DGbG/D0 (tshift)
|
||||
#define THEORY_PARAM_DYNAMIC_ZF_NK 3 // damping D0, R_b=DGbG/D0, nu_c (tshift)
|
||||
#define THEORY_PARAM_DYNAMIC_TF_NK 5 // phase, frequency, damping D0, R_b=DGbG/D0, nu_c (tshift)
|
||||
#define THEORY_PARAM_MU_MINUS_EXP 6 // N0, tau, A, damping, phase, frequency (tshift)
|
||||
|
||||
// number of available user functions
|
||||
#define THEORY_MAX 29
|
||||
#define THEORY_MAX 30
|
||||
|
||||
// maximal number of parameters. Needed in the contents of LF
|
||||
#define THEORY_MAX_PARAM 10
|
||||
@ -217,6 +219,9 @@ static PTheoDataBase fgTheoDataBase[THEORY_MAX] = {
|
||||
{THEORY_DYNAMIC_TF_NK, THEORY_PARAM_DYNAMIC_TF_NK, false,
|
||||
"dynamicNKTF", "dnktf", "(phase frequency damping_D0 R_b nu_c)", "(phase frequency damping_D0 R_b nu_c tshift)"},
|
||||
|
||||
{THEORY_MU_MINUS_EXP, THEORY_PARAM_MU_MINUS_EXP, false,
|
||||
"muMinusExpTF", "mmsetf", "(N0 tau A lambda phase nu)", "(N0 tau A lambda phase nu tshift)"},
|
||||
|
||||
{THEORY_POLYNOM, 0, false,
|
||||
"polynom", "p", "(tshift p0 p1 ... pn)", "(tshift p0 p1 ... pn)"},
|
||||
|
||||
@ -272,6 +277,7 @@ class PTheory
|
||||
virtual Double_t StaticNKTF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
virtual Double_t DynamicNKZF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
virtual Double_t DynamicNKTF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
virtual Double_t MuMinusExpTF(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
virtual Double_t Polynom(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
virtual Double_t UserFcn(register Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user