On 4 Dec 98 at 15:25, Jeff Patterson wrote: > Date: Fri, 4 Dec 1998 15:25:34 -0700 (MST) > From: Jeff Patterson <jeffp@drax.colorado.edu> > To: roottalk@hpsalo.cern.ch > Subject: De-alloc Memory Try like this: > TH1F *one[10]; > TH2F *two[10]; > for(i=0, i<100, ++i) > { > one[i] = new TH1F( STUFF DEPENDIING ON i); > two[i] = new TH2F(MORE STUFF DEPENDING on i); > . > . > . > > //Store the numbers of counts in arrays > //Now it's time to get rid of them !!! > > delete one[i]; > delete two[i]; > } Better solution (more O-oriented): TList HistList; for(i=0, i<100, ++i) { HistList.Add( new TH1F( STUFF DEPENDIING ON i) ); HistList.Add( new TH2F(MORE STUFF DEPENDING on i) ); . . . // Find your histogram TH1F *want1DimToWorkWith = (TH1F *)HistList.FindObject("histogram name") TH2F *want2DimToWorkWith = (TH2F *)HistList.FindObject("another histogram name") //Store the numbers of counts in arrays //Now it's time to get rid of them !!! } Histlist.Delete(); Hope this helps Valery ================================================================= Dr. Valeri Faine (Fine) ------------------- Phone: +1 516 344 7806 Brookhaven National Laboratory FAX : +1 516 344 4206 Bldg. 510A /STAR mailto:fine@bnl.gov Upton, New York, 11973-5000 http://nicewww.cern.ch/~fine USA Dr. Valery Fine Telex : 911621 dubna su ----------- LCTA/Joint Inst.for Nuclear Res. Phone : +7 09621 6 40 80 141980 Dubna, Moscow region Fax : +7 09621 6 51 45 Russia mailto:fine@main1.jinr.dubna.su
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:40 MET