Effects of secondary interactions in proton-nucleus and nucleus-nucleus collisions using the HIJET event generator