def merge_constituents(self, constituent_list): """ returns the combination of the constituents lists @param constituent_list list of JetConstituent objects, e.g. [jet1.constituents, jet2.constituents] """ ret = JetConstituents() for elem in constituent_list: for group in elem.values(): for ptc in group: ret.append(ptc) ret.sort() return ret