Hi,
one of the simplest ways to get multi-threading “for free” is to rewrite your analysis to use RDataFrame instead of TChain directly.
It requires a bit of mental gymnastic to convert imperative code (for loops and ifs) to RDataFrame’s declarative interface, but it usually works out for the better.
Thank you very much for the prompt response, much appreciated. I had earlier tried to use RDataFrame but couldn’t really understand much, and yes, also due to time constraints.
What I am looking is to achieve parallel processing using TSelector class for the attached macro.
I guess the easiest would be to run many independent ROOT jobs, e.g. one job per “input file”. They should then create many “output files”, which you can simply merge in the end, running yet another ROOT job (or “hadd”).
For the management of these “Local” jobs, you could try to use a Task (with “t.float = 24”, i.e. as many cores as you have available) in Ganga, for example.
Or you could simply divide the total number of your “input files” by 24 (i.e. as many cores as you have available) and then run 24 independent ROOT jobs (one job per each 1/24-th sample of files) in parallel and finally merge the 24 “output files” (no need for any additional tool which manages these jobs).
Thank you for your response. What you have suggested seems to be very simple.
In the meantime, I have succeeded in writing a macro using TSelector Class. It works fine. But crashes while processing it with PROOF. You can find details of this issue here: PROOF Crashes while Writing Histogram