Hi ROOTers,
I think I am missing something obvious here and would appreciate a pointer in the right direction.
I am trying to implement a class with a dynamic array of TVector3s for use in a tree and have run into an odd problem. Basically, any calls to Draw bomb with “Warning in TSelectorDraw::ProcessFillObject: Not implemented for TVector3”. Here is the class :
//TData.h:
#include "TObject.h"
#include "TVector3.h"
class TData:public TObject{
public:
TData(){};
virtual ~TData(){};
TVector3 fV0[2];
int cnt;
TVector3 *fV1; //[cnt]
ClassDef(TData,1)
};
//TData.cpp:
#include "TData.h"
ClassImp(TData)
and here is the tree code (test.C), which just makes a tree and writes it.
//test.C:
{
#include "TData.h"
TFile *of = new TFile("out.root","RECREATE");
TTree * t = new TTree("t","Test Tree");
TData dat;
dat.cnt = 2;
dat.fV1 = new TVector3[dat.cnt];
t->Branch("dat", &dat);
dat.fV1[0].SetXYZ(0,0,0);
dat.fV1[1].SetXYZ(1,1,1);
dat.fV0[0].SetXYZ(0,0,0);
dat.fV0[1].SetXYZ(1,1,1);
t->Fill();
of->Write();
}
This is all run like so:
root TData.cpp+
root[1] .x test.C
which generates the proper out.root file. Opening this file and trying to draw things is where the problem lies:
t->Draw(“fV0.fX”) => works fine
t->Draw(“fV1.fX”) => bombs with the error above.
Any tips??
Thanks!