RooDataSet from RooAbsData

Dear roofit experts

I’m trying to convert RooAbsData to a RooDataSet (in order to perform an unbinned fit) but I can’t find any simple way as the RooDataHist method to do that:

[color=#0040FF]RooDataHist (const char *name, const char *title, const RooArgSet &vars, const RooAbsData &data, Double_t initWgt=1.0)[/color]

I guess it should be possible to do that since RooDataSet is inheriting from RooAbsData class …

Any solution?

Thanks in advance !

Léo.

Hi,

RooAbsData is an abstract interface.
Can you check the actual type of the pointer/reference?
For example:

cout << myRooAbsData.ClassName() << endl;

D

Hi,

Thanks for this fast reply !

I misunderstood the nature of RooAbsData class. I mean, I got the output of a function which returning generated data sample as RooAbsData. Using the code you gave to me point out that the type of the output is in fact RooDataSet …

So I don’t need to convert anything !

Thanks again.

Léo.

Hi Leo,

this is cplusplus.com/doc/tutorial/polymorphism/
Glad you solved your issue!

Danilo