186 def get_prefixes(self, always_include_indices=False, use_relative_indices=False):
187 """
188 Recursively walk through the tree of selected particles and return a list
189 of prefixes for aliases and a tuple of decay indexes for that prefix.
190
191 For example for ``B0 -> [D0 -> ^pi+] ^pi0`` it might return
192
193 >>> DecayParticleNode.build('^B0 -> [D0 -> ^pi+] ^pi0').get_prefixes()
194 [ ("", None), ("D0_pi", (0, 0)), ("pi0", (1,)) ]
195
196 and to create aliases from these one would use the indices as arguments for
197 the b2:var:`daughter` meta variable.
198
199 This function will make sure that prefix names are unique: If there are
200 multiple siblings of one node with the same particle name they will be
201 distinguished by either suffixing them with the decay index (if
202 ``use_relative_indices=False``) or they will just be enumerated
203 starting at 0 otherwise.
204
205 Arguments:
206 always_include_indices (bool): If True always add the index of the
207 particle to the prefix, otherwise the index is only added if
208 more than one sibling of the same particle exist.
209 use_relative_indices (bool): If True the indices used will **not**
210 be the daughter indices in the full decay string but just the
211 relative indices: If multiple sibling particles with the same
212 name they will be just numbered starting at zero as they appear
213 in the aliases.
214 """
215 return self.__walk(always_include_indices, use_relative_indices, "", tuple())
216