Normalize a histogram using bin content from another one

Hi all,
I am trying to create a new histogram (hist_new) via normalizing the bin content from another histogram (hist_old). As a first step I am trying to access the ROOT file and clone (hist_old) but for some reason I get a null pointer error. May you please help me with this?
Here is part of my python script:

def fillPileupHistogram (lumiInfo, calcOption, hist, minbXsec, Nbins):   
    f = ROOT.TFile.Open(options.bb,'r')
    ROOT.TH1.AddDirectory(0)
    hist_old = f.Get("BX distribution for fill " + str(fill_num))
    hist = hist_old.Clone()
    f.Close()
    return hist

_ROOT Version:_6.10/09
Platform: CERN remote host
Compiler: python
___Preformatted text

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