Relationship/Constraints on variables

Hi all,

I have an invariant mass distribution which has multiple peaks in it. Each of these is modelled with a Gaussian. I know what the separation between each peak should be - i.e. the second peak is, say, 600 MeV above the first and the third peak is 900 MeV above the first.

In my fit, I want the mean of the first peak to be allowed to be floated, but have the other two means set this known distance apart. I tried:

RooRealVar mean1(“mean1”,“mean1”,500,0,10000)
RooRealVar mean2(“mean2”,“mean2”,mean1.getVal()+600)
RooRealVar mean2(“mean2”,“mean2”,mean1.getVal()+900)

But this just sets the second two to constants at their initial values of 1100 and 1400. How do I build in the relationship between the three variables?