MINUIT template fit

Hello experts,

so I want to do a template fit with Minuit of a map of histograms and I don’t seem to find exactly the way.
Analytically the problem goes like this:

  1. I have a matrix of data histograms of invariant mass. They correspond to different pt cuts. If I have a pt cut from 5 to 12 from 12 to 20 then I make the histograms hist_1_1 (muons that noth belong to first bin), hist_1_2 muon_pos to first and muon_neg to second bin), hist_2_1 (muon_pos to second and muon_neg to first bin), hist_2_2 (muons that both belong to first bin).

  2. So I have two POI’s, one POI for each pt bin. So for example if I fitted only POI 1 I would want to fit simultaneously hist_1_1, hist_1_2 and hist_2_1.

  3. Also I created templates of the matrix based on MC shifted by my possible POIs values.

  4. I want Minuit to minimize the overall chi2 or likelihood according to this matrix by iterating over my templates and fitting simultaneously all the histograms together.

My main problem is how to say to connect Minuit to specific templates to specific values of the POIs and how it can understand that when it tries different values of POI 1 for example it should be interested only on the hist_1_1, hist_1_2, hist_2_1.


Dear @dfakoudi ,

Thank you for reaching out! I am sure @moneta can be of help here.


Hello, thanks very much for your response. I have looked into these indeed, but non of them seem to be for a template fits, so I have generated a bunch of templates, corresponding to different values of my POIs and I want to see which one corresponds to my Data matrix. I am not very sure with these examples someone could do that.


I think the tutorial linked above, combinedFit.C is a good example of make a simultaneous fit of multiple histograms. If you want to describe your fitting function using histogram, this is also possible, but it is more tricky. You would need to interpolate between different histogram for having a continuous function of your parameter, which is needed for Minuit.
There is a tool in ROOT, histfactory, based on RooFit that is designed for this type of fits.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.