TLorentzVector in a TTree

Bonjour,
following Wim’s manual, I’ve been able to “book” a TTree and fill it with integers or floats.
But I would like to know how I can define a branch containing a TLorentzVector ?
Here is what I do for floats (example) :

booking

EVENT = array(‘i’,[0])
MyT.Branch(‘Event’,EVENT,‘Event/I’)

filling

EVENT[0] =iev

But I just don’t know how to declare the branch for a TLorentzVector …
if I book a TLorentzVector like this (without pointer for the address) :
TL = TLorentzVector()
MyT.Branch(‘TL’,TL)

the TL structure will appear in the TTree but empty and “broken” (broken icon).

Thanks in advance for your help !
– filip (Philippe Ghez LAPP-IN2P3-CNRS / LHCb)

how should I declare the 1-dim array

… forgot to mention : using ROOT 6 …
– filip

Philippe,

yes, just calling Branch(‘TL’, TL) should do the trick. But did you make sure the TLorentzVector lived long enough? An easy way of keeping its life time the same as the tree, is by assigning it: MyT._TL = TL.

Cheers,
Wim