Critical current density of a YBa2Cu3O7 film: Comparison between experiment and collective pinning theory