Adding entries to a TTree

Replace the line

f->Write(); by

t->Write(TObject::kWriteDelete);
for more info, see the doc of TObject::Write

Rene