Hello,
I’m trying to get a ratio plot for roofit result and data historgram like this:
const int nBinY = 20;
const Double_t binsY[nBinY+1] = {-0.0734,-0.0562,-0.0428,-0.0320,-0.0236,-0.0170,-0.0118,-0.0078,-0.0046,-0.002,0.0,0.002,0.0046,0.0078,0.0118,0.0170,0.0236,0.0320,0.0428,0.0562,0.0734};
RooBinning bin_dcaxy(nBinY,binsY);
TH1D* h_DcaData= somthing....
RooDataHist h_Data("h_Data","h_Data",RooArgSet(x),h_DcaData);
RooGaussian MCP_pdf("gauss","gaussian PDF",x,mean,sigma);
RooGenericPdf power_pdf("power_pdf","power_odf","1/pow((1+power_a*abs(x)),power_n)",RooArgSet(x,power_a,power_n));
RooAddPdf MCDCAmix_pdf("MCDCAmix_pdf","P+NP exML",RooArgList(MCP_pdf,power_pdf),RooArgList(pNum,npNum));
MCDCAmix_pdf.fitTo(h_Data,Extended(kTRUE));
I could follow the tutorial to get the two component pdf with data plot. But in order to check how good is the fit, I need to draw the data/fit plot (ie. RooDataHist h_Data / RooAddPdf MCDCAmix_pdf ), totally no idea about it especially for the data has special binning.
Thanks.