He-he. 1. are you sure, you read canvas from file with this syntax? 2. how do you know, that TCanvas in a file contains something? ________________________________________ From: Adrian Sevcenco Sent: 13 February 2012 21:25 To: Timur Pocheptsov; roottalk_at_root.cern.ch Subject: Re: [ROOT] histograms embedded in TCanvas On 02/13/12 21:47, Timur Pocheptsov wrote: > Hi Adrian. Hi Timur!! > Read your canvas and ask it for a list of primitives? > > TCanvas * c = (TCanvas *)f->Get(.....); > if (c) { > .... > TList *primitives = c->GetListOfPrimitives(); well i have this code : TFile *f = new TFile("spectra_kaon_minus.root"); if (!f) return; f->ls(); TCanvas *c = new TCanvas ("f:cCanvas_kaon_minus"); TList *p = c->GetListOfPrimitives(); p->Print(); and this is the output root [0] Processing test.C... TFile** spectra_kaon_minus.root TFile* spectra_kaon_minus.root KEY: TCanvas cCanvas_kaon_minus;1 Collection name='TList', class='TList', size=0 is there other way to investigate contents of the canvas? Большое спасибо :), Adrian > > ///iterate on this list. > > } > ________________________________________ > From: owner-roottalk_at_root.cern.ch [owner-roottalk_at_root.cern.ch] on behalf of Adrian Sevcenco [Adrian.Sevcenco_at_cern.ch] > Sent: 13 February 2012 20:24 > To: roottalk_at_root.cern.ch > Subject: [ROOT] histograms embedded in TCanvas > > Hi! I have an root file that have an TCanvas saved inside. > Inside in that TCanvas somehow there are a few histograms. > How can i list and handle (access) those histograms? > > Thank you, > AdrianReceived on Mon Feb 13 2012 - 21:52:59 CET
This archive was generated by hypermail 2.2.0 : Mon Feb 13 2012 - 23:50:01 CET