Hi @Stefanos21,
what makes you think it does not work? Or to phrase it differently:
I haven’t understood yet what the problem is.
EDIT:
Ok, I got it. Your constraint, in fact, works fine, but it’s brutal. It’s so brutal that the PDF is always zero. That’s because the sigma is 0.01. With
RooGaussian fconstraint("fconstraint","fconstraint",ngauss,RooConst(25.),RooConst(5.)) ;
the constraint is much less brutal, and you get reasonable fit results and also an NLL plot.
PS:
Use a smaller frame to get a nicer plot:
RooPlot* frame1 = ngauss.frame(Bins(10),Range(0., 100), Title("LL and profileLL in frac")) ;
