8from .utils
import add_low_multiplicity_generator, EventRangePathSplitter, ExtraInfoPathSplitter
9from .constants
import EventCodes_taus
11from basf2
import Path, AfterConditionPath
14def add_generators(path, event_codes):
16 Add generators for a list of event codes.
19 path (basf2.Path): path where generators should be added
20 event_codes (Iterable): tuple
or list of EventCode.
23 s1 = path.add_module(EventRangePathSplitter(event_codes))
26 generator_path = Path()
27 add_low_multiplicity_generator(generator_path, e)
28 s1.if_value(f
'={e.value}', generator_path, AfterConditionPath.CONTINUE)
30 if len(tuple(set(event_codes) & set(EventCodes_taus))):
31 s2 = path.add_module(ExtraInfoPathSplitter(EventCodes_taus))
32 tau_decay_path = Path()
33 tau_decay_path.add_module(
'EvtGenDecay')
34 s2.if_true(tau_decay_path, AfterConditionPath.CONTINUE)