Reweighting QCD matrix-element and parton-shower calculations