Density profile and interaction energy calculation

I have done an nvt simulation of water on sio2 surface now for post processing I want to calculate the interaction energy of water with the surface and also the density profile. Any help how to do that in lammps. I have seen published literature where they have plot the data but how to extract it after my run is completed. Any idea regarding that is much appreciated.

Thank you
Devargya

https://lammps.sandia.gov/doc/Howto_chunk.html

https://lammps.sandia.gov/doc/compute_group_group.html