Custom binning for RooRealVar

Dear Experts,
is there a way to implement a custom binning for a RooRealVar. In particular I have a vector with bin edges and I’d like to force the binning into a RooRealVar.

For instance for a TH1D i would do

std::vector<double> bins; 
TH1D* h = new TH1D("h", "h", bins.size()-1, bins.data()); 

is there such a functionality for a RooRealvar?

I read that there are similar funcionalities explained in Binning Tutorial but not really what I am looking for.

Thanks in advance
Elia :slight_smile:

Hi @Elia_Giulio_Grandoni,

Thank you for your question. I’m adding @jonas in the loop.

Dear @Elia_Giulio_Grandoni,

the RooBinning class is what you’re looking for, in particular this constructor.

Then you can set the binning to the RooRealVar with RooRealVar::setBinning()

Cheers,
Jonas

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.