Magnetocaloric effect in nanoscale thin films and heterostructures