TFractionFitter

Dear All,

I have a strange problem,

while fitting a histogram against two other mc histograms with TFractionFitter

I get the second mc histogram spoiled in some way

ANY help is very much appreciated :open_mouth:
I am completely in the fog now.

thank you
Igor

p.s. I am using root 5.14 on i586-sl3-linux





toy.C (2.05 KB)

Could you post your data file too?

Rene

done. see the first message.

[quote=“brun”]Could you post your data file too?

Rene[/quote]

I cannot reproduce your problem. see the picture I get in attachment

Rene


the plot I posted was produced by:

tfit->GetMCPrediction(1)->Draw()

for the weighted input histograms I get what you posted.
but the result depends on the binning of the input histograms, which is against the common sence.

[quote=“brun”]I cannot reproduce your problem. see the picture I get in attachment

Rene[/quote]

Dear Rene,

I have changed a bit the script.
The output png is in the attachment.

Igor



toy_2.C (2.34 KB)

Dear Igor,

TFractionFitter makes explicit use of the normalization of the input histogram.
The second “template” histogram in your example (referred to as _hmc2 in your
macro) is normalized to unity. This implies that effectively, you’re giving TFractionFitter
much too much freedom to fluctuate this template.

Use the un-renormalized histogram and you should be fine (I tested this briefly by
scaling _hcm2 up by a factor of 1280, but even that is presumably an underestimate).

Regards,
Frank

Dear Frank
thank you! I would never think that fit might take into account the normalization of the input histograms. …and still can not believe that it does, as it makes no sense to me.

It should take into account only the content/errors of the bins.

…may be i am wrong, and the algo must work directly with the content values directly as well. but in this case, when the histogram normalization is unknown beforehand, and the task of the fit is to extract this very normalization (which is the sole purpose of the TFractionFitter class)…then the fit will produce such crazy output as in my case.

proposal: add in bold to the description of the TFractionFitter class, that
"TFractionFitter makes explicit use of the normalization of the input histogram."

thanks!
Igor

[quote=“filthaut”]Dear Igor,

TFractionFitter makes explicit use of the normalization of the input histogram.
The second “template” histogram in your example (referred to as _hmc2 in your
macro) is normalized to unity. This implies that effectively, you’re giving TFractionFitter
much too much freedom to fluctuate this template.

Use the un-renormalized histogram and you should be fine (I tested this briefly by
scaling _hcm2 up by a factor of 1280, but even that is presumably an underestimate).

Regards,
Frank[/quote]

btw, is it possible to define in the TFractionFitter a gap in the fitting range?
i.e. only [0:5] and [10:15] are used. and range (5:10) is excluded?

[quote=“filthaut”]Dear Igor,

TFractionFitter makes explicit use of the normalization of the input histogram.
The second “template” histogram in your example (referred to as _hmc2 in your
macro) is normalized to unity. This implies that effectively, you’re giving TFractionFitter
much too much freedom to fluctuate this template.

Use the un-renormalized histogram and you should be fine (I tested this briefly by
scaling _hcm2 up by a factor of 1280, but even that is presumably an underestimate).

Regards,
Frank[/quote]