[ROOT-5608] 2-dim function is not properly integrated in TH2::FillRandom Created: 20/Oct/13  Updated: 15/May/19  Resolved: 04/Dec/13

Status: Closed
Project: ROOT
Component/s: Core Libraries
Affects Version/s: 5.34/00, 6.00.00
Fix Version/s: None

Type: Bug Priority: High
Reporter: Evgeny Boger Assignee: Lorenzo Moneta
Resolution: Fixed Votes: 0
Labels: None
Environment:

-


Development:

 Description   

According to the description, "The distribution contained in the function fname (TF2) is integrated over the channel contents".
However, for whatever reason the "integration" in TH2D::FillRandom is actually summing the function values evaluated at the bin centres.

So, instead of

 
integral[ibin] = integral[ibin-1] + f1->Eval(xv[0],xv[1]);

It should be more like

 
integral[ibin] = integral[ibin-1] + f1->Integral(fXaxis.GetBinLowEdge(binx), fXaxis.GetBinUpEdge(binx), fYaxis.GetBinLowEdge(biny), fYaxis.GetBinUpEdge(biny));



 Comments   
Comment by Lorenzo Moneta [ 04/Dec/13 ]

Thank you. This is now fixed in 5.34 and master

Generated at Sun Sep 22 02:03:48 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.