Geomagnetic storms caused by shocks and ICMEs