|
def | __init__ (self, folders, evaluator, *mapping={}, **kwargs) |
|
def | get_variable (self, name) |
|
def | read (self, query_range, folder_base, folder_names) |
|
def | merge_input_variables (self, *inputs) |
|
def | merge_inputs (self, clazz, channel, *inputs) |
|
Definition at line 33 of file afp.py.
◆ __init__()
def python.subdetectors.afp.DCSC_Merged_Variable.__init__ |
( |
|
self, |
|
|
|
folders, |
|
|
|
evaluator, |
|
|
* |
mapping = {} , |
|
|
** |
kwargs |
|
) |
| |
Definition at line 34 of file afp.py.
34 def __init__(self, folders, evaluator, *, mapping={}, **kwargs):
35 folder_merge =
','.
join(folders)
37 super().
__init__(folder_merge, evaluator, **kwargs)
38 self.folder_names = folders
39 self.mapping = mapping
◆ get_variable()
def python.subdetectors.afp.DCSC_Merged_Variable.get_variable |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 41 of file afp.py.
41 def get_variable(self, name):
42 for var
in self.variables:
43 if var.folder_name == name:
45 raise RuntimeError(
"Folder '%s' not found" % name)
◆ merge_input_variables()
def python.subdetectors.afp.DCSC_Merged_Variable.merge_input_variables |
( |
|
self, |
|
|
* |
inputs |
|
) |
| |
Definition at line 69 of file afp.py.
69 def merge_input_variables(self, *inputs):
70 type_bases = [iovs.iov_type
for iovs
in inputs]
71 base_names = [base.__name__[:-4]
for base
in type_bases]
72 attributes = [base.lower()
for base
in base_names]
73 clazz =
make_iov_type(
'MERGER_OF_' +
'_AND_'.
join(base_names), tuple([
'channel'] + attributes))
75 inputs_by_channel = [iovs.by_channel
for iovs
in inputs]
76 all_channels =
sorted(
set(y
for x
in inputs_by_channel
for y
in x.keys()))
79 for channel
in all_channels:
80 c_inputs = [x[channel]
for x
in inputs_by_channel]
81 result.extend(iov
for iov
in self.merge_inputs(clazz, channel, *c_inputs))
83 return IOVSet(result, iov_type=clazz, origin=self.folder_names)
◆ merge_inputs()
def python.subdetectors.afp.DCSC_Merged_Variable.merge_inputs |
( |
|
self, |
|
|
|
clazz, |
|
|
|
channel, |
|
|
* |
inputs |
|
) |
| |
Definition at line 85 of file afp.py.
85 def merge_inputs(self, clazz, channel, *inputs):
86 result = [clazz(since, until, channel, *states)
for since, until, states
in process_iovs(*inputs)]
87 return IOVSet(result, iov_type=clazz, origin=self.folder_names)
◆ read()
def python.subdetectors.afp.DCSC_Merged_Variable.read |
( |
|
self, |
|
|
|
query_range, |
|
|
|
folder_base, |
|
|
|
folder_names |
|
) |
| |
Definition at line 47 of file afp.py.
47 def read(self, query_range, folder_base, folder_names):
49 folders = folder_names.split(
',')
51 for folder
in folders:
52 iovs = super().
read(query_range, folder_base, folder)
53 if folder
in self.mapping:
57 iovs = self.merge_input_variables(*var_iovs)
59 if config.opts.check_input_time:
60 self.print_time_info(iovs)
62 if log.isEnabledFor(logging.INFO):
63 input_hash =
hash(iovs)
64 self.input_hashes.
append(input_hash)
◆ folder_names
python.subdetectors.afp.DCSC_Merged_Variable.folder_names |
◆ mapping
python.subdetectors.afp.DCSC_Merged_Variable.mapping |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.