Adding binomial Uncertainty in histogram

Trying to add the binomial uncertainty in my histogram.

for(ULong64_t i = 0; i < NumBins; i++)
    {
        Threshold = i;
        Int_t count = 0;

        for(ULong64_t e = 0; e < nEntries; e++)
            {
             currentAna->GetEntry(e);
            if( abs(Curr) < Threshold ) continue;
            {
                count++;
            }
        }
        beyondThreshold->SetBinContent(i+1, count*100/nEntries);
        cout << Threshold << "\t \t" << count << endl;
    }
    TCanvas* c2 = new TCanvas("c2");
    c2->SetLogy();
    beyondThreshold -> SetMarkerStyle(1);
    beyondThreshold->Draw();
    beyondThreshold->SetTitle("Percentage");
   // beyondThreshold->GetYaxis()->SetRangeUser(0, 0.5);
   // beyondThreshold->GetXaxis()->SetRangeUser(0, 5);
    c2->Update();

I am looking to add binomial uncertainty at each threshold bins. How can I accomplish that?

I don’t really know what you want, but you can always:

beyondThreshold->SetBinContent(i+1, Double_t(count) * 100. / Double_t(nEntries));
beyondThreshold->SetBinError(i+1, some_value_that_you_want);

I wanted to insert a small vertical bar to show the uncertainty, but the code remove the histogram with the vertical line.

Thank You so much.

https://root.cern/doc/master/classTHistPainter.html#HP09

Thank you for such quick response.
It removed my histogram and give a vertical line from x-axis to point of error.