Illustrates how to fit excluding points in a given range.
Processing /mnt/build/workspace/root-makedoc-v614/rootspi/rdoc/src/v6-14-00-patches/tutorials/fit/fitExclude.C...
FCN=84.1529 FROM MIGRAD STATUS=CONVERGED 31 CALLS 32 TOTAL
EDM=4.69843e-21 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 2.84731e+01 9.46564e-01 1.81058e-03 -2.35464e-10
2 p1 -4.81581e+00 2.65330e-01 5.07521e-04 -8.40016e-10
{
if (reject && x[0] > 2.5 && x[0] < 3.5) {
return 0;
}
return par[0] + par[1]*x[0];
}
void fitExclude() {
TF1 *
f1 =
new TF1(
"f1",
"[0] +[1]*x +gaus(2)",0,5);
TH1F *h =
new TH1F(
"h",
"background + signal",100,0,5);
TF1 *fl =
new TF1(
"fl",fline,0,5,2);
TF1 *fleft =
new TF1(
"fleft",fline,0,2.5,2);
gROOT->GetListOfFunctions()->Remove(fleft);
TF1 *fright =
new TF1(
"fright",fline,3.5,5,2);
gROOT->GetListOfFunctions()->Remove(fright);
}
- Author
- Rene Brun
Definition in file fitExclude.C.