[ROOT] THStack

From: Matt Palmer (palmer@hep.phy.cam.ac.uk)
Date: Wed Jul 10 2002 - 00:08:26 MEST


Hi, 
I've noticed a couple of problems with THStack.
1) If you try to add a histogram after having drawn the THStack, then try and 
draw it, you get a seg fault.  The problem is that BuildStack just returns 
fStack if it is already non-zero.  It should probably check that 
fStack->GetEntriesFast() == fHists->GetEntriesFast()

2) The copy contructor is just the default .  This means that fStack gets 
copied too.  If the above was fixed then the following code would show 
identical output:

THStack s1 ("1", "1");
s1.Add(h1);
s1.Add(h2);
THStack s2(s1);
s2.Add(h3);
s1.Draw("h");
new TCanvas("c2", "c2");
s2.Draw("h");

Matt



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:59 MET