def get_num_particles_in_detector(self, detector, shower_parameters):
        """Get the number of particles in a detector

        :param detector: :class:`~sapphire.clusters.Detector` for which
                         the number of particles will be determined.
        :param shower_parameters: dictionary with the shower parameters.

        """
        x, y = detector.xy_coordinates
        core_x, core_y = shower_parameters['core_pos']
        zenith = shower_parameters['zenith']
        azimuth = shower_parameters['azimuth']
        size = shower_parameters['size']

        r, phi = self.ldf.calculate_core_distance_and_angle(x, y, core_x,
                                                            core_y)

        p_ground = self.ldf.calculate_ldf_value(r, phi, size, zenith, azimuth)
        num_particles = self.simulate_particles_for_density(
            p_ground * detector.get_area())

        return num_particles