The closest equivalent would be to store the vector in your PrimaryGeneratorAction, sample from it in GeneratePrimaries, then set the gun’s energy before calling GeneratePrimaryVertex. In general you can use the gps exactly like the particle gun, so if you want this functionality there’s little reason to stick tot he gun.
Also note that there is a /gps/hist/file command, which lets you store your spectrum in a more natural format, rather than a bunch of /gps/hist/point lines.
Note here I let the gun do it’s thing and then override the energy, rather than set the gun’s energy before calling GeneratePrimaryVertex. The latter would be more efficient, and mine is only done this way for bad historical reasons…