Dear experts,
I have encountered a breaking change in ROOT 6.22 and would like to hear your opinion on this issue. In ROOT 6.22, RooResolutionModel got an update where the convolution variable x is not a RooRealProxy, but a RooTemplateProxy<RooAbsRealLValue>. The associated changes actually break some user code because constant resolution models cannot return a reference to their proxy any more and const instances of classes inheriting from RooResolutionModel cannot obtain references to their own Proxies. This is illustrated in the following example code:
#include "RooRealVar.h"
#include "RooTemplateProxy.h"
#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooAbsRealLValue.h"
struct ResolutionModel_6_20 {
RooRealProxy x;
RooRealVar& convVar() const { return (RooRealVar&) x.arg(); }
};
struct ResolutionModel_6_22 {
RooTemplateProxy<RooAbsRealLValue> x;
const RooAbsRealLValue& convVar() const { return *x; }
RooAbsRealLValue& convVar() { return *x; }
};
int main()
{
const ResolutionModel_6_20 r620;
const ResolutionModel_6_22 r622;
RooRealVar& xref620 = static_cast<RooRealVar&>(r620.convVar());
RooRealVar& xref622 = static_cast<RooRealVar&>(r622.convVar()); // Does not compile
}
The last line in main() does not compile. The code compiles if the Resolution models are not marked as const as I said, but fixing that in some library I use is not that straight forward because of classes that are derived from RooResolutionModel who modify their own proxies in methods marked as const etc etc . So my question is: Are these changes here to stay and was it intended to effectively stop treating the dependent Proxy variable as a mutable, or has something been overlooked?
Thank you in advance!