def computeActivity(self, activeInputsBySource, permanenceThreshold=None):
    """
    Calculate the number of active synapses per segment.

    @param activeInputsBySource (dict)
    The active cells in each source. Example:
      {"customInputName1": np.array([42, 69])}
    """
    overlaps = None

    for source, connections in self.connectionsBySource.iteritems():
      o = connections.computeActivity(activeInputsBySource[source],
                                      permanenceThreshold)
      if overlaps is None:
        overlaps = o
      else:
        overlaps += o

    return overlaps