Problem loading RooClassFactory::makePdfInstance class

Dear experts,
I’m generating ROOT code with the instruction:
RooAbsPdf* _AnglesPDF = RooClassFactory::makePdfInstance("_AngleS","_AngleS",RooArgSet(*VarsAng));

Then, when I try to use the generated classe in the following way:
RooAbsPdf* _AnglesPDF = new Roo_AngleSPdf("_AngleS","_AngleS",RooArgSet(*VarsAng));

I get the following error message:

ExtractYield.cc:983:33: error: no matching constructor for initialization of 'Roo_AngleSPdf' RooAbsPdf* _AnglesPDF = new Roo_AngleSPdf("_AngleS","_AngleS",*VarsAng); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Roo_AngleSPdf.h:26:3: note: candidate constructor not viable: requires at most 2 arguments, but 3 were provided Roo_AngleSPdf(const Roo_AngleSPdf& other, const char* name=0) ; ^ ./Roo_AngleSPdf.h:18:3: note: candidate constructor not viable: requires 0 arguments, but 3 were provided Roo_AngleSPdf() {} ; ^ ./Roo_AngleSPdf.h:19:3: note: candidate constructor not viable: requires 8 arguments, but 3 were provided Roo_AngleSPdf(const char *name, const char *title, ^ 1 error generated.

Why it doesn’t understand RooArgSet ?
How shall I change the code in order to make it work ?

Many thanks for your support.

  • Mauro.

Hello,

According to the doc:

The returned object is an instance of the object you just defined connected to the variables listed in ‘vars’.

so _AnglesPDF is already something ready to use.
The name of the object is ‘name’ ("_AngleS" in your case), its class name RooClass, Roo_AngleSClass in your case.

Does this help?

G Ganis

Hi Ganis,
many thanks for your reply.
It’s true that _AnglesPDF is already available.
but the point here is that I create the library with makePdfInstance and then,
in a different program, I want to load them and use them.

So, the question is what’s the calling sequence for the library ?
It was created with "_AngleS","_AngleS",RooArgSet(*VarsAng),
but then when I call it in another program with the same calling sequence
I get the error message above.

It’s like the library does not understand RooArgSet.

Many thanks for your support.

  • Mauro.

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