although I worked several times before with CloneTree I cannot find the answer to the following problem: there are 5 jets in my input tree of which I want to skip one in my cloned tree. To do so I have to set the value of the branch “njt” from 5 to 4 and write only 4 jet pt’s into the branch “jtpt”. What I did was disabling the branches “njt” and “jtpt” in the input tree, clone the tree into a tree tmp.root, enabling the branches in the input tree again to have access to the input data and finally creating new branches “njt” and “jtpt” in the output tree. The problem is, when I call the output branches to be filled instead of the new input (njt=4) I get two branches of the same name “njt” with the old inputs (njt=5).
I guess that has something to do with two branches “njt” existing both in the input and output tree, but I do not see when b_njt is defined on the output tree how the wrong branch gets filled.
I attach a shortcut of my program that should compile standalone.
Thanks in advance for your help
modifytree_x.cpp (6.41 KB)