Accessing single leaves in TChains

Dear Rooters,

Situation:

I have root files of the following structure

TTree tempot
	TBranch events
	     leaves of Type double int ...

Problem:

I open a TChain and add all files to it.

No I want to access a certain event

TChain::GetEntry(x)

How do I get the value of a specific leave of this event?
I tried several things one example is below:

TChain* chain = new TChain(“tempot”);

chain->Add(“june/tempo/20040619_PSR1957tempo.root”);
chain->Add(“june/tempo/20040620_PSR1957tempo.root”);

Double_t time;

TLeaf *ct = chain->FindLeaf(“ct”);
ct->SetAddress(&time);

chain->GetEvent(1000);
cout<<time<<endl;

This works if I only have one File but fails with more files. I know that SetAddress has to do with this.

Thanks a lot

Nepomuk

Instead of

               TLeaf *ct = chain->FindLeaf("ct"); 
               ct->SetAddress(&time); 

               chain->GetEvent(1000); 

do

chain->SetBranchAddress(“ct”,&time);
chain->GetEntry(1000);

Rene