  In this article we develop function-based a posteriori error estimators for
the solution of linear second order elliptic problems considering hierarchical
spline spaces for the Galerkin discretization.
  We prove a global upper bound for the energy error. The theory hinges on some
weighted Poincar\'e type inequalities, where the B-spline basis functions are
the weights appearing in the norms. Such inequalities are derived following the
lines in [Veeser and Verf\"urth, 2009], where the case of standard finite
elements is considered. Additionally, we present numerical experiments that
show the efficiency of the error estimators independently of the degree of the
splines used for discretization, together with an adaptive algorithm guided by
these local estimators that yields optimal meshes and rates of convergence,
exhibiting an excellent performance.
