Draw pulls without error bars

Hello experts,
I am doing a fit with roofit and I want to draw also the fit pulls. As per their definition, they should not have error bars.
I have a RooRealVar deltaE and a RooPlot xframe on which I plot an histogram and the result of a fit. I then do

RooPlot *pull1_frame = deltaE.frame();
RooHist* hpull1 = xframe->pullHist();
pull1_frame->addPlotable(hpull1,"p");

but the resulting histogram is drawn with error bars, even though I use the “p” option only.
Can anybody suggest me the trick to draw this histogram without it’s error bars?

Hi @Riccardo_Manfredi!

The pull histogram class in RooFit is inheriting from TGraphErrors. Therefore, you can easily reset the errors before plotting:

   for(int iPoint = 0; iPoint < hpull1->GetN(); ++iPoint) {
      hpull1->SetPointEYlow(iPoint, 0.0);
      hpull1->SetPointEYhigh(iPoint, 0.0);
   }

I hope this helps!
Cheers,
Jonas

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.