Hi all,
I am trying to use the TFractionFitter to fit a data distribution with some MC/bkg templates.
Here is what I usually do:
TObjArray *temps = new TObjArray(3);
temps->Add(qcd); // 0
temps->Add(zpj); // 1
temps->Add(mc); // 2
TFractionFitter *fit = new TFractionFitter(dat,temps);
fit->Constrain(0,0.,1.);
fit->Constrain(1,0.,1.);
fit->Constrain(2,0.,1.);
int status = fit->Fit();
When I run my code I have a nice result. Here are the resulting fractions:
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 frac0 1.80461e-02 1.60009e-03 1.57466e-02 -2.05674e-01
2 frac1 9.45540e-01 1.68312e-03 1.94595e-02 -1.89967e-01
3 frac2 3.64117e-02 2.00948e-03 1.33881e-02 -2.62721e-01
Now I have tried to constrain the fraction of the “mc” template to a narrower interval:
double mcfrac = mc->Integral()/dat->Integral();
fit->Constrain(2,0.5*mcfrac,2.*mcfrac);
I basically want the SF for the mc template to be between .5 and 2.
The problem is that it looks like this makes the TFractionFitter go crazy:
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 frac0 4.25382e-13 7.65189e-06 0.00000e+00** at limit **
2 frac1 7.66485e-02 6.91328e-05 0.00000e+00** at limit **
3 frac2 9.22719e-01 4.36813e-03 0.00000e+00 -1.41483e+00
As (maybe useful?) information I can add that:
- the “qcd” template is taken from data and used without any scaling (I expect the fit to provide its normalization)
- the “mc” and “zpj” templates are taken from MC and are scaled to the integrated luminosity of the data. I use event weights when filling them (e.g. h->Fill(value,weight)).
What is going on? Why does it look like I cannot constrain the parameters to some “reasonable” region?
I attach the “shape-by-shape” comparison in the first (“noConstr”) and in the second (“mcConstr”) iterations. The final plot is the fit result compared to data.
Cheers,
Francesco
noConstr.pdf (24.7 KB)
mcConstr.pdf (24.1 KB)