A method of generating a data set defining a plurality of target points in a target volume in a body at which a particle beam is to be directed in a continuous or discontinuous process includes directing a particle beam to each of the target points so as to provide a spatial dose distribution in an area around the respective target point. The target points include a first target point having z-spacing, measured in a direction of the particle beam in a homogenous body equivalent to the body, from an adjacent second target point at a higher or lower particle energy. The method also includes defining the target points in the data set by at least one of the z-spacing and the spatial dose distribution in dependence upon a particle energy of the respective target point.