Using PROOF in iPython notebook

Dear experts,

I’ve been trying to work with PROOF in iPython notebooks via the TPySelector class. The code (basically the example from the ROOT documentation) works fine if I execute it via the terminal. However, I what i’d like to do is run the selector via an iPython notebook, i.e. the following:

  1. Define a selector in the notebook (and not in a separate .py file)
  2. Run the newly defined selector/analysis from the same notebook

In the regular .py script I submit the selector via

where ‘selector’ corresponds to the selector.py file that defines the selector class.

Is there any other way to pass a selector class to PROOF? Specifically, how could I tell the Process() function to take a class that is already defined in local namespace?

Many thanks for any pointers to this admittedly somewhat exotic question!

Philipp

Dear Philipp,

You can pass a TSelector object to PROOF in C++, I guess that can used here?
root.cern.ch/basic-processing#api

G Ganis

Seems that TPySelector exec’s an import statement. I’d trick it by adding an object to sys.modules, with the derived class as an attribute.

-Dom