ROOT::RVecD v1{6., 4., 5.}; ROOT::RVecD v2(v1); std::sort(v2.begin(), v2.end()); std::cout << "Sort vector " << v1 << ": " << v2 << std::endl; auto v3 = Sort(v1); std::cout << "Sort vector " << v1 << ": " << v3 << std::endl; auto v4 = Reverse(v1); std::cout << "Reverse vector " << v1 << ": " << v4 << std::endl; auto i = Argsort(v1); std::cout << "Indices that sort the vector " << v1 << ": " << i << std::endl; ROOT::RVecD v5{9., 7., 8.}; auto v6 = Take(v5, i); std::cout << "Sort vector " << v5 << " respective to the previously" << " determined indices: " << v6 << std::endl; auto v7 = Take(v1, 2); auto v8 = Take(v1, -2); std::cout << "Take the two first and last elements of vector " << v1 << ": " << v7 << ", " << v8 << std::endl; auto v9 = Reverse(Take(Sort(v1), -2)); std::cout << "Sort the vector " << v1 << ", take the two last elements and " << "reverse the selection: " << v9 << std::endl;