Error and bins in TH1F histograms

I’d like to plot errors in a TH1F histogram, so I use Sumw2() function. The result is the errors I wanted, but unfortunately I can’t have the filled bins like I had before. So my question is, how can I plot the errors, and the filled bins together in the histogram.

Example

void fille() { TH1F *h = new TH1F("h","test",100,-3,3); h->Sumw2(); h->FillRandom("gaus",5000); h->SetFillColor(kRed); h->SetMarkerColor(kBlue); h->SetMarkerStyle(21); h->Draw("hist"); h->Draw("e1p same"); }
Rene

Thank you very much. It’s not exactly what I had in mind. I wanted to have the classic rectangle histogram, and on tope of that, to have the errors. Is that possible. If it’s a problem, I’ll go on with the solution you gave me.
Aye.

I attach the plot I got.
ref_dR.ps (14 KB)

Simply select the desired draw option, eg

void fille() { TH1F *h = new TH1F("h","test",20,-3,3); h->Sumw2(); h->FillRandom("gaus",1000); h->SetFillColor(kRed); h->SetMarkerColor(kBlue); h->SetMarkerStyle(21); h->Draw("e2"); h->Draw("e1p same"); }

Rene