Hi,
I am having some trouble getting even a basic TPySelector working under an Atlas Setup framework. To start I am not attempting to use Proof, although this is the goal. I see two behaviors depending on which version of ROOT is running, both are non-functional. I am using Atlas D3PDs. See below for details.
Thanks,
Peter
import time
from ROOT import *
myAtlasD3PD = 'pathToAtlasD3PD'
dataset = TChain('physics')
dataset.Add(myAtlasD3PD)
print dataset.Process( 'TPySelector', 'aapje' )
### selector module (aapje.py, name has to match as per above)
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 ):
if not entry%10000: print 'py: processing {0}'.format(entry)
def SlaveTerminate( self ):
print 'py: slave terminating'
def Terminate( self ):
print 'py: terminating'
In 5.26.00e_python2.6 (Atlas Software release) it seems to run fine and then crashes:
py: beginning
py: slave beginning
py: processing 0
py: processing 10000
py: processing 20000
py: processing 30000
py: slave terminating
py: terminating
Traceback (most recent call last):
File “test2.py”, line 10, in
print dataset.Process( ‘TPySelector’, ‘aapje’ )
SystemError: Objects/longobject.c:237: bad argument to internal function
In 5.30.02 it seems to run TWICE and then crashes:
py: beginning
py: slave beginning
py: processing 0
py: processing 10000
py: processing 20000
py: processing 30000
py: slave terminating
py: terminating
py: beginning
py: slave beginning
py: processing 0
py: processing 10000
py: processing 20000
py: processing 30000
py: slave terminating
py: terminating
Traceback (most recent call last):
File “test2.py”, line 10, in
print dataset.Process( ‘TPySelector’, ‘aapje’ )
TypeError: none of the 4 overloaded methods succeeded. Full details:
Objects/longobject.c:237: bad argument to internal function
Objects/longobject.c:237: bad argument to internal function
Long64_t TChain::Process(void* selector, Option_t* option = “”, Long64_t nentries = kBigNumber, Long64_t firstentry = 0) =>
could not convert argument 1
Long64_t TTree::Process(void* selector, Option_t* option = “”, Long64_t nentries = 1000000000, Long64_t firstentry = 0) =>
could not convert argument 1