code: def add_group_COM(self, group_definitions, ref_geom=None, image_molecules=False, mass_weighted=True,):
          r
  
          from .misc import GroupCOMFeature
  
          f = GroupCOMFeature(self.topology, group_definitions , ref_geom=ref_geom, image_molecules=image_molecules, mass_weighted=mass_weighted)
          self.__add_feature(f)
docs: r"""
          Adds the centers of mass (COM) in cartesian coordinates of a group or groups of atoms.
          If these group definitions coincide directly with residues, use :obj:`add_residue_COM` instead. No periodic
          boundaries are taken into account.
  
          Parameters
          ----------
  
          group_definitions : iterable of integers
              List of the groups of atom indices for which the COM will be computed. The atoms are zero-indexed.
  
          ref_geom : :obj:`mdtraj.Trajectory`, default is None
              The coordinates can be centered to a reference geometry before computing the COM.
  
          image_molecules : boolean, default is False
              The method traj.image_molecules will be called before computing averages. The method tries to correct
              for molecules broken across periodic boundary conditions, but can be time consuming. See
              http://mdtraj.org/latest/api/generated/mdtraj.Trajectory.html#mdtraj.Trajectory.image_molecules
              for more details
  
          mass_weighted : boolean, default is True
              Set to False if you want the geometric center and not the COM
  
  
          .. note::
              Centering (with :obj:`ref_geom`) and imaging (:obj:`image_molecules=True`) the trajectories can sometimes be time consuming. Consider doing that to your trajectory-files prior to the featurization.