code: public static double getAllAtomRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
              Map<Integer, Integer> mappedAtoms, boolean Coords3d) throws CDKException {
          //logger.debug("**** GT getAllAtomRMSD ****");
          double sum = 0;
          double RMSD;
          Iterator<Integer> firstAtoms = mappedAtoms.keySet().iterator();
          int firstAtomNumber;
          int secondAtomNumber;
          int n = 0;
          while (firstAtoms.hasNext()) {
              firstAtomNumber = firstAtoms.next();
              try {
                  secondAtomNumber = mappedAtoms.get(firstAtomNumber);
                  IAtom firstAtom = firstAtomContainer.getAtom(firstAtomNumber);
                  if (Coords3d) {
                      sum = sum
                              + Math.pow(
                                      firstAtom.getPoint3d().distance(
                                              secondAtomContainer.getAtom(secondAtomNumber).getPoint3d()), 2);
                      n++;
                  } else {
                      sum = sum
                              + Math.pow(
                                      firstAtom.getPoint2d().distance(
                                              secondAtomContainer.getAtom(secondAtomNumber).getPoint2d()), 2);
                      n++;
                  }
              } catch (Exception ex) {
                  throw new CDKException(ex.getMessage(), ex);
              }
          }
          RMSD = Math.sqrt(sum / n);
          return RMSD;
      }
docs: Return the RMSD between the 2 aligned molecules.
  
  @param  firstAtomContainer                the (largest) first aligned AtomContainer which is the reference
  @param  secondAtomContainer               the second aligned AtomContainer
  @param  mappedAtoms             			Map: a Map of the mapped atoms
  @param  Coords3d            			    boolean: true if molecules has 3D coords, false if molecules has 2D coords
  @return                   				double: the value of the RMSD
  @exception  CDKException  if there is an error in getting mapped atoms