Re: Nested vectors and TTree::MakeProxy

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 19 Nov 2010 11:58:02 -0600


Hi Philip,

A priori:

     name_of_branch.b[1].d[2];

should give you the result you are looking for. How is that failing for you?

Cheers,
Philippe.

On 11/17/10 9:21 AM, Philip Rodrigues wrote:
> Hi roottalk,
> I have a tree containing a class A which looks like this:
>
> class A : public TObject
> {
> vector<B> b;
> [...]
> }
>
> where B has a member which is a vector<double>:
>
> class B : public TObject
> {
> int i;
> vector<double> d;
> [...]
> }
>
> I am trying to access A via TTree::MakeProxy. My question is, how do I access
> a particular element of the vector d? That is, what is the proxy equivalent
> of:
>
> A a;
> a.b[1].d[2];
>
> I see that the equivalent of a.b[1].i is proxy.b.i[1], but how do I get what I
> want for the member d?
>
> Thanks,
> Philip
>
Received on Fri Nov 19 2010 - 18:58:07 CET

This archive was generated by hypermail 2.2.0 : Fri Nov 19 2010 - 23:50:02 CET