14 from ROOT.VecOps
import RVec, Argsort, Take, Sort, Reverse
18 v1 = RVec(
"double")(3)
19 v1[0], v1[1], v1[2] = 6, 4, 5
21 print(
"Sort vector {}: {}".format(v1, v2))
26 print(
"Sort vector {}: {}".format(v1, v2))
30 print(
"Reverse vector {}: {}".format(v1, v2))
35 print(
"Indices that sort the vector {}: {}".format(v1, v2))
37 v3 = RVec(
"double")(3)
38 v3[0], v3[1], v3[2] = 9, 7, 8
40 print(
"Sort vector {} respective to the previously determined indices: {}".format(v3, v4))
45 print(
"Take the two first and last elements of vector {}: {}, {}".format(v1, v2, v3))
49 v2 = Reverse(Take(Sort(v1), -2))
50 print(
"Sort the vector {}, take the two last elements and reverse the selection: {}".format(v1, v2))