Direct determination of the orientation distribution function of cylindrical particles immersed in laminar and turbulent shear flows