Skip to content

Commit

Permalink
circumvented a bug in pyROOT's memory management
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas committed Feb 20, 2014
1 parent df6778a commit 1e1c647
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions drawHist/drawHist.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ def __init__(self,name,options):
def init(self,idir,rules):
if not self._init:
self.files = [rt.TFile.Open(idir + "/" + fileName) for fileName in self.fileNames]
for _file in self.files:
paths = mytools.listRootFile(_file)
for p in paths:
_file.Get(p)
for f in range(0,len(self.files)):
file = self.files[f]
if file == None:
_file = self.files[f]
if _file == None:
print "WARNING: skipping file",self.fileNames[f]
continue
self._init = True
Expand All @@ -197,14 +201,14 @@ def updateHist(self,histPath):
sys.exit()

for f in range(0,len(self.files)):
file = self.files[f]
if file == None:
_file = self.files[f]
if _file == None:
continue
obj = file.Get(histPath)
obj = _file.Get(histPath)
if options.verbose:
print " " + file.GetName()
print " " + _file.GetName()
if obj == None:
print "WARNING: no histogram named \"" + histPath + "\"in file \"" + file.GetName() + ", skipping..."
print "WARNING: no histogram named \"" + histPath + "\"in file \"" + _file.GetName() + ", skipping..."
continue
if options.verbose > 1:
if obj.GetXaxis().GetLabels() != None:
Expand Down

0 comments on commit 1e1c647

Please sign in to comment.