Adding script writing a variable TTree