Reading of rootfiles in a loop

Hi All,

I am facing problems when I read files in a for loop and
try to extract histograms from the files.
If I keep the files open, I am able to draw those histograms. If I close the file
in the loop, the code encounters segmentation violation while drawing those

A simple example of this problem is attached to this email (.tar.gz).
I am using root version 5.27/06 on SL.

Any help would be highly appreciated.

with best regards
test.tar.gz (5.78 KB)

At the top of your script add the line
and read explanation in the chapter about Object Ownership in the Users Guide.


Hi Rene

Thanks for the solution.

with best regards