Problems with objects in directories

Dear Root users,

I created two directories, each one has one 3D histogram (first one has a 3D gaussian and the other has a 3D Landau distribution). In the first directoy I draw a 2D profile using TH3D::Profile3d (“xy”). When I change to the second directory I create another 2D profile with the same option “xy” and try to draw onto the same picture. But I get only the last profile (landau projection)!

I made a simple script to show you how it works. It is important to remenber that I am using the same object name for those different 3D histograms (I am using “h3d”). I think this could be the problem, but I need to know if it is bug or (un)known feature!

Thanks, Luís
Directory.C (914 Bytes)

Replace your second call to Project3D
h3d_2->Project3D(“xy”);
by
h3d_2->Project3D(“xy2”);

The current algorithm overwrites any previous object of the same type and name.
I have added the following comments in the doc:

//
// NOTE: The generated histogram is named th3name + option
// eg if the TH3* h histogram is named “myhist”, then
// h->Project3D(“xy”); produces a TH2D histogram named “myhist_xy”
// if a histogram of the same type already exists, it is overwritten.
// The following sequence
// h->Project3D(“xy”);
// h->Project3D(“xy2”);
// will generate two TH2D histograms named “myhist_xy” and “myhist_xy2”

Rene