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();}
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();}