Project

General

Profile

Bug #24839

Metadata extraction is corrupted for ROOT files storing RooFit objects

Added by Gianluca Petrillo 2 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
08/21/2020
Due date:
% Done:

0%

Estimated time:
Duration:

Description

RooFit library by default prints a banner the first time its library is loaded.
This output ends up interfering with the metadata extraction in root_metadata.py. An example:

RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby 
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

{
  "crc": {
    "crc_type": "adler 32 crc type",
    "crc_value": "378900974" 
  },
  "file_name": "photonlibrary_builder_icarus-job0012-PhotonLibraryData_81efa21f-19d9-49ed-adb3-ce3a178973f8.root",
  "file_size": "20795" 
}

This in turns make JSON file invalid and causes failures downstream.

History

#1 Updated by Gianluca Petrillo 2 months ago

Two solutions are proposed.

Herbert Greenlee found that the banner can be disabled setting ROOT configuration entry RooFit.Banner to 0. This can be done at configuration file level or programmatically. This solved the specific issue with RooFit.

I propose a more robust underlying approach where root_metadata.py does not drop the output to the console, where it might be polluted by libraries like RooFit, but rather writes it into a file directly, with complete control of what to write.

Also note that these two approaches are complementary and potentially reinforce each other.

Herb has a patch for python/root_metadata.py with his approach. I am testing the second approach on a grid job now.

#2 Updated by Gianluca Petrillo 2 months ago

A solution including both approaches has been provided in larbatch pull request #9.

#3 Updated by Gianluca Petrillo 2 months ago

For ROOT UPS distribution maintainers: it should be considered to disable the RooFit banner in the system rootrc configuration provided by the UPS product, presumably by the addition of a RooFit.banner: false line into etc/system.rootrc.



Also available in: Atom PDF