  We prove some new a priori estimates for H_2-convex functions which are zero
on the boundary of a bounded smooth domain \Omega in a Carnot group G. Such
estimates are global and are geometric in nature as they involve the horizontal
mean curvature \mathcal H of the boundary of \Omega. As a consequence of our
bounds we show that if G has step two, then for any smooth $H_2$-convex
function in \Omega \subset G vanishing on the boundary of \Omega one has
  \sum_{i,j=1}^m \int_\Omega ([X_i,X_j]u)^2 dg \leq {4/3} \int_{\partial
\Omega} \mathcal H |\nabla_H u|^2 d\sigma_H .
