def test_losses_longitudinal_cut(self):

        longitudinal_tracker = RingAndRFTracker(self.rf_params, self.beam)
        full_tracker = FullRingAndRF([longitudinal_tracker])
        try:
            matched_from_distribution_function(self.beam,
                                               full_tracker,
                                               distribution_exponent=1.5,
                                               distribution_type='binomial',
                                               bunch_length=1.65e-9,
                                               bunch_length_fit='fwhm',
                                               distribution_variable='Hamiltonian')
        except TypeError as te:
            self.skipTest("Skipped because of known bug in deepcopy. Exception message %s"
                          % str(te))
        self.beam.losses_longitudinal_cut(0., 5e-9)
        self.assertEqual(len(self.beam.id[self.beam.id == 0]), 0,
                         msg='Beam: Failed losses_longitudinal_cut, first')

        self.beam.dt += 10e-9
        self.beam.losses_longitudinal_cut(0., 5e-9)
        self.assertEqual(len(self.beam.id[self.beam.id == 0]),
                         self.beam.n_macroparticles,
                         msg='Beam: Failed losses_longitudinal_cut, second')