Fill histo with a RooRealVar

Hi

one question: I have a code like that

Loop

  1. Fit my data
  2. Get my mean with error with:
    RooRealVar* mean_fitresult = (RooRealVar)fr->floatParsFinal()->find(“mean_jpsi”);

end of loop

How fill a histo with the mean-fitresult value ?

I don’t know how to fill the histo at each loop with Roofit

Hi,

If you want to fill a TH1, you can retrieve the
value of a RooRealVar through getVal(), e.g.

myTH->fill(mean_fitresult->getVal()) ;

If you want to fill a RooDataHist you do this
as follows

// before the loop
RooDataHist dh(“dh”,“dh”,*mean_fitresult) ;

// in the loop
dh.add(*mean_fitresult) ;

Wouter