Canonical semigroups of states and cocycles for the group of automorphisms of a homogeneous tree