I am trying to run a code with TFitter but the code is getting stuck. I mean that it runs for iteration and freezez. I can see on the screen some thing like this
Processing fit.C…
Integral for ttbar unscaled 5165.38
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 frac0 5.00000e-01 1.00000e-02 no limits
2 frac1 5.00000e-01 1.00000e-02 no limits
** 1 **SET LIMIT 1 0 1
PARAMETER 1 LIMITS SET TO 0 1
** 2 **SET ERRDEF 0.5
** 3 **MINIMIZE
FIRST CALL TO USER FUNCTION AT NEW START POINT, WITH IFLAG=4.
After IFlag=4 the coding is not moving ahead. I would also like to mention that there is a scale factor in the code which is causing this. Because when I run the code with out the scale factor there is no problem . A minimal example is attached. Please help. fit.C (1.86 KB)
Probably the minimization requires some time. You should maybe try with an higher print level for Minuit to see exactly what is happening.
I cannot say more, I would need the root files for running your script
I think the problem is coming from the fact that one of your input MC histogram has bins with negative content.
You cannot use such histograms with the TFractionFitter, which assumes histogram with Poisson bin content
I inspected the root files and found that the one which I scale does not have negative values. If I remove the scale factor then it perfectly works fine. Also upto a certain scale factor value for example 9 this works. But when I put 10 and onwards the code gets stuck. Any clues whats happening in this case. Thank you.
When I do the SetWeight() it really does not alter the results as compared to when no weights are applied. But when scaling factor is applied the result drastically improves.
I would need your updated files to look again into this. But, as I said, your input should not be scaled, but it should contain the Poisson counts you get from your MC. If you need to apply a different scaling, bin by bin, you can call SetWeight. The correct overall scaling factor is instead taking into account when fitting the MC to the data and it does not need to be applied to the histograms.
I used the same files that I have attached in the previous reply. I also tried using SetWeight. My scaling factor previously was 28, so I used the same value for SetWeight also. You can also give a try. If you need the updated code I can send you.