Hi, You have to look in the proper list. If the histogram is in a file use file->Get If it is in memory and in a canvas canvas->GetListOfPrimitives()->FindObject etc. Cheers, Philippe -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Stilianos Kesisoglou Sent: Monday, July 28, 2003 5:17 AM To: roottalk@pcroot.cern.ch Subject: [ROOT] List of Histos Hi, Is there any way to check if a histogram has been created or not? I am thinking something on the same line that I can do for a canvas: TCanvas *myCNV = (TCanvas *)gROOT->GetListOfCanvases()->FindObject("myCNV"); if (!myCNV) { myCNV = new TCanvas("myCNV","myCNV",920,630); } It doesn't seem to work for histograms. Thanks! Stelios. ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# #################################################################
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET