I’m trying to use TPySelector with PROOF-Lite. I’m trying to work out how to pass configuration options to the TPySelector. This has been asked a few times, but I haven’t seen any good solutions:
The problem is, that if I want to use a TPySelector in PROOF, I can’t just instantiate and configure the object myself then pass the instance to TDSet::Process, as a new instance gets made on each worker. In C++ Root, I think the solution would be to use the option string to pass in a string of arguments that can be parsed by the code. However, this isn’t possible in PyRoot, as the option string must be identical to the module name containing the TPySelector. Can anyone think of a good way to configure my TPySelector, other than basically having to change the code each time?
One solution I thought of would be to allow the user to specify both the module name and a normal option string in the second argument of the Process() function. They could be divided by a character like ‘#’. Looking at the source code, http://root.cern.ch/root/html/src/TPySelector.cxx.html it seems like this could be achieved quite easily, with just a modification before lines 75 and 89 to split the string by ‘#’ and take the first bit as the module name, and the second as the configuration string, which could be reset using SetOption(). Does this sound sensible?