[ROOT] Writing array of histograms

From: jrieger (jrieger@indiana.edu)
Date: Wed May 14 2003 - 16:36:03 MEST


Greetings,

I have generated an array of TH1F that I now want to write out to a root
file.  However, I am having difficulty getting this to work.  Is it
possible?  A portion of the code that I used to make this histogram is:

TH1F *myhist[1000];
char *histname = new char[10];
sprintf(histname, "h_x_%d",xx);
myhist[xx]=new TH1F(histname,"",100,-0.25,0.25);
for (Int_t iii=0;iii<nentries; iii++) {
	Double_t binx=h_x->GetBinContent(iii);
	myhist[xx]->SetBinContent(iii,binx);
}

And then I wish to write myhist to a .root file.  Any ideas?

Thanks
Jason



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET