code: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
          IAtomContainer container;
          try {
              container = (IAtomContainer) atomContainer.clone();
              container = AtomContainerManipulator.removeHydrogens(container);
          } catch (CloneNotSupportedException e) {
              DoubleArrayResult result = new DoubleArrayResult(5);
              for (int i = 0; i < 5; i++)
                  result.add(Double.NaN);
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                      getDescriptorNames(), new CDKException("Error during cloner: " + e.getMessage(), e));
          }
  
          try {
              double[] w = listConvertion(container);
              int natom = container.getAtomCount();
              int[][] distancematrix = TopologicalMatrix.getMatrix(container);
              double[] masSum = new double[5];
  
              for (int k = 0; k < 5; k++) {
                  for (int i = 0; i < natom; i++) {
                      for (int j = 0; j < natom; j++) {
  
                          if (distancematrix[i][j] == k) {
                              masSum[k] += w[i] * w[j];
                          } else
                              masSum[k] += 0.0;
                      }
                  }
                  if (k > 0) masSum[k] = masSum[k] / 2;
  
              }
              DoubleArrayResult result = new DoubleArrayResult(5);
              for (double aMasSum : masSum) {
                  result.add(aMasSum);
              }
  
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                      getDescriptorNames());
  
          } catch (IOException | ClassNotFoundException ex) {
              DoubleArrayResult result = new DoubleArrayResult(5);
              for (int i = 0; i < 5; i++)
                  result.add(Double.NaN);
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                      getDescriptorNames(), new CDKException("Error while calculating the ATS_mass descriptor: "
                              + ex.getMessage(), ex));
          }
      }
docs: This method calculate the ATS Autocorrelation descriptor.