Analysis of energy deposition in water around the site of capture of a negative pion by an oxygen or carbon nucleus