Hi Rene and Axel,
On Tuesday 02 November 2010 03:48 AM, Rene Brun wrote:
> You can set a weight for each of your Trees via TTree::SetWeight().
> For example, suppose that you have 3 files f1.root, f2.root, f3.root,
> each containing a Tree "T".
> You can make persistent the weight for each Tree by doing something like
> TFile f1("f1.root","update");
> T.SetWeight(3.14);
> T.AutoSave();
> and same for f2.root, f3.root.
> Now in an interactive session, you can do
> TChain ch("T");
> ch.Add("f1.root");
> ch.Add("f2.root");
> ch.Add("f3.root");
> ch.Draw("myvar");
> you will get the histogram for "myvar" with the weight for each entry
> corresponding to each tree weight.
>
Incidentally a friend pointed me to that exact same method just before I got your email! This serves my purpose just right, I was looking for something exactly like that.
However I might have another complication. My TNtuples have different names and are in the same file. So does that mean I need to rename them with SetNameTitle() and save to separate files, before I can do the above?
> Rene Brun
Thanks for the suggestions.
-- Suvayu Open source is the future. It sets us free.Received on Tue Nov 02 2010 - 18:25:30 CET
This archive was generated by hypermail 2.2.0 : Tue Nov 02 2010 - 23:50:01 CET