{ RooRealVar x("x","var x",0.,1.); RooRealVar y("y","var y",-5.,+5.); RooCategory c("c","charge"); c.defineType("Plus",+1); c.defineType("Minus",-1); RooDataSet data("data","data",RooArgSet(x,y,c)); TRandom3 rnd; for (int i=0; i<1000; i++) { x.setVal(rnd.Uniform()); y.setVal(rnd.Gaus()); if (rnd.Uniform()<0.5) c.setLabel("Plus"); else c.setLabel("Minus"); data.add(RooArgSet(x,y,c)); } data.Print("v"); }