Dear experts,
I came up with some complications lately trying to use RooFit with weighted distributions.
I have a data distribution together with a signal and a background template and I’m trying to fit this data distribution with these two templates in order to estimate the fraction of signal objects in my data distribution.
RooDataHist faketemplate(“faketemplate”,“fake template”,sinin,h1);
RooHistPdf fakepdf(“fakepdf”,“test hist fake pdf”,sinin,faketemplate);
RooDataHist realtemplate(“realtemplate”,“real template”,sinin,h2);
RooHistPdf realpdf(“realpdf”,“test hist real pdf”,sinin,realtemplate);
RooDataHist data(“data”,“data to be fitted to”,sinin,hData);
RooRealVar fsig(“fsig”,“signal fraction”,0.1,0,1);
RooRealVar signum(“signum”,“signum”,0,ndataentries);
RooRealVar fakenum(“fakenum”,“fakenum”,0,ndataentries);
RooExtendPdf extpdfsig(“Signal”,“extpdfsig”,realpdf,signum,“sigrange”);
RooExtendPdf extpdffake(“Background”,“extpdffake”,fakepdf,fakenum,“sigrange”);
RooAddPdf model(“model”,“sig + background”,RooArgList(extpdfsig,extpdffake));
model.fitTo(data,RooFit::Minos(),SumW2Error(kTRUE),PrintEvalErrors(-1));
Usually, I run on real data distributions and there I don’t need the “SumW2Error(kTRUE)” and all works fine. But now, I’m performing a closure test and my “data” distribution as well as my fake templates are extracted from MC. It is a combination of MC fake samples to kind of represent what we would observe in real data and, of course, each entry in this distribution receives a weight proportional to the cross section of the sample it is from.
However, it seems that one cannot use SumW2Error(kTRUE) for Minos. Could anyone advise me what I could use in place ? The thing is I did all my studies with Minos so if I change to something else for my closure test, things might be difficult to compare.
Thanks