Hi,
I would like to save some event points per layer in a TFile and then re-showing them using the TEveManager. In order to do so, I have started with something that it seemed to perform a similar function in the tutorial in $ROOTSYS/tutorials/eve/pointset.C and tried to save the TEvePointSetArray in a TFile:
TEvePointSetArray* pointsetarray()
...
l->Fill(rad*TMath::Cos(phi), rad*TMath::Sin(phi), z,
r.Uniform(0, 110));
}
TFile* f = new TFile("pointsetarray.root", "recreate");
l->Write();
for (Int_t i = 1; i <= 9; ++i)
l->GetBin(i)->Write();
f->Close();
l->CloseBins();
gEve->Redraw3D();
return l;
}
and then retrieving it with the following code:
#include <TFile.h>
#include <TEveManager.h>
#include <TEvePointSet.h>
#include <TEveRGBAPalette.h>
#include <TColor.h>
void pointsetarray_retrive()
{
TFile* f = new TFile("pointsetarray.root", "read");
TEveManager::Create();
TEvePointSetArray* l = new TEvePointSetArray();
f->GetObject("TPC hits - Charge Slices", l);
gEve->AddElement(l);
gEve->Redraw3D();
f->Close();
}
With this code, I can reproduce only the main folder in the TEveManager, but not the TPointSets in it.
Any help is appreciated.
Thanks,
Erica