  Collapsars are fast-spinning, massive stars, whose core collapse liberates an
energy, that can be channeled in the form of ultrarelativistic jets. These jets
transport the energy from the collapsed core to large distances, where it is
dissipated in the form of long-duration gamma-ray bursts. In this paper we
study the dynamics of ultrarelativistic jets produced in collapsars. Also we
extrapolate our results to infer the angular energy distribution of the
produced outflows in the afterglow phase. Our main focus is to look for global
energetical properties which can be imprinted by the different structure of
different progenitor stars. Thus, we employ a number of pre-supernova, stellar
models (with distinct masses and metallicities), and inject in all of them jets
with fixed initial conditions. We assume that at the injection nozzle, the jet
is mildly relativistic (Lorentz factor $\sim 5$), has a finite half-opening
angle ($5^\circ$), and carries a power of $10^{51} $erg s$^{-1}$. These jets
arrive intact to the stellar surface and break out of it. A large Lorentz
factor region $\Gamma\simmore 100$ develops well before the jet reaches the
surface of the star, in the unshocked part of the beam, located between the
injection nozzle and the first recollimation shock. These high values of
$\Gamma$ are possible because the finite opening angle of the jet allows for
free expansion towards the radial direction. We find a strong correlation
between the angular energy distribution of the jet, after its eruption from the
progenitor surface, and the mass of the progenitors. The angular energy
distribution of the jets from light progenitor models is steeper than that of
the jets injected in more massive progenitor stars. This trend is also
imprinted in the angular distribution of isotropic equivalent energy.
