Hi Brun,
I was wondering whether doing the following could lead to any problems when reading TVectorD from a file in the context of a C++ program:
TVectorD xlo;
TFile* f = new TFile(filename,opt);
TVectorD* xlo_ptr = (TVectorD*) f->Get("xlo");
n_cell = xlo_ptr->GetNoElements();
xlo.ResizeTo(n);
xlo = *(TVectorD*) f->Get("xlo");
f->Close();
delete f;
This appears to keep xlo in memory (as I would expect because it’s neither a Tree or histogram) where I can do things with it, but I am having the issue of it being overwritten by another TTree object when I invoke the object’s TTree::Draw() fucntion.
See my recent post for details: Memory corruption when calling TTree::Draw (const char *varexp, const TCut &selection)
Thank you,
Y