TSelector: documentation disagreement with actual behavior


I’m looking for a way to “safely” stop iterating over an event in
the TSelector class and store the result (histograms, trees, etc.).

TSelector Class Reference: v626/classTSelector.html:

Bool_t TSelector::Process(Long64_t entry):
… Processing stops when this function returns kFALSE.

But in the description of TSelector::Process() function:
The return value is currently not used.

It’s okay, let’s look further.

… The processing can be stopped by calling Abort()
and in the description of Abort() function:
… After abort the SlaveTerminate() and Terminate() are always called.

In practice, both of these functions, SlaveTerminate() and Terminate(), are not called.
If I look at the code of the function TTreePlayer::Process(),
then it is found there:

   process = (selector->GetAbort() != TSelector::kAbortProcess &&
             (selector->Version() != 0 || selector->GetStatus() != -1)) ? kTRUE : kFALSE;
   Long64_t res = (process) ? 0 : -1;
   if (process) {
      selector->SlaveTerminate();   //<==call user termination function
      selector->Terminate();        //<==call user termination function
      res = selector->GetStatus();

Therefore if I abort process with kAbortProcess flag the terminated
functions are ignored.

As a consequence, when I stop the event loop with the Abort()
function, I have to call the (Slave)Terminate() functions explicitly.
This is fine, but it should be properly documented.

I don’t know if this behavior is buggy or if it’s a bug in the
documentation. The question is, what is the right thing to do in this
case: report an error in the TSelector class or an error in its documentation?
And where is the right place to report bugs in the documentation?


Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.26
_Platform: Linux
_Compiler: gcc

Do not believe in miracles. Rely on them. (Finagle’s Rule #6)

Hi @nefedov ,

I think this is a question for @pcanal , let’s ping him.