Question with RooCategory and RooSimultaneous

Hi,

I am writing a simple macro in order to fit a spectrum with multiple peaks so I am using RooSimultaneous to generate different p.d.fs (same shape but different means). I created categories for splitting but I don’t how to tell the program to take mean values for each p.d.f created.
Morevover, I would like to know if it is possible to read these info from a file (like catname - mean value). (There is a method called readFromStream but it is not very clear for me what this method does with the file)

Here is the code

[code]void FullSpectrumFit()
{

// Construct gauss(x,m,s)
RooRealVar x("x","x",0,20);
RooRealVar m("m","m",0,0,20);
RooRealVar s("s","s",1,0,20);
RooGaussian gauss("gauss","gauss",x,m,s);

RooCategory c("c","c");

c.defineType("Ka");
c.defineType("Kb");
c.defineType("La");
c.defineType("Lb");
c.defineType("Lg");

//Modifiy mean values somewhere

RooWorkspace w("w","w") ;
w.import(RooArgSet(gauss,c)) ;

RooSimWSTool sct(w) ;
RooSimultaneous* model_sim = sct.build("model_sim","gauss",SplitParam("m","c")) ; 

model_sim->Print("t");

}[/code]

I think you need to make a separate RooGaussian with its own mean parameter (set to a different value) for each one of your categories. Then you can make the RooSimultaneous in the usual constructor way.