def load_tree(infiles): from rootpy.tree import TreeChain from rootpy.ROOT import gROOT gROOT.SetBatch(True) print('[INFO] Opening files: {0}'.format(infiles)) tree = TreeChain('ntupler/tree', infiles) tree.define_collection(name='hits', prefix='vh_', size='vh_size') tree.define_collection(name='simhits', prefix='vc_', size='vc_size') tree.define_collection(name='tracks', prefix='vt_', size='vt_size') tree.define_collection(name='particles', prefix='vp_', size='vp_size') return tree
# import ROOT in batch mode import sys oldargv = sys.argv[:] sys.argv = [ '-b-' ] from rootpy.ROOT import gROOT gROOT.SetBatch(True) sys.argv = oldargv import logging from rootpy import log as rlog; rlog = rlog["/muonPtChoiceStudy"] logging.basicConfig(level=logging.WARNING) rlog["/ROOT.TCanvas.Print"].setLevel(rlog.WARNING) rlog["/ROOT.TUnixSystem.SetDisplay"].setLevel(rlog.ERROR) # load FWlite python libraries from DataFormats.FWLite import Handle, Events from rootpy.plotting import Hist, Hist2D, Graph, Canvas, Legend from rootpy.plotting.utils import draw from rootpy import asrootpy #from multiprocessing import cpu_count, Pool, Manager #import signal from glob import glob from UWVV.Utilities.PlotStyle import PlotStyle style = PlotStyle()