Fast Listing of ROOT File ContentsΒΆ

The simple rootinfo module is a quick way to get text output about the contents of your ROOT file, best explained by example:

$ rootinfo Hists_data_fisher.root --entries --max
barrel15to20/pho_fisher  7153  735
barrel15to20/pho_ecalIso04  7153  1766
barrel15to20/pho_hcalIso04  7153  5232
barrel15to20/pho_trackHollowIso  7153  1716
barrel15to20/pho_totIso  7153  649
barrel20to30/pho_fisher  3425  268
barrel20to30/pho_ecalIso04  3425  741
barrel20to30/pho_hcalIso04  3425  2277
barrel20to30/pho_trackHollowIso  3425  683
barrel20to30/pho_totIso  3425  246
barrel30to50/pho_fisher  810  68
barrel30to50/pho_ecalIso04  810  160
barrel30to50/pho_hcalIso04  810  495
barrel30to50/pho_trackHollowIso  810  181
barrel30to50/pho_totIso  810  60
barrel50to80/pho_fisher  99  10
barrel50to80/pho_ecalIso04  99  14
barrel50to80/pho_hcalIso04  99  52
barrel50to80/pho_trackHollowIso  99  21
barrel50to80/pho_totIso  99  9
pho_fisher  1425  138
pho_ecalIso04  1425  323
pho_hcalIso04  1425  1017
pho_trackHollowIso  1425  326
pho_totIso  1425  124

The full options can be accessed by running rootinfo --help:

[?1034husage: rootinfo [-h] [--bincenter] [--classname] [--contents] [--errors]
                [--entries] [--max] [--min] [--name NAME] [--overflow]
                [--underflow]
                filename [filename ...]

Print information from an SC2 replay file.

positional arguments:
  filename     Names of one or more root files

optional arguments:
  -h, --help   show this help message and exit
  --bincenter  Get Bin Centers from each bin in each histogram
  --classname  Get type from each object in root file
  --contents   Get Bin Contents from each bin in each histogram
  --errors     Get Bin Errors from each bin in each histogram
  --entries    Get Entries from each histogram
  --max        Get Maximum value from each histogram
  --min        Get Minimum value from each histogram
  --name NAME  Get information only from object with matching name
  --overflow   Get value of overflow bin from each histogram
  --underflow  Get value of underflow bin from each histogram

Previous topic

Beautifying ROOT with matplotlib

Next topic

Easily Make Histograms from TTrees and TNtuples

This Page