hi oscar, what you are experiencing is a muscle cramp which can be caused due to the cold
temperature of water or due to insufficient warm up before the swim or also could be due to decreased intake of fluids or excessive loss of fluids and electrolytes from the body besides many other not so common causes. You need to see that you are well hyderated prefrebly with adequate salts in the fluid.You also need to warm up sufficiently before any strenous physical activity. You can get a serum calcium levels done to rule out calcium deficiency
. Presently you may not get treated but can massage
the calf and keep it warm in case it happens again.