1. A method for determining a parameter vector that includes a plurality of parameters of a detector pileup model of a photon-counting detector, the detector pileup model being used for pileup correction for a spectral computed-tomography scanner, the method comprising: setting values of the plurality of parameters, the plurality of parameters including a dead time parameter and individual probabilities of different pileup events, the individual probabilities including a probability of single photon events, a probability of double quasi-coincident photon events, and a probability of at least three quasi-coincident photon events; determining, using (1) a detector response model, (2) an incident spectrum, and (3) the set values of the parameter vector, a plurality of component spectra, each component spectrum corresponding to one of the individual probabilities of the different pileup events; summing the plurality of component spectra to generate an output spectrum; calculating, based on the output spectrum and a measured spectrum, a value of a cost function; updating at least one of the values of the parameter vector; and repeating the determining, summing, calculating, and updating steps until a stopping criteria is met, so as to determine a parameter vector that optimizes the cost function.