Merging of Root files with weights

Dear Rooters,

I am trying to merge some root files with weights. I am applying weights to trees of various files using SetWeight() method. When i try to plot a distribution of variable then it looks OK when i draw it from TChain instance.
But when i do merging and try to plot the same distribution from merged root file then it doesnot look like weighted. Could you please suggest what should i do, so that in the merged file i can see the weighted branch.

I am attaching the macro i am using.

Thanks and regards,
Arun.
merge_photonTrees_v2.C (3.33 KB)