added a macro to add the xs weight to each event and write the tree to a new file