Keeping Histograms

Jeff Patterson (jeffp@drax.colorado.edu)
Tue, 3 Nov 1998 19:56:29 -0700 (MST)


Hey Rooters,

My problem is that my histrograms keep disappearing from memory.
Here is what I am doing. I have an row-wise Ntuple from HBook that I have
converted with h2root. The ntuple is called h666. So I open the file,
make the histogram, then I want to clode the Ntuple and open another one
and add to it. But as soon as I close the file, I lose the histogram.
How can I get around this. Sample code

f1 = new TFile("ntup1");
MOM = new TH1F(bins);
h666->Draw("mom>>+MOM", "cuts");
delete f1 //This is were I lose my histogram
f1 = new TFile("ntup2");
MOM = new TH1F(bins);
h666->Draw("mom>>+MOM", "cuts");
etc.....

What am I doing wrong.

Jeff Patterson