Dear rooters,
I tried to estimate the backgroung by a 2nd order Chebychev polynom (only as learning step)
I dont get usable result.
What I am doing wrong?
Thanx,
k.
Fit(const char* filename){
gROOT->Reset();
gSystem->Load(“libRooFit”);
// gSystem->Load(“libRooFitModels.so”);
using namespace RooFit;
TFile* file = new TFile(filename);
if(file){
TH1D* h0 = (TH1D*) file->Get("h0");
if(h0){
RooRealVar x("x", "x", 0, 50000);
x.setRange("Range1",20000, 40000);
RooDataHist data("data", "data", x, h0);
RooRealVar Par1("Par1", "Par1", -1e16, 1e16);
RooRealVar Par2("Par2", "Par2", -100000, 100000);
RooChebychev Cheby5("Cheby5", "Chebychev Bacground",x, RooArgList(Par1,
Par2));
Cheby5.fitTo(data, "", "" ,"Range1");
Par1.Print();
}
}
}
fileout.root (4.64 KB)