We present an analysis of the relation between the masses of cluster-
and group-sized halos, extracted from $\Lambda$CDM cosmological N-body
and hydrodynamic simulations, and their velocity dispersions, at
different redshifts from $z=2$ to $z=0$. The main aim of this
analysis is to understand how the implementation of baryonic physics
in simulations affects such relation, i.e. to what extent the use of
the velocity dispersion as a proxy for cluster mass determination is
hampered by the imperfect knowledge of the baryonic physics. In our
analysis we use several sets of simulations with different physics
implemented: one DM-only simulation, one simulation with non-radiative
gas, and two radiative simulations, one of which with feedback from
Active Galactic Nuclei. Velocity dispersions are determined using
three different tracers, dark matter (DM hereafter) particles,
subhalos, and galaxies.
We confirm that DM particles trace a relation that is fully consistent
with the theoretical expectations based on the virial theorem,
$\sigma_v \propto M^\alpha$ with $\alpha = 1/3$, and with previous
results presented in the literature. On the other hand, subhalos and
galaxies trace steeper relations, with velocity dispersion scaling
with mass with $\alpha>1/3$, and with larger values of the
normalization. Such relations imply that galaxies and subhalos have a
$\sim10$ per cent velocity bias relative to the DM particles, which
can be either positive or negative, depending on halo mass, redshift
and physics implemented in the simulation.
We explain these differences as due to dynamical processes, namely
dynamical friction and tidal disruption, acting on substructures and
galaxies, but not on DM particles. These processes appear to be more or
less effective, depending on the halo masses and the importance of
baryon cooling, and may create a non-trivial dependence of the
velocity bias and the $\soneD$--$\Mtwo$ relation on the tracer, the
halo mass and its redshift.
These results are relevant in view of the application of velocity
dispersion as a proxy for cluster masses in ongoing and future large
redshift surveys.