Hi roottalk,
Does anyone have any idea on this? Am I on the right track or should I be
doing something entirely different?
Thanks,
Philip
On Tuesday 19 Oct 2010 16:40:23 Philip Rodrigues wrote:
> Hi roottalk,
> I have a tree with a branch storing a class 'A' containing a vector data
> member:
>
> class A : public TObject
> {
> public:
> A();
> double x;
> std::vector<double> v;
>
> ClassDef(A, 1);
> };
>
> I want to access items from the vector v without streaming the whole object
> off of disk. I can do this for the simple double member (x) via TLeaf,
> like this:
>
> TLeaf* l_x=tree->FindLeaf("x");
> l_x->GetBranch()->GetEntry(someEntry);
> double value_read = l_x->GetValue();
>
> but the corresponding code for the "v" branch always gives zero.
>
> How can I access just the data from the v branch? (It must be possible,
> since TTree::Draw can do it, and I'm sure I've done it before with other
> files...)
>
> I've attached a test file and macro to show exactly what I'm doing.
>
> Thanks,
> Philip
>
Received on Mon Oct 25 2010 - 13:36:16 CEST
This archive was generated by hypermail 2.2.0 : Mon Oct 25 2010 - 17:50:02 CEST