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

TH2Poly::Add wrongly adds bin content

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.19/01
    • Fix Version/s: 6.20/00
    • Component/s: None
    • Labels:
      None
    • Environment:

      All

      Description

      TH2Poly::Add function performs for each bin:
      Double_t y = h1p->RetrieveBinContent(bin) + c1 * h1p->RetrieveBinContent(bin);

      The correct way would be something like:
      Double_t y = this->RetrieveBinContent(bin) + c1 * h1p->RetrieveBinContent(bin);

       

      The example.cpp file below illustrates the bug. Instead of adding both histograms only the second histogram (function argument in TH2Poly::Add) is added twice.

      This also leads to issues in TH2Poly::Merge which calls TH2Poly::Add.

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              a1bce8daea9cb9b57b3a Nils Stausberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: