How to get entries of TChain object from a selector

Hi experts,

I am trying to loop over all entries of TChain using a selector defined as MySelector.C. The function I implemented under MySelector::Terminate() is shown as follow:

[code]void MySelector::Terminate()
{
if (fChain == 0) return;

Long64_t nentries = fChain->GetTree()->GetEntriesFast();

Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetTree()->GetEntry(jentry); nbytes += nb;
// if (Cut(ientry) < 0) continue;
cout<<nb<<endl;
//printf(“nb = %lld \n”,nb);
}

printf("speed of light = %lf\n",speedc);

}[/code]
I only get a empty histogram which implies access to entries might have been failed, how could I solve this problem? thanks.

I believe this is related to this other thread: Parallel computation with multi cores .
Hence I close this one.

G Ganis