In a compact connected Lie group $G$, each element is conjugate to an element of a maximal torus $T$. For a classical group, one can pick a basis of the tautological representation such that $T$ is represented by diagonal matrices. The conjugacy classes in $G$ are in bijective correspondence with the orbits of the Weyl group $W$ on $T$. Thus, say, for $\operatorname{SU}(n)$ the conjugacy class of a unitary matrix $g$ is determined by its (unordered) eigenvalues, and the same holds for $\operatorname{SO}(2n+1)$.
For $\operatorname{SO}(2n)$, the torus $T$ can be represented by matrices $\operatorname{diag}(\gamma_1,\dotsc,\gamma_n,\gamma_n^{-1},\ldots,\gamma_1^{-1})$, and $W$ acts by permutations on $\gamma_1,\dotsc,\gamma_n$ and an even number of changes $\gamma_i\leftrightarrow\gamma_i^{-1}$ (contrary to $\operatorname{SO}(2n+1)$, where an arbitrary number of switches can be done, by virtue of an extra eigenvalue $1$). Thus the eigenvalues alone determine a pair of conjugacy classes which differ by one switch.
Q: How, given a matrix $g\in\operatorname{SO}(2n)$, to determine the corresponding element of the torus $T$?
It can be done by diagonalizing $g$ by a matrix $C$ and checking whether $\det(C)=1$ or $-1$, but I was hoping for a more efficient solution (calculating the eigenvalues of $g$ is faster then finding $C$). Are there any other invariants which can, given the eigenvalues $\gamma_1,\dotsc,\gamma_n,\gamma_n^{-1},\dotsc,\gamma_1^{-1}$ of $g$, tell whether $g$ is conjugate to $\operatorname{diag}(\gamma_1,\dotsc,\gamma_n,\gamma_n^{-1},\dotsc,\gamma_1^{-1})$ or to $\operatorname{diag}(\gamma_1^{-1},\gamma_2,\dotsc,\gamma_n,\gamma_n^{-1},\dotsc,\gamma_2^{-1},\gamma_1)$?