Solution (source code)

= Solution

The <current density> is the moving <charge density> times its <velocity>:
$$
\boxed{\mathbf J=\rho\mathbf v=\rho v_0\hat{\mathbf z}\quad(r<R),\qquad \mathbf J=\mathbf0\quad(r>R).}
$$
For a cylindrical <Gaussian surface> of radius $r<R$ and length $\ell$, cylindrical symmetry makes the <electric field> radial. <Gauss's law> gives $E(2\pi r\ell)=\rho\pi r^2\ell/\epsilon_0$. A circular <Ampère's circuital law> contour encloses <electric current> $I(r)=\rho v_0\pi r^2$, giving $B(2\pi r)=\mu_0I(r)$. Hence
$$
\boxed{\mathbf E(r)=\frac{\rho r}{2\epsilon_0}\hat{\mathbf r},\qquad
\mathbf B(r)=\frac{\mu_0\rho v_0r}{2}\hat{\boldsymbol\phi}
=\mu_0\epsilon_0\,\mathbf v\times\mathbf E(r),\quad r<R.}
$$
The <right-hand rule> fixes the positive azimuthal direction of the <magnetic field> for positive <electric charge> moving along $+z$. Both the <electric field> and the <magnetic field> vanish on the axis. These are the steady long-cylinder <electric field> and <magnetic field>; end effects and changes of the prescribed beam distribution are excluded.