#include "TROOT.h"
#include "TFitterFumili.h"
#include "TF1.h"
#include "TH1.h"
#include "TGraph.h"
#include "TFumiliFCN.h"
#include "Minuit2/FumiliMinimizer.h"
#include "Minuit2/FunctionMinimum.h"
#include "Minuit2/MnStrategy.h"
#include "Minuit2/MnPrint.h"
using namespace ROOT::Minuit2;
ClassImp(TFitterFumili);
TFitterFumili* gFumili2 = 0;
TFitterFumili::TFitterFumili() {
SetName("Fumili2");
gFumili2 = this;
gROOT->GetListOfSpecials()->Add(gFumili2);
}
TFitterFumili::TFitterFumili(Int_t ) {
SetName("Fumili2");
gFumili2 = this;
gROOT->GetListOfSpecials()->Add(gFumili2);
}
void TFitterFumili::CreateMinimizer(EMinimizerType ) {
if (PrintLevel() >=1 )
std::cout<<"TFitterFumili: Minimize using new Fumili algorithm "<<std::endl;
const ModularFunctionMinimizer * minimizer = GetMinimizer();
if (!minimizer) delete minimizer;
SetMinimizer( new FumiliMinimizer() );
SetStrategy(1);
SetMinimumTolerance(0.001);
#ifdef DEBUG
SetPrintLevel(3);
#endif
}
Double_t TFitterFumili::Chisquare(Int_t npar, Double_t *params) const {
const TFumiliBinLikelihoodFCN * fcn = dynamic_cast<const TFumiliBinLikelihoodFCN *> ( GetMinuitFCN() );
std::vector<double> p(npar);
for (int i = 0; i < npar; ++i)
p[i] = params[i];
return fcn->Chi2(p);
}
void TFitterFumili::CreateChi2FCN() {
SetMinuitFCN(new TFumiliChi2FCN( *this,GetStrategy()) );
}
void TFitterFumili::CreateChi2ExtendedFCN() {
SetMinuitFCN(new TFumiliChi2FCN(*this, GetStrategy()));
}
void TFitterFumili::CreateBinLikelihoodFCN() {
SetMinuitFCN( new TFumiliBinLikelihoodFCN( *this, GetStrategy()) );
}
Last update: Thu Jan 17 08:50:16 2008
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.