Please read tips for efficient and successful posting and posting code
_ROOT Version:_6.27/01
_Platform:_Ubuntu
Compiler: PyROOT (Python 3)
Hello,
I have created two histograms from RDataFrame and would like to create a ratioplot from them both. I am using the following code:
c1 = ROOT.TCanvas()
hist = df.Histo1D(("Ditau_m", "ditau_m", 100, 0, 1000),"ditau_m")
hist1 = df.Histo1D(("Ditau_m_mmc", "ditau_m_mmc", 100, 0, 1000),"ditau_m_mmc")
hist.Scale(hist.GetXaxis().GetBinWidth(1) / hist.Integral(), "width")
hist1.Scale(hist1.GetXaxis().GetBinWidth(1) / hist1.Integral(), "width")
hist.SetLineColor(ROOT.kRed)
hist1.SetLineColor(ROOT.kBlue)
hist1.Draw("HIST")
hist.Draw("SAME HIST")
rp = ROOT.TRatioPlot(hist1, hist)
rp.Draw()
c1.Update()
and getting the following error message
Traceback (most recent call last):
File "/home/advait/Documents/internship_nn/data/ditauMassWeighted.py", line 80, in <module>
rp = ROOT.TRatioPlot(hist1, hist)
TypeError: none of the 4 overloaded methods succeeded. Full details:
TRatioPlot::TRatioPlot(TH1* h1, TH1* h2, const char* option = "pois") =>
TypeError: could not convert argument 1
TRatioPlot::TRatioPlot(THStack* st, TH1* h2, const char* option = "pois") =>
TypeError: could not convert argument 1
TRatioPlot::TRatioPlot(TH1* h1, const char* option = "", TFitResult* fitres = nullptr) =>
TypeError: could not convert argument 1
TRatioPlot::TRatioPlot() =>
TypeError: takes at most 0 arguments (2 given)
I do not see what I am doing wrong. I see that the problem has something to do with me passing the wrong parameters, but I don’t see what I’m passing incorrectly. Any tips would be appreciated.
Kind Regards,
Advait