Revision
22698 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Tue Mar 18 01:02:02 2008 UTC (6 years, 10 months ago) by
wlav
Original Path:
trunk/pyroot/inc/TPySelector.h
File length: 1801 byte(s)
Initial TPySelector prototype for use with PROOF. The prototype
works, but needs improvement error reporting, resilience, and
optimizations. Basic Idea:
from ROOT import TPySelector
class MyPySelector( TPySelector ):
def Begin( self ):
print 'py: beginning'
def SlaveBegin( self, tree ):
print 'py: slave beginning'
def Process( self, entry ):
print 'py: processing for:', self, self.fChain
return 1
def SlaveTerminate( self ):
print 'py: slave terminating'
def Terminate( self ):
print 'py: terminating'
def GetSelector():
return MyPySelector()
The for now conventional "GetSelector()" will be removed soon, in
favor of the same scheme (a derived class check) like with C++
selectors. The code above can then be run like so (localhost):
import time
from ROOT import TDSet, TProof
dataset = TDSet( 'TTree', 'h42' )
dataset.Add( 'root:// .... ' )
proof = TProof.Open('')
time.sleep(1) # needed for GUI to settle
print dataset.Process( 'TPySelector', 'MyPySelector.py' )
Do make sure to transport the MyPySelector.py in a .par file (or
similar), and do make sure that the environment on the other end
is proper.