I use the RooKeysPdf to model the background shape in MC data and use this shape to fit the real data sample. Then use SPlot technology to get the signal. The sweighted signal shape is totally wrong. If I do not include the RooKeysPdf component to fit the data sample, just exponential for combinatorial background and CB for peaking backgrounds, I can get correct sweighted signal shape. Can I use RooKeysPdf in SPlot?
This is the code for using RooKeysPdf:
TFile ff("phietap.root", "read");
RooWorkspace* workspace = (RooWorkspace*)ff.Get("workspace");
RooKeysPdf* Phietap = (RooKeysPdf*)workspace->pdf("phietap");
then include this PDF in RooAbsPdf, and use the RooAbsPdf PDF to fit the real data and do the SPlot. The contribution of the RooKeysPdf in data fit is small, but the output of with or without the RooKeysPdf are totally different.