Set range for each individual component of Tfractionfitter

Hi Experts,

I am using Tfractionfitter to calculate the fractions for each components of MC in data. I followed the instruction given in TFractionFitter. The outcome of the fitter is something i don’t expect. So I was thinking,
is there any procedure to set different range for each MC distribution in the data fit? (because some bins of the histogram are found empty.)

fit_fraction_ex.cc (3.4 KB)
Data_hist_2bdt_100_2016BF.root (12.6 KB)

Many thanks in advance.
Chandi


ROOT Version 6.11/03):
ubuntu 16.04


Hi,
There is no procedure to set different ranges in the MC inputs.
Empty bin should be dealt fines, as described in the original paper.
The output seems fine to me, what is wrong ?

Lorenzo

Hi Lorenzo,

Many thanks for your response. Actually I was expecting something different value of the fractions, so I thought may be this was due to empty bin of the MC histograms.

Is it possible to check value of the fractions from the fit with other method?

Many thanks
Chandi

Hi,

You might try using the HistFactory to build a RooFit model and then fit the different components. The treatment of the statistical uncertainty of the MC template is slightly different, but you can add systematic contributions t each of them.
See https://cdsweb.cern.ch/record/1456844

Lorenzo

Hi Lorenzo,

Thanks for your suggestion. I have two questions,
First Is it possible to give a initial value to the parameter in Tfractionfitter because i don’t see any initialization function for parameter.
Second, A/c to you suggestion, the steps I have to follow is first I have to build RooHistPdf and then make a fit using it to the data ? Do you have any sample code to follow?

many thanks
Chandi

Hi

  1. Using the TFractionFitter::GetFitter you have access to the ROOT::Fit::Fitter class.
    There you can use the Config() method to return a ROOT::Fit::FitConfig and set initial parameter values.
    See https://root.cern.ch/doc/v608/classROOT_1_1Fit_1_1FitConfig.html

  2. You don’t need to make a RooHistPdf. You need to build either using XML files or C++/Python code a model. An example for doing this is the tutorial

tutorials/histfactory/example.C

Lorenzo

Hi Lorenzo,

To use the Config() method, I tried this one but it is giving error.
"
TObjArray mc = new TObjArray(3);
mc->Add(h00);
mc->Add(h01);
mc->Add(h02);
TFractionFitter
fit = new TFractionFitter(h0D, mc);
fit->Constrain(0,0.0,1.0);
fit->Constrain(1,0.0,1.0);
fit->Constrain(2,0.0,1.0);
TVirtualFitter* vfit= (TVirtualFitter*)fit->GetFitter();
//TVirtualFitter* vfit= fit->GetFitter(); //This line doesn’t work which is written in TfractionFitter.cxx class.
vfit->ROOT::Fit::FitConfig().SetParamsSettings(0,0.2,0.01); // is it a correct way to initialize the parameters?
Int_t status = vfit->Fit(); //
"
The error in compiling the code,

/home/chandi/bmmsystematics/fit_fraction_ex.cc:55:20: error: qualified member access refers to a member in namespace ‘ROOT::Fit’
vfit->ROOT::Fit::FitConfig().SetParamsSettings(0,0.2,0.01);
~~~~~~~~~~~^
/home/chandi/bmmsystematics/fit_fraction_ex.cc:56:24: error: no member named ‘Fit’ in ‘TVirtualFitter’
Int_t status = vfit->Fit();

Many thanks
Chandi

Hi,

Which ROOT version are you using ? Because the type of the Fitter changed in ROOT 6 from TVirtualFitter to ROOT::Fit::Fitter

Lorenzo

Hi Lorenzo,

I have clearly mentioned in my first mail. Its is ROOT 6.11/03, in Ubuntu 16.04

Many thanks
chandi

If you are using ROOT 6.11 you should cast to the ROOT::Fit::Fitter class and not TVirtualFitter

Cheers

Lorenzo

-------- Messaggio originale --------

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