if options.verbose: print("generating distribution measurement jobs for %s ..." % str(seg), file=sys.stderr) input_cache_nodes |= power.make_burca_tailor_fragment(dag, set([entry for entry in options.input_cache if entry.segmentlistdict.intersects_segment(seg)]), seg, "LIKELIHOOD_MAIN") for i, (nodes, cache) in enumerate(zip(round_robin_cache_nodes, options.round_robin_cache)): nodes |= power.make_burca_tailor_fragment(dag, set([entry for entry in cache if entry.segmentlistdict.intersects_segment(seg)]), seg, "LIKELIHOOD_RR%02d" % i) # # Compute likelihood ratios for coincs # if options.verbose: print("generating likelihood assignment jobs for main group ...", file=sys.stderr) parents = reduce(lambda a, b: a | b, round_robin_cache_nodes, input_cache_nodes) nodes = power.make_burca2_fragment(dag, options.input_cache, parents, "LIKELIHOOD_MAIN") def round_robin(round_robin_cache_nodes, round_robin_cache): parents = list(itertools.combinations(round_robin_cache_nodes, len(round_robin_cache_nodes) - 1)) parents.reverse() parents = [reduce(lambda a, b: a | b, seq) for seq in parents] return zip(parents, [cache for (cache,) in itertools.combinations(round_robin_cache, 1)]) for i, (parents, apply_to_cache) in enumerate(round_robin(round_robin_cache_nodes, options.round_robin_cache)): if options.verbose: print("generating likelihood assignment jobs for round-robin group %d ..." % i, file=sys.stderr) nodes |= power.make_burca2_fragment(dag, apply_to_cache, parents | input_cache_nodes, "LIKELIHOOD_RR%02d" % i) #