the code (1) still does not work with “GetLowerRefGraph” at line 127. When I run I still have the error message (2) like it does not find the graph. Do you see what is wrong? When I run the code without this I have the warning (3), but I do not see where this is comming because all the bins are fill. Do you have an idea?
Regards
(2)
warning: null passed to a callee that requires a non-null argument [-Wnonnull]
ratio -> GetLowerRefGraph() -> SetMinimum(-1);
(3)
Warning in TGraphAsymmErrors::Divide: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in TGraphAsymmErrors::Divide: Number of graph points is different than histogram bins - 56 points have been skipped
(2) Move ratio->Draw(); at least 2 lines up (i.e. ahead of the first “GetLowerRefGraph” call).
(3) Most probably, some data points are 0 and then they are skipped (you will probably see them if you comment out / remove all “SetRangeUser” calls).
I just ran your macro. I do not see the error you mentioned. I get:
root plot.cc
-------------------------------------------------------------------
| Welcome to ROOT 6.15/01 http://root.cern.ch |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 |
| From heads/master@v6-13-04-886-gcea240d1e8, Aug 09 2018, 11:10:02 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
-------------------------------------------------------------------
root [0]
Processing plot.cc...
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 58 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 59 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 60 points have been skipped
root [1]
As @Wile_E_Coyote said before: it means that the TGraphAsymErrors created from the 2 histos has less points than the number of bins in the histograms. I guess because your histograms have bin with 0 content and dividing by 0 is not possible,