3 """A simple example calibration that takes one input data list from raw data and performs
4 a single calibration."""
6 from prompt
import CalibrationSettings
9 settings = CalibrationSettings(name=
"ARICH channel masks",
10 expert_username=
"luka",
12 input_data_formats=[
"raw"],
13 input_data_names=[
"physics"],
19 def get_calibrations(input_data, **kwargs):
22 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
23 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
24 assigning to calibration.files_to_iov
26 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
27 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
28 release explicitly if you want to.
30 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
31 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
34 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
41 file_to_iov_physics = input_data[
"physics"]
46 max_files_per_run = 100
52 reduced_file_to_iov_physics = filter_by_max_files_per_run(file_to_iov_physics, max_files_per_run)
53 input_files_physics = list(reduced_file_to_iov_physics.keys())
54 basf2.B2INFO(f
"Total number of files actually used as input = {len(input_files_physics)}")
58 requested_iov = kwargs.get(
"requested_iov",
None)
60 from caf.utils
import IoV
62 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
67 from basf2
import create_path
68 from ROOT.Belle2
import ARICHChannelMaskMaker
70 alg_arich = ARICHChannelMaskMaker()
75 from caf.framework
import Calibration
76 from caf.strategies
import SequentialRunByRun
79 rec_path_1 = create_path()
80 rec_path_1.add_module(
'ARICHUnpacker')
83 collector=
"ARICHChannelMask",
84 algorithms=[alg_arich],
85 input_files=input_files_physics,
86 pre_collector_path=rec_path_1
89 cal_test.strategies = SequentialRunByRun
93 for algorithm
in cal_test.algorithms:
94 algorithm.params = {
"iov_coverage": output_iov}