works on both AOD and MiniAOD