I would like to use a tree to store a time series where each entry corresponds to a measurement at a certain time.
It would be nice to be able to compare each entry with the previous and the next one in time.
Is it possible to have a TRef belonging to an leaf in a branch point at another entry in the same branch? That way the tree would be a sort of linked list. How would one go about doing that?
This could be implemented but it would be terribly innefficient.
For this kind of problem, the solution is to open the same file 3 times
TFile f1("myfile.root");
TTree *T1 = (TTree*)f1.Get("mytree");
TFile f2("myfile.root");
TTree *T2 = (TTree*)f2.Get("mytree");
TFile f3("myfile.root");
TTree *T3 = (TTree*)f3.Get("mytree");
//set the addresses of each tree to 3 different objects
//then loop on entries
for (Long64_t i=1;i<nentries-1;i++) {
T1->GetEntry(i); //goes to object obj1
T2->GetEntry(i-1); //goes to object obj2
T3->GetEntry(i+1); //goes to obj3
}
Rene