"Force" RooFit proxy list creation in new class

Dear experts,

I have the following question.
I’m creating a new RooFit class which inherits from RooAbsReal.
Because of some external constraints, I would prefer not to have the various RooRealVar parameters of the function in the constructor, but I would like to create them “internally”.
So, I created a protected RooArgList of coefficients which is filled up when an object of this class is created (in the constructor implementation)
Now, I would like that this object has these coefficients both in the server list and the proxy list.
To make an example, this is what happens when you create a RooGaussian: mean and sigma are included in these two lists.
I managed to add each coefficient in the server list by simply doing:

this->addServer( *coeff );

If I do a Print(“v”), I see that the server list is properly filled, indeed.
Apparently, I don’t manage to do the same for the proxy list. All the methods that would allow to do that are protected. Why? How can I do that?

Thanks,
Vincenzo

Hi,

The problem is that you need to create the data members as RooRealProxy. By calling the RooRealProxy constructor the proxy will automatic register and be in the list. Otherwise I don’t see a way to do it differently if you want to create the parameter internally

Best Regards

Lorenzo