16 #include "Riostream.h"
21 fxExpression(), fxPosIndex(), fxWidthIndex(), fxFormula(0) {
25 TGo4FitModel(iName,
"based on TFormula line shape",AddAmplitude),
26 fxExpression(iExpressionStr), fxPosIndex(), fxWidthIndex(), fxFormula(0) {
28 for (Int_t n=0;n<iNPars;n++)
51 if ((num<0) || (oldnum==num))
return kFALSE;
53 for(Int_t n=oldnum-1;n>=num;n--)
56 for(Int_t n=oldnum;n<num;n++)
83 if ((naxis<0) || (naxis>=
fxPosIndex.GetSize()))
return -1;
88 if ((naxis<0) || (naxis>=
fxWidthIndex.GetSize()))
return -1;
117 case 2:
return fxFormula->Eval(v[0],v[1]);
118 case 3:
return fxFormula->Eval(v[0],v[1],v[2]);
119 default:
return fxFormula->EvalPar(v, 0);
134 std::cout <<
" Expression = " << *
fxExpression << std::endl;
135 for (Int_t naxis=0;naxis<
fxPosIndex.GetSize();naxis++) {
138 std::cout <<
" Position on " << naxis <<
" axis is " << par->GetName() << std::endl;
140 for (Int_t naxis=0;naxis<
fxWidthIndex.GetSize();naxis++) {
143 std::cout <<
" Width on " << naxis <<
" axis is " << par->GetName() << std::endl;
152 for (Int_t n=0;n<
NumPars();n++) {
158 fxFormula =
new TFormula(
"Expression", Expr);
162 std::cerr <<
"Error in formula: " <<
fxExpression.Data() <<
" code " << err << std::endl;
TGo4FitParameter * GetPar(Int_t n)
TGo4FitParameter * NewParameter(const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
Bool_t RemovePar(const char *name)
virtual void Print(Option_t *option) const
virtual Bool_t Initialize(Int_t UseBuffers=-1)
Int_t GetParIndex(const TGo4FitParameter *par)
const char * GetParName(Int_t n)
TGo4FitParameter * GetAmplPar()