Hi,
We’re using ROOT 5.18.00c.
Unfortunately we have a set of ROOT files with what I can best describe as truncated TTreeIndices. We had merged a number of files and neglected the existing indices, hence the index written to these merged files refers only to the first TTree in the original files.
We desire to build a TChainIndex on these files, where we have opened the files in read-only mode. My limited understanding of TChainIndex, is that during the constructor, a new index is constructed per tree, only if there is no pre-existing index. I had hoped to essentially eliminate the indices by doing something like:
unsigned int iTree;
for (iTree=0;iTree<dataset->chain->GetNtrees(); iTree++)
{
dataset->chain->LoadTree((dataset->chain->GetTreeOffset())[iTree]) ;
dataset->chain->GetTree()->SetTreeIndex(0) ;
}
and then creating a TChainIndex. This is not working, though, since the original indices still exist and are apparently used when the TChainIndex is constructed.
Is there any way to really delete those indices and force TChainIndex to build new ones, without having to open the files in update mode? Am I left to rewrite those files and fix up the indices?
Thanks,
Heather