TFraction Fitter with 2D histograms

Hi Rooters,

I am using TFractionFitter in my analysis to have an estimate of the number of true photons entering into my sample.
Here are my inputs :
*** the data distribution
*** the true photon template
*** the fake photon template

All template distributions are based on photon shower shape variables.

The fitter allows me to have an estimate of number of true photons in my data distribution below some threshold value. But here is the trick. This threshold value depends on the photon pt which is not an info present in the template distributions.

I had the idea of making the fit with 2D histograms (shower shape vs its cut value) but I was wondering how to make the fitter understand that I want the fit to be performed only on shower shape info.

Also, my other question is how many entries roughly does one need in each template distribution ??? Is 100 sufficient ???

Then, my last question is the following. I would like to apply some parameters to my true template distribution before it enters the fit. I would like basically to do a+b*x where x is my template variable and then make it enter into the fit. But most important, I would like a and b to be left as parameters in the fit returning me the best values for agreement between data and MC. How can I do that ???

Thanks a lot for the help.

Hi Rooters,

I just would like to reiterate my question.
If anyone could provide help, that would be nice.

Thanks a lot.


If you have enough statistics you can try as input to the TFractionFItter the 2D histograms. However you need to have some statistics, I don;t think TFractionFitter will work well if you have several bins which are empty.

Another possibility is to weight the histogram and then use the 1D distribution. However I think you cannot use TFractionFitter, you need in this case to implement yourself the likelihood function. If you neglect the statistical error in each bin of the MC template is not difficult to implement.
Also if you want to fit a more complicated function of your template, this is not supported in TFractionFitter, so you will need to implement yourself the template fit.

Best Regards