Re: Extracting Graph from TCanvas in File

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Sat, 27 Nov 2010 00:27:47 +0100


Hi Stefan,

As you already know how to get the graph out of the canvas, the only missing step is how to get the canvas (of unknown name) from the file? If so, TFile::GetListOfKeys() should get you there. Let us know if you need a code snippet.

Cheers, Axel

"Stephan Zimmer" <zimmerst_at_googlemail.com> wrote:

>Hi there,
>I'm not sure whether the subject is really descriptive. I'm trying to
>process a number of files which have all the same structure, i.e. it
>contains only a TCanvas, but the names vary from file to file. Is there
>a way of casting the canvas and getting their content?
>In principle I want to extract the TGraphError "Graph" stored. And I
>can
>easily access it assuming I know the name of my TCanvas, e.g. (assuming
>c1 is the name of the canvas):
>TGraphErrors *g1 = c1->GetPrimitive("Graph");
>
>Any Idea how to do this?
>Thanks a lot,
>Cheers,
>Stephan
>
>--
>Stephan Zimmer
>zimmerst_at_gmail.com
Received on Sat Nov 27 2010 - 00:27:57 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 28 2010 - 05:50:01 CET