How to fix one component in TFractionFitter


Please let me have a naive question.
I’m very new at fitting, so I would be happy if I could see more and more.

Sometimes, we used to fix one variable among multiple fit variables.
For example, RooFit provides it with simple command ‘setVal’.

I would like to know whether there is such a way in using TFractionFitter also. As far as I understand, TFractionFitter is using weighting/normalizing within stat. with all MC samples to data, so of course, it is very smart, but just it judges the fractions with stat. error.
So, in TFractionFitter, we may need to find another way ‘to fix one of the MC samples’, did I understand correctly?

I would be happy if you let me have a map to solve this.

Good day,

Dear aprilii,

From a mathematical point of view, there are many fit parameters used by TFractionFitter: the fractions for each template (which are usually the parameters of interest) as well as the bin contents of each “true” template. Only the former are explicitly dealt with as fit parameters by the underlying fitting package, however, while the latter are determined by the TFractionFitter code.

Since you don’t specify what parameter you’d like to fix, let me give you the recipe for both possibilities:
you can fix fractions by using the underlying fitting package’s TVirtualFitter::FixParameter() method (and you can access the underlying fitter using TFractionFitter::GetFitter())
you can effectively “fix” templates by scaling their corresponding histograms by a large factor. (Admittedly, this is a bit of a hack, since TFractionFitter will still fluctuate bin contents “within statistics”, but if the statistical uncertainties it estimates are small enough this ought to be an adequate approach.)
(Note that if you want to fix all templates, there should be no reason to use TFractionFitter to begin with.)


Dear Frank,

Thanks so much for the kind explanations. It’s very helpful for me to understand statistical virtue(?) of TFractionFitter.
OK, from now, I will consider more about FixParameter with my templetes.
Thanks again.