Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-5608

2-dim function is not properly integrated in TH2::FillRandom

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.34/00, 6.00.00
    • Fix Version/s: None
    • Component/s: Core Libraries
    • Labels:
      None
    • Environment:

      -

      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));

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              039a8b546e74244770cc Evgeny Boger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: