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

TH1::Merge() has problems when the histograms have no entries set.

    Details

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

      All

      Description

      As TH1::Merge() skips histograms which do not have the entries set and by that has problems with merging these kind of histograms as it detects them at the moment as labeled histograms with non zero bin content (if only bin content is set but no entries).
      In addition when the first histogram has no entries set and is skipped the merge function has problems calculating the correct axis ranges if both histograms do not have the exact same axis limits.
      As a fix we could not skip the first histogram. We can look for the variable "initialLimitsFound" and check for this one before skipping this empty histogram.

      So the old source

      5211: do {
      5212: // skip empty histograms
      5213: if (h->fTsumw == 0 && h->GetEntries() == 0) continue;

      would then become

      5211: do {
      5212: // skip empty histograms
      5213: if (h->fTsumw == 0 && h->GetEntries() == 0 && initialLimitsFound) continue;

      Anyhow there would be the question if skipping empty histograms is desired? What is the reason for skipping them? Especially if the histograms have different axis limits one might want to append also empty histograms. At the moment this is not possible so maybe it is worth a thought.

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              abachlec Andreas Bachlechner
            • Votes:
              7 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: