Accessing leafs

Is it possible to do something like this:

Char_t input[10];
Char_t particle_charge[50];

sprintf(input,“El”);
sprintf(particle_charge,"%s_charge",input);

TLeaf l = new TLeaf()
l=(TLeaf
)particle_charge;

Int_t charge = (*l)[0];

That is, I want to be able to change the input name Char_t “El” as I please, f.es. “Mu” or “Jet_C4”, then I want to access the value of the leaf and assign it to a local variable.

Grateful for any help!
Maiken

Use TTree::MakeProxy (see root.cern.ch/root/html/TTree.htm … :MakeProxy)

Cheers,
Philippe

Thank you very much, I will try it out…

Maiken