added negative muon fitting support. Fixed at the same time bugs related to logx/logy plotting. Allow now comments after functions in the FUNCTION block.

This commit is contained in:
2012-04-24 10:52:20 +00:00
parent e9f6fcab80
commit 99c24a146d
16 changed files with 817 additions and 173 deletions

View File

@ -397,6 +397,10 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
if (fMul) {
if (fAdd) { // fMul != 0 && fAdd != 0
switch (fType) {
case THEORY_CONST:
return Constant(paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
break;
case THEORY_ASYMMETRY:
return Asymmetry(paramValues, funcValues) * fMul->Func(t, paramValues, funcValues) +
fAdd->Func(t, paramValues, funcValues);
@ -488,6 +492,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
}
} else { // fMul !=0 && fAdd == 0
switch (fType) {
case THEORY_CONST:
return Constant(paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
break;
case THEORY_ASYMMETRY:
return Asymmetry(paramValues, funcValues) * fMul->Func(t, paramValues, funcValues);
break;
@ -560,6 +567,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
} else { // fMul == 0 && fAdd != 0
if (fAdd) {
switch (fType) {
case THEORY_CONST:
return Constant(paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
break;
case THEORY_ASYMMETRY:
return Asymmetry(paramValues, funcValues) + fAdd->Func(t, paramValues, funcValues);
break;
@ -630,6 +640,9 @@ Double_t PTheory::Func(register Double_t t, const PDoubleVector& paramValues, co
}
} else { // fMul == 0 && fAdd == 0
switch (fType) {
case THEORY_CONST:
return Constant(paramValues, funcValues);
break;
case THEORY_ASYMMETRY:
return Asymmetry(paramValues, funcValues);
break;
@ -981,6 +994,34 @@ void PTheory::MakeCleanAndTidyUserFcn(UInt_t i, PMsrLines *fullTheoryBlock)
}
}
//--------------------------------------------------------------------------
/**
* <p> theory function: Const
* \f[ = const \f]
*
* <b>meaning of paramValues:</b> const
*
* <b>return:</b> function value
*
* \param paramValues vector with the parameters
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/
Double_t PTheory::Constant(const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{
// expected parameters: const
Double_t constant;
// check if FUNCTIONS are used
if (fParamNo[0] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map
constant = paramValues[fParamNo[0]];
} else {
constant = funcValues[fParamNo[0]-MSR_PARAM_FUN_OFFSET];
}
return constant;
}
//--------------------------------------------------------------------------
/**
* <p> theory function: Asymmetry