#! /usr/bin/env python import ROOT import glob c1 = ROOT.TCanvas('c1', 'c1', 600, 400) chain = ROOT.TChain ('PEtree') files = glob.glob ('PEs_seed*.root') for rootfile in files: chain.AddFile (rootfile) # pull pullName = 'TopPull' pull = ROOT.TH1F (pullName, pullName, 100, -5, 5) chain.Draw ("(measVec[0]-genVec[0])/errVec[0]>>%s" % \ (pullName)) # pull.Fit('gaus') c1.Print ('%s.png' % pullName) print "Done."