[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:
Actual End:

 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 Mon Feb 24 17:14:36 CET 2020 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.