Combining multiple individually weighted RooDataSets?

Ok, it wasn’t easy, but here’s what needs to be done:

  • All datasets (the final one and the ones you use for merging) need to have a WeightVar(scale) set.
  • You need to change the value of scale before you create the intermediate datasets. Since the original data that you Import() from don’t have values for scale, it just retains the value that it had before the dataset was created.
  • Then append to the global dataset.

Side note:
The usual syntax for getting a value is getVal(). getValV() is only if you really want that the object recomputes its value. It does that automatically, though, if necessary.

And here’s a working example:
tester.C (2.9 KB)