Hi All, I am thinking how to add two pdf with different range? Suppose pdf1 is a pdf function describe observable x in range [0,5], pdf2 is another function describe the same observable x in range [2,7]. Can I use RooAddPdf or something else to add these two pdf together?
I can only think of generate two data sets in each range for each pdf function, then add two data sets together. Like
RooRealVar x("x","x",-10,10) ;
RooGenericPdf pdf1 ("pdf1","pdf1","...","...");
RooGenericPdf pdf2 ("pdf2","pdf2","...","...");
x.setRange[0,5];
Roodataset *data1 = pdf1.generate(x,5000);
x.setRange[2,7];
Roodataset *data2 = pdf2.generate(x,5000);
data1->append(*data2);
But I have no idea how to add the pdf function together if they do not have the same range. Could someone help me out? Thanks a lot