I’m trying to use proof in my analysis.
I implemented a TSelector and I use to process my trees with something like this:
where selector is a TSelector*
Now I would like to use proof to do the same.
The only way I seem to find is the following:
where selector.C is the source code file of my selector.
Is there a way to use directly an instance of my selector class instead of having cint compile my selector source every time, like I use to do when processing my trees without proof?
Many thanks in advance
This is indeed not advertised too much in the documentation, but you can not only specify file names in TProof::Process(…), but also class names.
For instance what I do in my PROOF jobs is that I load some libraries needed for my TSelector instance locally, then I upload and “enable” some .PAR packages onto the PROOF cluster, which do the same on the master/worker nodes, finally I run the PROOF query with something like:
Where let’s assume that “MyTSelectorDerivedClass” is a class that is now known to my local ROOT session and to all the PROOF nodes.
This way it’s possible to create quite complicated TSelector instances, not just ones that fit into a single file. If you’re interested, you can have a look at the project I’m using to run jobs on PROOF:
sframe.svn.sourceforge.net/viewv … OF-branch/
I’m going to give it a try.
Also, I forgot to mention that I’m running on a multi core machine, not on a cluster at the moment.
Another question though. How do you configure your TSelector? I mean, can you pass arguments to the selector constructor using the Process(“className”) method? Or maybe you need to set whatever is needed in one of the Init() calls (maybe reading parameters from a file)?
Thanks and best regards,
TSelector are not intended to be streamed so we cannot use directly the TSelector object in PROOF as done locally. However, as Attila pointed out, you can refer to them by name, once the shared library defining them is loaded.
For what relates to arguments, passing them on the Process line is not supported. PROOF provides, instead, the input list to make “objects” available to selectors (the list is available inside TSelector through the base member fInput). Objects can be anything, in particular TParameters.
Have a look at TProof::AddInput and TProof::SetParameter .
The code in tutorials/proof/ gives examples of how to user parameters to configure selectors.