code: protected static double calAfpRmsd(int afpn, int[] afpPositions, int listStart,  AFPChain afpChain,Atom[] ca1, Atom[] ca2)
  	{
  
  
  		if (debug)
  			System.out.println("XXX calling afp2res "+ afpn + " " + afpPositions.length);
  
  		int focusResn = AFPTwister.afp2Res(afpChain,afpn, afpPositions, listStart);
  
  
  		int[] focusRes1 = afpChain.getFocusRes1();
  		int[] focusRes2 = afpChain.getFocusRes2();
  
  		if (debug)
  			System.out.println("XXX calculating calAfpRmsd: " + focusResn + " " + focusRes1.length + " " + focusRes2.length + " " + afpChain.getMinLen() + " " );
  		double rmsd = getRmsd(focusResn, focusRes1, focusRes2 , afpChain,ca1,  ca2);
  
  		return rmsd;
  	}
docs: return the rmsd of the residues from the segments that form the given AFP list
  this value can be a measurement (1) for the connectivity of the AFPs
  
  @param afpn
  @param afpPositions the positions of AFPs to work on.
  @param listStart the starting position in the list of AFPs
  @param afpChain
  @param ca1
  @param ca2
  @return rmsd