How to get n_events from RooDataSet?

Hello!

How to get n_events from RooDataSet object?
I created obj and want to use it in another function.

RooDataSet* data = pdf.generate(t,100);

I did not find appropriate method root.cern.ch/doc/master/classRooDataSet.html.

Thank you in advance.
Best regards, Vladislav.

Hello Vladislav,

the method is inherited from RooAbsData and is RooAbsData::numEntries().
This runable example will get you started:

RooWorkspace w("w") ;
w.factory("Gaussian::sig1(x[-10,10],mean[5,0,10],0.5)") ;
auto data = w.pdf("sig1")->generate(*w.var("x"),1000) ;
// Here you obtain 1000
data->numEntries();

Cheers,
D

Dpiparo, many thanks!