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.)
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 ?
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?
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
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?
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
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
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();