Dears,
I’m having troubles trying to build a new Tree from sorting another Tree by increasing order of pT. I did procedures similar those ones described in the ROOT manual and also I looked for similar tasks here in the forum. However I’m facing a very strange thing. The original Tree contains branches of float vectors and I just take each component of the vector and store it in a branch of a new Tree. So, I do the sort over this new Tree. It happens that the sort is not fine at all. For branches which have the values differing in the integer part the sorting goes right. For instance, if the values are [3.134, 0.453, 6.349] they are sorted in the right increasing way [0.453, 3.134, 6.349]. Now, if they are [3.453, 3.134, 6.349] they are sorted as [3.453, 3.134, 6.349], the value 3.453 comes before the value 3.134! Seems like, when the values does not differ in their integer part, the sort method does not have effect. Below I have the piece of code I’m using. I appreciate any help, please.
mc_tmp_tree->BuildIndex("trkParts_pt");
TTreeIndex *mc_index = (TTreeIndex*)mc_tmp_tree->GetTreeIndex();
Long64_t* sindex = mc_index->GetIndex();
for(Int_t j=0; j<mc_tmp_tree->GetEntries(); j++){
mc_tmp_tree->GetEntry(sindex[j]);
cout<<"\tMC_pt: "<<tmp_trkParts_pt<<endl;
}