When I try to add the uncertainty to the plot it removes the regular line in the histogram.
Thank You so much for help.
‘’’
TH1D* beyondThreshold = new TH1D(“beyondThreshold”, “Current Beyond threshold on
January”,NumBins, 0, NumBins);
beyondThreshold → GetXaxis()-> SetTitle("Current [#muA] ");
beyondThreshold → GetYaxis()-> SetTitle(“Ratio”);
beyondThreshold->Sumw2(kTRUE);
for(ULong64_t i = 0; i < NumBins; i++)
{
Threshold = i;
Int_t above = 0;
for(ULong64_t e = 0; e < nEntries; e++)
{
currentAna->GetEntry(e);
if( abs(Curr) >= Threshold )
{
above++;
}
p = (1.0above)/(1.0nEntries);
beyondThreshold->SetBinContent(i+1,p);
}
if (i)
beyondThreshold->SetBinError(i+1,sqrt(p*(1-p)/nEntries));
else
beyondThreshold->SetBinError(i+1,0.0);
}
TCanvas* c2 = new TCanvas("c2");
c2->SetLogy();
beyondThreshold->SetLineColor(2);
beyondThreshold->SetMarkerSize(0.3);
beyondThreshold->SetMarkerStyle(31);
beyondThreshold->Draw("E");
beyondThreshold->SetOption("e1p");
c2->Update();
‘’’