Integral on various sub-ranges

Dear RooFit experts,

I have a model which I built as an extended pdf sum of signal and background, e.g.
RooAddPdf model(“model”,“model”,RooArgList(signal,bkg),RooArgList(nsig,nbkg));
with obvious notation.
Now I would like to get the number of signal events in a given range.
The suggested roofit method is the following (if I understood manual and examples correctly):

  • build an extend pdf with a variable (“nsig_range”) defined in the desired range
  • fit to data
  • nsig_range holds the right value.
    But if I want to do this with different ranges, and perhaps, various pdfs, do I have to fit and fit every model?
    Moreover using workspaces this is not very convenient, since in principle all my composite models should be defined in advance, while the range is often defined afterwards.
    Isn’t there a method from a composite model to get an integral (plus error, possibly) in a given range?
    (createIntegral method doesn’t seem to answer to my question).

thanks in advance,
Francesco