I have an analysis which reads Delphes files using the ExRoot classes. It uses the same format to save the results. This analysis is compiled and doesn’t use scripts.
I am trying to use Proof Lite by moving the main analysis code into a TSelector subclass, but i am not sure how to proceed.
Is it at all feasible to read Delphes files with ExRoot in a Proof environment, or do I need simpler trees to make use of Proof?
What is the recommended way to run a compiled Proof analysis? Is it enough to process the Selector with
in order to formulate my question regarding the compilation clearer I have created a minimal example which gives the desired plot when called with Cint/Aclic via
But the same code crashes when compiled with gcc or clang.
The main file reads:
The Selector header is
And the Selector source is
You will notice that I print the content of the data member “TSelectorList *fOutput;” in the Terminate() function.
The result while running with Aclic is
Hence the code crashes once I try to cast to a Histogram.
Does anybody knows why the same code runs fine with Aclic but fails when compiled, with gcc or clang?
My Root version is ROOT 5.34/19.
Using PROOF to process data not in ROOT TTree format
PROOF was designed to process ROOT trees and in its default mode it is steered by the tree dataset.
However, PROOF has also a mode where the Process method of the selector is called a certain number of times, distributed between workers (the one you were playing with).
This mode can be adapted to process other files. The ‘event’ or ‘entry’ unit will then be to process one file, from a list that you can pass in the input list.
You will have to take care to open and close the file. This can certainly be done. I can provide an example, which could be useful also for others.
Problem with the simple test example
There is a fundamental difference between the case that works (which you call ‘compilation with ACliC’) and the other one. In the first case, the source files for the selectors are sent to the workers and the compilation is done (in an optimized way) by each of them. In the second the selector object is created in the main process (the one where you start the PROOF session) and sent over to the worker processes. This requires the object to be streamable, which does not look to be the case in your example.
I’ll try to run your example and find out exactly, but I suspect something related to that.
Every piece of example would be useful, as I have not really understood the pitfalls of parallelizing with proof and I have a large project which I usually compile with clang. But I am glad that you think that my plan could work in principle.