I am trying to use RooSimultaneous to fit with different datasets in different ranges, and this fit has a correlated variable that I need to get from the simultaneous result. I am not sure if this is allowed in the roosimultaneous, and if the same x variable will have correlation?
the code is like:
RooDataSet data1("data1", "data1", Tree1, RooArgSet(x)); RooDataSet data2("data2", "data2", Tree2, RooArgSet(x)); RooCategory sample("sample", "sample"); sample.defineType("1data"); sample.defineType("2data"); x.setRange("fitRange_1data", xmin1, xmax1); x.setRange("fitRange_2data", xmin2, xmax2); RooDataSet comdata("comdata", "combine data", x, Index(sample), Import("1data",data1), Import("2data",data2)); RooSimultaneous simPdf("simPdf", "simultaneous fit", sample); simPdf.addPdf(pdf1,"1data"); simPdf.addPdf(pdf2,"2data"); RooFitResult fitres = (RooFitResult*)simPdf->fitTo(comdata,Range("fitRange"), SplitRange(), Extended(true), Minos(false),Save(true)); type or paste code here
here data1 & data2 has to fit with the same x variable but in different range, however they are not correlated in x variable, but in another variable (let’s say it ratio). The fits looks quite weird, and I am not sure if the two dataset have correlation in x variable, do you have any suggestions?