Re: Creating graphs in functions

Rene Brun (Rene.Brun@cern.ch)
Tue, 17 Nov 1998 00:33:21 +0100


Matthew R. Nelson wrote:
>
> Rooters,
>
> ROOT's greatest appeal to me is the advanced set of C++ graphing tools. I
> have a set of existing templated classes (non-ROOT) that contain data
> that I want plotted in various ways. Ideally, I would like to create a
> new class that encapsulates these plotting routines. Besides the various
> initializations required in the main() file, I would like all of the
> ROOT functions handled by this class, including creating the canvas.
>
> Would this create any scoping problems for ROOT? Can I declare a canvas
> inside a function? Do I need special declarations of the ROOT objects
> (extern, etc.)? Are there any example applications someone could point me
> to?
>
> Also, my templated classes use the STL containers vector<> and string
> extensively. Does this preclude the successful use of CINT compiled into
> this stand-alone application (not called from within ROOT)?
>
> Thanks in advance for any pointers, example code, enlightenment, ...
>
> Matt
>

Matt,
I would suggest you have a look at the Root tutorials to get an
idea of the intended use of the system.
By creating one single class as you describe, you run the risk
of creating a very FAT class. Root is designed to be used
in an interactive environment. You invoke the Root classes
when you need them. You make short macros.

Masa has recently posted to this list the CINT STL restrictions.
He is currently extending the support for STL. Vectors and strings
should be supported if you use the latest version of Root 2.00/13.
Masa will, may be, clarify my point.

Rene Brun

Rene Brun