1. A method for performing a mass analysis of a subset of ions generated from a sample, the subset of ions comprising a restricted range mass-to-charge (m/z) ratios of the generated ions, the method comprising the steps of (i) performing a survey mass analysis, using a first mass analyzer that employs indirect detection of ions by detection of an image current induced on an electrode by the motion of the ions within an ion trap, so as to identify the restricted range of m/z ratios and to measure a flux of ions having m/z ratios within said restricted range and (ii) performing a dependent mass analysis, using a second mass analyzer of the mass spectrometer, of an optimal quantity of ions having m/z ratios within said restricted range, said optimal quantity of ions collected for a time period determined by the measured ion flux, the method CHARACTERIZED IN THAT: the time period is determined using a corrected ion flux that is calculated from the measured flux of ions; wherein a calculation of the corrected ion flux includes a correction that comprises an estimate of the quantity of ions that are trapped in and undetected by the first mass analyzer.