Hello Roofiters,
I’m trying to do a fit of my data by using Monte-Carlo. My main issue is that my data need to be recalibrated and I wanted to do the re-calibration while I’m fitting the amplitudes of the Monte-Carlo components.
Here is how I’m setting up the re-scaling of the data:
RooRealVar Eraw("Raw_Energy_keV","Raw_Energy_keV",0, 0, 2500) ;
Eraw.setBins(100);
RooDataSet data("ds","ds",RooArgSet(Eraw));
//....... Fill data by looping over TTree
RooRealVar scalingFactor("scalingFactor","scalingFactor",1, 0, 5000);
RooFormulaVar EcorrFormula("Ecorr","Corrected energy"," (Raw_Energy_keV*scalingFactor)",RooArgSet(Eraw, scalingFactor));
RooRealVar* Ecorr = (RooRealVar*) data.addColumn(EcorrFormula) ;
Then, I create my MC PDFs by using RooHistPdf
and the variable Ecorr
. I combine those PDF into one model by using workspace factory.
My main questions is: during the fit, is the fitter going to use scalingFactor
as a free parameter ?
Is doing that enough ?
// Create likelihood function
RooAbsReal* nllE = modelEcorr->createNLL(data, NumCPU(2), Extended(true), Range(fit_range_min, fit_range_max));```
RooMinuit* minimizerEnergy = new RooMinuit(*nllE);
auto fit = minimizerEnergy->fit("m");
I would like to know that before modifying my full fitter.
Thanks,
Quentin