code: public static double getRMS(Atom[] ca1, Atom[]ca2,JointFragments frag) throws StructureException {
  		//      now svd ftmp and check if the rms is < X ...
  		AlternativeAlignment ali = new AlternativeAlignment();
  		ali.apairs_from_idxlst(frag);
  		double rms = 999;
  
  		int[] idx1 = ali.getIdx1();
  		int[] idx2 = ali.getIdx2();
  
  		Atom[] ca1subset = AlignUtils.getFragmentFromIdxList(ca1, idx1);
  
  		Atom[] ca2subset = AlignUtils.getFragmentFromIdxList(ca2,idx2);
  
  		ali.calculateSuperpositionByIdx(ca1,ca2);
  
  		Matrix rot = ali.getRotationMatrix();
  		Atom atom = ali.getShift();
  
  		for (Atom a : ca2subset) {
  			Calc.rotate(a, rot);
  			Calc.shift(a, atom);
  		}
  
  		rms = Calc.rmsd(ca1subset,ca2subset);
  
  		return rms;
  	}
docs: Get the RMS of the JointFragments pair frag
  
  @param ca1 the array of all atoms of structure1
  @param ca2 the array of all atoms of structure1
  @param frag the JointFragments object that contains the list of identical positions
  @return the rms