RooPlot: both line and fill of a pdf component

Dear Experts,
I’ve already posted this question.
Please it should be relatively easy to answer.

I would like to plot a curve with a line and
a fill pattern in RooFit, for example:

TotalPDF->plotOn(myFrameX, Components(*MassSignal), LineStyle(7), LineColor(kBlue), FillStyle(3345), FillColor(kBlue), DrawOption(“LF”));

If I do that, the plot shows only the fill, without the line.
Can you please tell me how can I plot both line and fill ?

Many thanks,

  • Mauro.

Could you (as a work around) not just plot it twice with different options (once as line and once as filled)?
That’s what I do for data sometimes to have the data on top.

Hi Lukash,
sure I could do that, but it is extremely annoying when you need to plot the legend,
because in the list of the objects of the frame there are some entries repeated twice.

This example won’t work indeed :
for (unsigned int i = 0; i < 2nElements; i++)
{
TString objName = myFrameY->nameOf(i);
if ((objName == “”) continue;
TObject
obj = myFrameY->findObject(objName.Data());
legY->AddEntry(obj,legNames[it++],“LP”);
legY->SetTextFont(42);
}

Of course with little programming effort I can make every work around that I want,
but I was wondering whether ROOT-programmers had a way to do this properly.

Thanks,

  • Mauro.