Keeping Histograms

From: Jeff Patterson (jeffp@drax.colorado.edu)
Date: Wed Nov 04 1998 - 03:56:29 MET


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



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:39 MET