Bug #12748

Fatal ROOT error when reading TH2F histogram

Added by Kyle Knoepfel over 4 years ago. Updated over 4 years ago.

Paul Russo
Target version:
Start date:
Due date:
% Done:


Estimated time:
Spent time:
Occurs In:
SSI Package:


Brian Rebel reported the following exception being thrown in situations where a dependency on TPaletteAxis was not necessarily expected:

---- FatalRootError BEGIN
   Fatal Root Error: @SUB=TBufferFile::ReadObject
   trying to read an emulated class (TPaletteAxis) to store in a compiled pointer (TObject)
   cet::exception going through module EventListMaker/list run: 10377 subRun: 0 event: 80
---- FatalRootError END

Before the above error is emitted, the following is printed to the screen:

no dictionary for class TPaletteAxis is available

What is happening?


#1 Updated by Kyle Knoepfel over 4 years ago

Paul and I have spent several hours trying to determine what is happening. The TPaletteAxis dictionary is required whenever a TFile::Get is called on the TH2 histogram "DytmanMEC_correction_factors". Since the histogram was drawn with the "colz" option, a TPaletteAxis object was added to the list of functions owned by the histogram. Whenever the file is opened, ROOT ensures that the dictionaries for fully reading the histogram are present.

We suggested to Brian that while we are diagnosing the problem, he should just take the histogram from the current file and do a loop over the bins to set the contents and errors of a new “unadorned” histogram (which is then written to its own file). The new file should then replace the current one file.

#2 Updated by Kyle Knoepfel over 4 years ago

I have been able to reproduce the error in art without relying on novasoft.

#3 Updated by Kyle Knoepfel over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Kyle Knoepfel

#4 Updated by Kyle Knoepfel over 4 years ago

  • Category set to Application
  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
  • SSI Package art added
  • SSI Package deleted ()

The problem is understood. As mentioned before, since the TH2 histogram was drawn with the "colz" option and then saved to the file, a TPaletteAxis object was added to the list of functions owned by the histogram. To appropriately interpret the histogram, ROOT must load the dictionary that supports the TPaletteAxis object; that dictionary is contained in the library. However, an attempt to load that library happens after all of the ROOT-management mechanisms have been set up by art. For ROOT5-supported art versions, any automatic dictionary loading is not enabled. This means that once the dictionaries have been loaded at the beginning of an art process, no more are loaded, even though it may be required (as in this case).

The ROOT6-supported versions of art enable automatic dictionary loading, so this is not a problem with art versions 1.18.00 and newer. However, in the meantime, there are two possible solutions:

  1. Make sure the relevant source code links against the library. This can be done by adding the ${ROOT_HISTPAINTER} variable to the appropriate CMakeLists.txt link line. Since the code in question is a template, finding the correct place to do this may be nontrivial. However, it may be as easy as adding the extra dependency in the novasoft/MCReweight/func/CMakeLists.txt file.
  1. It is straightforward to enable dictionary auto-loading within art, and as mentioned, this has already been done for versions 1.18.00 and newer. For the art 1.17 versions, producing a new release could be done, but not without some effort. Please let us know if the solution 1 does not meet your needs.

#5 Updated by Brian Rebel over 4 years ago

That solution is completely acceptable for us, thanks for the detective work!

#6 Updated by Kyle Knoepfel over 4 years ago

  • Assignee changed from Kyle Knoepfel to Paul Russo

#7 Updated by Kyle Knoepfel over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF