Role of oxygen vacancies in the structural phase transformations of granular TiO2 thin films