TSelector::Version() and TTreePlayer

Hello,

I’m using myChain->Process(mySelector) wihout PROOF. Eventually I’ve realized that TSelector::Init() method has never been called. Looking through TTreePlayer source, I’ve found that thing

TTreePlayer.cxx:2744

if (selector->Version() >= 2)
      selector->Init(fTree);

But TSelector::Version() == 2 is not documented at all and I wonder what should I do: rewrite my selector to return Version() == 2 or somehow call mySelector->Init() by hand?

It also would be interesting to know what the undelying reason to call Init() in TTreePlayer in this way.

Thanks.

Best wishes, Eugeny Boger, JINR Dubna

Hi,

in older, i.e. version<2 Selectors, the Init() method was called in the generated SlaveBegin() code. With currently generated (v2) Selectors Init() is not called anymore there, but as you’ve noticed, its called directly by the system. See for example the v1 selectors in $ROOTSYS/tutorials/tree/h1analysis.h and .C. Make sure your Init() is called at the right place. Or alternatively, regenerate your selector to get a v2 selector.

Cheers, Fons.