Page MenuHomeHEPForge

JetRetrieverFile.py
No OneTemporary

JetRetrieverFile.py

# Copyright (c) 2010-11, Pierre-Antoine Delsart, Kurtis Geerlings, Joey Huston,
# Brian Martin, and Christopher Vermilion
#
#----------------------------------------------------------------------
# This file is part of SpartyJet.
#
# SpartyJet is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# SpartyJet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SpartyJet; if not, write to the Free Software
# Foundation, Inc.:
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
from ROOT import gSystem
gSystem.Load("../libs/libJetCore.so")
gSystem.Load("../libs/libIO.so")
gSystem.Load("../libs/libSpartyDisplay.so")
from ROOT import SpartyJet as SJ
class PyJetRetrieverFile(SJ.JetRetrieverFile):
def __init__(self):
SJ.JetRetrieverFile.__init__(self)
def guess_input(self):
t = self.get_tree()
for b in t.GetListOfBranches( ) :
s = b.GetName()
if 'input' in s.lower():
return s[:s.rfind('_')]
print 'WARNING: Could not find input collection. Please specify explicitly in addTree()'
return ''
def find_algs(self, inputname, alias=""):
t = self.get_tree()
if alias != '':
alias = alias+'.'
names = set()
for b in t.GetListOfBranches():
s = b.GetName()
names.add(alias+s[:s.find( '_')] )
names = list(names - set([inputname]))
names.sort()
print 'Found algs ', names
for n in names:
self.add_jetcoll_reader(n, True)
self.names = names
return names
def fill_collection(self, jc_item, event):
numc = self.names.index(jc_item.name)
self.get_collection(jc_item.inputcoll, jc_item.jetcoll, numc, event)

File Metadata

Mime Type
text/x-python
Expires
Thu, Apr 24, 6:33 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4816699
Default Alt Text
JetRetrieverFile.py (2 KB)

Event Timeline