Re: Python module for easy class generation

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 23 Dec 2010 22:33:27 -0600


Hi Noel,

In newer version of ROOT you can simply your scripts by using

     gInterpreter->GenerateDictionary("vector<vector<float> >", "vector");

which does most of the work of your make_class.

Cheers,
Philippe.

On 12/22/10 4:29 PM, Noel Dawe wrote:
> For all the python fans out there I've attached a simple module which may be used to generate classes in PyROOT which are not
> available by default (like vector<vector<float> > etc.)
>
> Example usage:
>
> Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from classfactory import *
> >>> make_class("vector<vector<float> >", "<vector>")
> True
> >>> ROOT.vector("vector<float>")()
> <ROOT.vector<vector<float> > object at 0x2b1cf10>
> >>> make_class("vector<TH1D>", "TH1D.h")
> True
> >>> ROOT.vector("TH1D")()
> <ROOT.vector<TH1D> object at 0x2b2c160>
> >>>
>
> Suggestions/improvements are welcome.
>
> Cheers,
> Noel
Received on Fri Dec 24 2010 - 05:36:58 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 31 2010 - 05:50:01 CET