Dear all
I observe a strange behaviour when plotting the projection of a log likelihood curve. While
works fine
does not, it shows a wrong distribution of the log likelihood. Is this expected / a feature / a bug?
A full example is below.
Thanks in advance
Michel
RooRealVar alpha("alpha","alpha", -TMath::Pi(), TMath::Pi() );
RooRealVar A("A","A", 1.0, -5.0, 5.0 );
RooRealVar B("B","B", -2.0, -10.0, 10.0 );
RooRealVar offset("offset","offset", 4.0);
RooGenericPdf myPdf1("myPdf1", "myPdf1", "offset + A*TMath::Cos(alpha) + B*TMath::Sin(alpha)", RooArgList(offset, alpha, A, B));
RooDataSet* ds = myPdf1.generate( alpha, 10000 );
myPdf1.fitTo( *ds );
RooAbsReal* nll = myPdf1.createNLL(*ds);
RooMinuit(*nll).migrad() ;
RooPlot* plot = A.frame( RooFit::Range( 0.5, 1.5));
//nll->plotOn( plot, RooFit::ShiftToZero() ); // good
nll->plotOn( plot, RooFit::ShiftToZero(), RooFit::Range( 0.5, 1.5) ); // bad
plot->Draw();