Channel combination using HistFactory

Dear Statistics Experts.

I am having some problems with combining channels using HistFactory,
namely it seems to me that the created Asimov data has some very weird behaviour.

I have attached a small script to as an example of what I am trying to do:
fittingScript( nChan ) :
This creates four histograms and saves the in histFile.root:
Two signal and two background with some random data.
This should correspond to measurements in two different channels.

dofit( nChan ) :
This will start by creating a HistFactory::Measurement
Then loop over nChan (can either be set to one or two).
Add the signal and background histogram for each channel from above,
and collect everything in a RooWorkspace (ws).

In the final part it will retrieve the Asimov data and the signal and background shapes,
and save these in a file: tempFile.root.

If you try running the script with nChan = 1:
fittingScript+(1) it behaves just as I expect it to. Looking at tempFile there is
some Asimov data and histograms that correspond well to each other.
The Asimov data is normalized to 4.5 which should be the case for this.

If you run the script with nChan = 2:
fittingScript+(2) the created Asimov data seems completely off. It is first of all normalized to
9 in both channels, which I don’t really understand why. More problematic however is that it seems
to have almost all of its integral contained in either the first of the last bin.

Is this a numerical problem, or am I maybe doing something completely wrong?

I’m testing with my local root version (5.34.11) and the current version retrieved from
cvmfs (5.34.14-x86_64-slc6-gcc4.7)

Thanks in advance.
Best regards,
fittingScript.C (4.81 KB)