code: private void super_pos_alig(Atom[]ca1,Atom[]ca2,int[] idx1, int[] idx2, boolean getRMS) throws StructureException{
  
  		//System.out.println("superpos alig ");
  		Atom[] ca1subset = new Atom[idx1.length];
  		Atom[] ca2subset = new Atom[idx2.length];
  
  		for (int i = 0 ; i < idx1.length;i++){
  			//System.out.println("idx1 "+ idx1[i] + " " + idx2[i]);
  			int pos1 =  idx1[i];
  			int pos2 =  idx2[i];
  
  			ca1subset[i] =  ca1[pos1];
  			ca2subset[i] = (Atom) ca2[pos2].clone();
  		}
  
  		Matrix4d trans = SuperPositions.superpose(Calc.atomsToPoints(ca1subset),
  				Calc.atomsToPoints(ca2subset));
  		this.currentRotMatrix  = Matrices.getRotationJAMA(trans);
  		this.currentTranMatrix = Calc.getTranslationVector(trans);
  		//currentRotMatrix.print(3,3);
  		if ( getRMS) {
  			rotateShiftAtoms(ca2subset);
  			this.rms = Calc.rmsd(ca1subset,ca2subset);
  		}
  
  
  	}
docs: Superimposes two molecules according to residue index list idx1 and idx2.
  Does not change the original coordinates.
  as an internal result the rotation matrix and shift vectors for are set
  
  @param ca1 Atom set 1
  @param ca2 Atom set 2
  @param idx1 idx positions in set1
  @param idx2 idx positions in set2
  @param getRMS a flag if the RMS should be calculated
  @throws StructureException