Accessing histograms from directories from a rootfile

Hi,

I have a root file which has a directory Occupancies. Occupancies has another directory in it OccupancyL3. OccupancyL3 has 4 histograms in it. I want to access each of these histograms and normalize them. I have been referring to https://root-forum.cern.ch/t/how-to-access-directories-within-root-files/31866; but none of it seems to work in my case> I am not even able to draw a histogram. Can anyone help. Here’s a picture for clarityroot

From the browser you only need to double on the histogram to Draw it.
From the ROOT prompt just cd in the file to that directory and invoke Draw() on the histogram
you want to see.

Ofcourse. But I am actually trying to write a macro to access the histograms and then I want to normalize them.

use cd on the TFile you opened.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.