RooPlot showing the number of entries instead of the entries value

I created a variable d with it’s frame

RooRealVar d(“d”,“distance from the target”,0.0,Distance[0],Distance[NDistance-1]);
RooPlot *dframe = d.frame();

Then created a second variable:

RooRealVar HitPerc("#frac{N_{hit}}{N_{Tot}}",“Hit and miss quotient”, 0.0, 0.0, N, “%”);

Here’s the problem: I want to create a dataset where the HitPerc variable is a function of the d variable which I created with:

RooDataSet *DataHitPerc = new RooDataSet(“DataH”,“droplets hit versus distance”,RooArgSet(d,HitPerc));

Then I added points to the dataset using

DataHitPerc → add(RooArgSet(d,HitPerc));

But when I write:

DataHitPerc → plotOn(dframe);

I obtain as graph the number of entries for each value of d instead of the entries value at a given d; how do I solve it?

ROOT Version: 6.22/06
Platform: Ubuntu 20.10
Compiler: (Ubuntu 10.2.0-13ubuntu1) 10.2.0


Hi,

When plotting a dataset in a RooPlot, what is showns is the distribution of the variable, i.e an histogram showing the number of content for each bin in teh variable. By default a RooRealVar is binned with 100 bins in his range.
What exactly what you like to show, variable 2 vs variable 1 ? In that case is maybe better you crate a scatter plot or a TGraph object yourself with the variable values that you can retrieve from the RooDataSet.

Cheers

Lorenzo

Thank you, creating the tgraph solved it.