slaclab / lcsim

LCSim Java Library
Other
1 stars 5 forks source link

Allow the momentum to be set on a track state. #48

Open mholtrop opened 6 months ago

mholtrop commented 6 months ago

Kind of crazy that there is a setter for everything on a track state, but not the momentum. Sure, you can in theory compute the momentum from omega and tanlambda and phi. In practice, this requires the magnetic field, which is not stored with the track state. So, in many situations the track state is actually rather useless. One such situation is when there is no magnetic field. Surely the particle can have a momentum there, so we need to be able to set it.

All we need is:

public void setMomentum(double[] momentum){ this.momentum = momentum.clone();}