columnflow.tasks.selection#

Tasks related to selecting events and performing post-selection bookkeeping.

Classes:

SelectEvents(*args, **kwargs)

SelectEventsWrapper(*args, **kwargs)

MergeSelectionStats(*args, **kwargs)

MergeSelectionStatsWrapper(*args, **kwargs)

MergeSelectionMasks(*args, **kwargs)

MergeSelectionMasksWrapper(*args, **kwargs)

class SelectEvents(*args, **kwargs)[source]#

Bases: SelectorMixin, CalibratorsMixin, ChunkedIOMixin, DatasetTask, LocalWorkflow, RemoteWorkflow

Methods:

workflow_requires()

Hook to add workflow requirements.

requires()

The Tasks that this Task depends on.

output()

The output that this Task produces.

run()

The task run method, to be overridden in a subclass.

workflow_requires()[source]#

Hook to add workflow requirements. This method is expected to return a dictionary. When this method is called from a branch task, an exception is raised.

requires()[source]#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires

output()[source]#

The output that this Task produces.

The output of the Task determines if the Task needs to be run–the task is considered finished iff the outputs all exist. Subclasses should override this method to return a single Target or a list of Target instances.

Implementation note

If running multiple workers, the output must be a resource that is accessible by all workers, such as a DFS or database. Otherwise, workers might compute the same output since they don’t see the work done by other workers.

See Task.output

run()[source]#

The task run method, to be overridden in a subclass.

See Task.run

class SelectEventsWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Methods:

requires()

The Tasks that this Task depends on.

requires()#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires

class MergeSelectionStats(*args, **kwargs)[source]#

Bases: SelectorMixin, CalibratorsMixin, DatasetTask, ForestMerge

Methods:

create_branch_map()

Define the branch map for when this task is used as a workflow.

run()

The task run method, to be overridden in a subclass.

merge_counts(dst, src)

Adds counts (integers or floats) in a src dictionary recursively into a dst dictionary.

create_branch_map()[source]#

Define the branch map for when this task is used as a workflow. By default, use the merging information provided by file_merging_factor to return a dictionary which maps branches to one or more input file indices. E.g. 1 -> [3, 4, 5] would mean that branch 1 is simultaneously handling input file indices 3, 4 and 5.

run()[source]#

The task run method, to be overridden in a subclass.

See Task.run

classmethod merge_counts(dst, src)[source]#

Adds counts (integers or floats) in a src dictionary recursively into a dst dictionary. dst is updated in-place and also returned.

Return type:

dict

class MergeSelectionStatsWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Methods:

requires()

The Tasks that this Task depends on.

requires()#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires

class MergeSelectionMasks(*args, **kwargs)[source]#

Bases: SelectorMixin, CalibratorsMixin, DatasetTask, ForestMerge, RemoteWorkflow

Methods:

create_branch_map()

Define the branch map for when this task is used as a workflow.

create_branch_map()[source]#

Define the branch map for when this task is used as a workflow. By default, use the merging information provided by file_merging_factor to return a dictionary which maps branches to one or more input file indices. E.g. 1 -> [3, 4, 5] would mean that branch 1 is simultaneously handling input file indices 3, 4 and 5.

class MergeSelectionMasksWrapper(*args, **kwargs)#

Bases: AnalysisTask, WrapperTask

Methods:

requires()

The Tasks that this Task depends on.

requires()#

The Tasks that this Task depends on.

A Task will only run if all of the Tasks that it requires are completed. If your Task does not require any other Tasks, then you don’t need to override this method. Otherwise, a subclass can override this method to return a single Task, a list of Task instances, or a dict whose values are Task instances.

See Task.requires