10
10
from columnflow .tasks .framework .mixins import (
11
11
SelectorMixin , CalibratorsMixin ,
12
12
)
13
+ from columnflow .tasks .framework .remote import RemoteWorkflow
13
14
from columnflow .tasks .selection import MergeSelectionStats
14
15
from columnflow .util import maybe_import , dev_sandbox
15
16
from columnflow .config_util import get_datasets_from_process
25
26
26
27
class GetBtagNormalizationSF (
27
28
HBWTask ,
28
- ConfigTask ,
29
29
SelectorMixin ,
30
30
CalibratorsMixin ,
31
- # law.LocalWorkflow,
31
+ ConfigTask ,
32
+ law .LocalWorkflow ,
33
+ RemoteWorkflow ,
32
34
):
33
- reqs = Requirements (MergeSelectionStats = MergeSelectionStats )
35
+ reqs = Requirements (
36
+ RemoteWorkflow .reqs ,
37
+ MergeSelectionStats = MergeSelectionStats ,
38
+ )
34
39
35
40
store_as_dict = False
36
41
@@ -47,6 +52,10 @@ class GetBtagNormalizationSF(
47
52
description = "Processes to consider for the scale factors" ,
48
53
)
49
54
55
+ def create_branch_map (self ):
56
+ # single branch without payload
57
+ return {0 : None }
58
+
50
59
@cached_property
51
60
def process_insts (self ):
52
61
processes = [self .config_inst .get_process (process ) for process in self .processes ]
@@ -59,10 +68,22 @@ def dataset_insts(self):
59
68
datasets .update (get_datasets_from_process (self .config_inst , process_inst ))
60
69
return list (datasets )
61
70
71
+ def workflow_requires (self ):
72
+ reqs = super ().workflow_requires ()
73
+ reqs ["selection_stats" ] = {
74
+ dataset .name : self .reqs .MergeSelectionStats .req_different_branching (
75
+ self ,
76
+ dataset = dataset .name ,
77
+ branch = - 1 ,
78
+ )
79
+ for dataset in self .dataset_insts
80
+ }
81
+ return reqs
82
+
62
83
def requires (self ):
63
84
reqs = {}
64
85
reqs ["selection_stats" ] = {
65
- dataset .name : self .reqs .MergeSelectionStats .req (
86
+ dataset .name : self .reqs .MergeSelectionStats .req_different_branching (
66
87
self ,
67
88
dataset = dataset .name ,
68
89
branch = - 1 ,
0 commit comments