code: public static AtomContactSet getAtomsInContact(Chain chain,
  			String[] atomNames, double cutoff) {
  		Grid grid = new Grid(cutoff);
  
  		Atom[] atoms = null;
  		if (atomNames == null) {
  			atoms = getAllNonHAtomArray(chain, false);
  		} else {
  			atoms = getAtomArray(chain, atomNames);
  		}
  		// If tha
  		if(atoms.length==0){
  			logger.warn("No atoms found for buidling grid!");
  			return new AtomContactSet(cutoff);
  		}
  		grid.addAtoms(atoms);
  
  		return grid.getAtomContacts();
  	}
docs: Returns the set of intra-chain contacts for the given chain for given
  atom names, i.e. the contact map. Uses a geometric hashing algorithm that
  speeds up the calculation without need of full distance matrix. The
  parsing mode {@link FileParsingParameters#setAlignSeqRes(boolean)} needs
  to be set to true for this to work.
  
  @param chain
  @param atomNames
  the array with atom names to be used. Beware: CA will do both
  C-alphas an Calciums if null all non-H atoms of non-hetatoms
  will be used
  @param cutoff
  @return