Hello Renato,
Adding log-likelihoods looks OK to me.
If you only want to construct a single log-likelihood, another option would be to construct a simultaneous PDF of the two pdfs, and make a combined dataset of the binned and unbinned data.
You can do this by making both datasets unbinned, and combining them as follows:
RooCategory samples("samples", "samples");
[... add category names here ...]
RooArgSet datasetVars(x, y, weight, sample);
std::map<std::string, RooDataSet*> sampleMap;
sampleMap["xSampleName"] = &dataX;
sampleMap["ySampleName"] = &dataY;
RooDataSet combData("combData", "combined data", datasetVars, Index(sample), WeightVar(weight), Import(sampleMap));
Check out this constructor to see how you combine datasets from different categories:
https://root.cern.ch/doc/master/classRooDataSet.html#aeea71f616bd2cc6743f6869d31a4dbd5
To make the dataset unbinned, use the bin center of the histogram as x value and set the weight of the event to the bin content. You will get the exact same probabilities, but the “shape” of the dataset looks different.
A similar approach is being discussed in