A mass spectrometer that is a triple quadrupole mass spectrometer in which a first-stage quadrupole mass filter and a second-stage quadrupole mass filter are placed on opposite sides of a collision cell for dissociating ions comprising a sample introduction means configured to introduce one or more components in a liquid sample in such a manner that a temporal change in a density of the components has a peak shape, and an ion source arranged to receive said components from the sample introduction means, to ionize said components and to introduce said components into the triple quadrupole mass spectrometer to undergo a mass spectrometry, wherein tunings to optimize control parameters of various parts are performed based on results of mass spectrometry of known components in a sample, the mass spectrometer comprising: a) a parameter setting means for changing a value of a collision energy (CE1,..., CE5) for dissociating ions of a target component in the collision cell, at predetermined intervals within a predetermined range, the value of the collision energy (CE1,..., CE5) being one of the control parameters to be adjusted; b) a result acquisition means for acquiring a mass spectrometry result each time the value of the collision energy (CE1,..., CE5) is changed by the parameter setting means; and c) a parameter optimization means which is capable of working either in a coarse adjustment mode in which the value of the collision energy (CE1,..., CE5) is changed at first intervals in a first predetermined range by the parameter setting means or in a fine adjustment mode in which the value of the collision energy (CE1,..., CE5) is changed at second intervals smaller than the first intervals in a second predetermined range narrower than the first predetermined range, and which, during a period in which a target component in the sample is introduced into the ion source by a first sample injection, first, in the coarse adjustment mode determines an approximate value of the collision energy (CE1,..., CE5) for each of a plurality of product ions (A, B, C) generated by dissociating ions derived from the target component based on the mass spectrometry result obtained by the result acquisition means, and subsequently, in the fine adjustment mode for the second predetermined range set to include the approximate value determines an optimal value of the collision energy (CE1,..., CE5) for each of the plurality of the product ions (A, B, C) based on the mass spectrometry result obtained by the result acquisition means, wherein the result acquisition means obtaining a mass spectrometry result in the coarse adjustment mode obtains a detection signal strength data with respect to each of the plurality of the product ions (A, B, C) each time the parameter setting means changes the value of the collision energy (CE1,..., CE5) at the first intervals. a) a parameter setting means for changing a value of a collision energy (CE1,..., CE5) for dissociating ions of a target component in the collision cell, at predetermined intervals within a predetermined range, the value of the collision energy (CE1,..., CE5) being one of the control parameters to be adjusted; b) a result acquisition means for acquiring a mass spectrometry result each time the value of the collision energy (CE1,..., CE5) is changed by the parameter setting means; and c) a parameter optimization means which is capable of working either in a coarse adjustment mode in which the value of the collision energy (CE1,..., CE5) is changed at first intervals in a first predetermined range by the parameter setting means or in a fine adjustment mode in which the value of the collision energy (CE1,..., CE5) is changed at second intervals smaller than the first intervals in a second predetermined range narrower than the first predetermined range, and which, during a period in which a target component in the sample is introduced into the ion source by a first sample injection, first, in the coarse adjustment mode determines an approximate value of the collision energy (CE1,..., CE5) for each of a plurality of product ions (A, B, C) generated by dissociating ions derived from the target component based on the mass spectrometry result obtained by the result acquisition means, and subsequently, in the fine adjustment mode for the second predetermined range set to include the approximate value determines an optimal value of the collision energy (CE1,..., CE5) for each of the plurality of the product ions (A, B, C) based on the mass spectrometry result obtained by the result acquisition means,