Problem with replacement

Hi,

I have a naive question. In RooFit, I have a line like:
ws->factory(“EDIT::mypdf(pdf,X=Y)”);
but I get the error:
ERROR:ObjectHandling – RooAbsCollection: cannot replace “X” with already existing "Y"
which I think is because it refuses to replace if Y already occurs. (I tried to simply the example above.)

Why does this happen, and is there any way around this?

Thanks,
Eric

Hi,

Can you please post the minimal running script showing this error, so it can be investigated ?

Thank you

Lorenzo