TChain->GetEntry() and Entry$ inconsistency

I have chained four trees together and I want to select certain events with a tree-Draw(“width”,“Entry$==555”) command. The entry numbers from TChain->GetEntry() are indexed continously. However, the Entry$ from TChain->Draw() is not! I’ve attached a plot showing this problem of duplicate Entry$ numbers.

So, the “Entry$” is NOT referenced continuously in a chained tree’s Draw function. Why not? How do I access the continuous index number ala " chain->Draw(“ContinuousEntry$”) " ??

Thanks,
Martin


Hi,

Currently Entry$ refers to the entry number in the underlying tree (and not the chain). The entry number in the chain is currently not accessible in TTree::Draw (but should be available soon).

Cheers,
Philippe

Thanks, Pilipe!

Root is just really annoying sometimes. One work around would be to at least get the index from the underlying tree. That will give me duplicate events, but I can deal with that in some other way. So, does anyone know how to get the Entry$ for a specific event out of a chain?
Unfortunately, TChain->GetEntry(j)->GetLeaf(“Entry$”)->GetValue() does not work. So, how do I access the Entry$?

Thanks,
Martin

Hi,

I updated the code in the head of the CVS repository so that Entry$ (and TChain->GetReadEntry()) returns the entry number of the chain being read (aka what you called the ContinuousEntry number).

[quote]Unfortunately, TChain->GetEntry(j)->GetLeaf(“Entry$”)->GetValue() does not work. So, how do I access the Entry$?[/quote]Entry$ is only a pseudo variable accessible via TTreeFormula (aka TTree::Draw and TTree::Scan). Instead you should simply (with the new code I introduced) call mychain->GetReadEntry() or mychain->GetTree()->GetReadEntry() [For the entry number of underlying tree, aka the number previous returned by Entry$).

Cheers,
Philippe