LorentzVector { public LorentzVector() { vector = new Vector3(); energy = 0.0; } LorentzVector();  LorentzVector(LorentzVector v);  LorentzVector(double px, double py, double pz, double en); void setPxPyPzE(double px, double py, double pz, double e); void setPxPyPzM(double px, double py, double pz, double m); void setVectM(Vector3 vect, double m); void rotateX(double angle); void rotateY(double angle); void rotateZ(double angle); double px(); double py(); double pz(); double p(); double theta(); double phi(); double mass2(); double mass(); double e(); Vector3 boostVector(); void boost(double bx, double by, double bz); void copy(LorentzVector vect); void boost(Vector3 vect); Vector3 vect(); void add(LorentzVector vLor); void sub(LorentzVector vLor); void invert(); void print();  }
@Test public void testLorentzVector() { LorentzVector v = new LorentzVector(0.0, 0.0, 6.0, Math.sqrt(6.0*6.0 + 0.938*0.938)); assertEquals(v.mass(), 0.938, 1e-6); assertEquals(v.theta(), 0.0, 1e-6); assertEquals(v.p(), 6.0, 1e-6); assertEquals(v.e(), Math.sqrt(6.0*6.0 + 0.938*0.938), 1e-6); v.setPxPyPzM(6.0, 0.0, 0.0, 0.000511); assertEquals(v.mass(), 0.000511, 1e-6); assertEquals(v.theta(), Math.PI/2.0, 1e-6); assertEquals(v.phi(), 0.0, 1e-6); assertEquals(v.p(), 6.0, 1e-6); assertEquals(v.e(), Math.sqrt(6.0*6.0 + 0.000511*0.000511), 1e-6); v.print(); }