fca
May 16, 2020, 6:49am
1
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.20/05
Platform: Mac OS X Catalina
Compiler: Apple clang version 11.0.3 (clang-1103.0.32.59)
I think there is definitely a problem with error bars in variable bin histograms with log axis. See the following script
#include <TCanvas.h>
#include <TH1F.h>
int testLOGfca() {`
double dbl_min = 1e-9;
double dbl_max = 1e+8;
int int_nbinsLog = 1000;
double min_log = TMath::Log10(dbl_min);
double max_log = TMath::Log10(dbl_max);
double bin_width = ( max_log - min_log) / (int_nbinsLog+1);
double logbins[int_nbinsLog + 1];
for(int k = 0; k <= int_nbinsLog; ++k)
logbins[k] = TMath::Power(10., min_log + k * bin_width);
TCanvas* canvas = new TCanvas();
canvas->SetLogx();
canvas->SetLogy();
TH1D* histo = new TH1D();
histo->SetBins(int_nbinsLog, logbins); // Logarithmic binning
for(int j=1; j < histo->GetNbinsX(); ++j)
histo->SetBinContent(j,TMath::Power(10., j*17./1000.));
histo->Draw("hist e");
return 0;
}
fca
May 16, 2020, 9:54am
3
If you run the script you get “absurd” error bars. Try and see Best
Federico Carminati
Chief Innovation Officer
CERN openlab
1211 Geneva 23
Switzerland
Tel: +41 22 76 74959
Fax: +41 22 76 68505
Mobile: +41 75 411 4843
I see nothing “absurd”. Try: histo->Sumw2(kTRUE); histo->Print("all");
fca
May 16, 2020, 3:15pm
5
@couet This is what I obtain. there is a set of point that appears only when the “e” option is present. Best,
Federico Carminati
Chief Innovation Officer
CERN openlab
1211 Geneva 23
Switzerland
Tel: +41 22 76 74959
Fax: +41 22 76 68505
Mobile: +41 75 411 4843
bugroot.pdf (211 KB)
couet
May 18, 2020, 9:37am
6
@fca this is what I get with your macro with the master version of ROOT. I do not see that set of point visible in your plot. Can you try with a more recent ROOT version ?
fca
May 20, 2020, 6:30am
7
Tu as raison Olivier,
avec a toute dernière version ça marche. Merci!
Federico Carminati
Chief Innovation Officer
CERN openlab
1211 Geneva 23
Switzerland
Tel: +41 22 76 74959
Fax: +41 22 76 68505
Mobile: +41 75 411 4843
couet
May 20, 2020, 7:36am
8
Salut Fed,
Oui il y a eu une correction.
Olivier
fca
May 20, 2020, 8:12am
9
Merci Olivier,
Amitiés,
Federico Carminati
Chief Innovation Officer
CERN openlab
1211 Geneva 23
Switzerland
Tel: +41 22 76 74959
Fax: +41 22 76 68505
Mobile: +41 75 411 4843
DMA
May 28, 2020, 1:15pm
10
I still encounter the same problem.
Using the macro given above, I have “crazy” error bars.
I have install ROOT with the command line > yum install root
The available package is root-6.20.04-2
My OS is fedora 30.
I am wondering if this version is really the master version of ROOT or if there is another problem ??
This seems to be a bug in the ROOT 6.20/04 “tag” which has been fixed in the “patches” branch.
system
Closed
June 11, 2020, 2:16pm
13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.