17from caf.framework
import Calibration, CAF, Collection
18from caf
import backends
20b2.set_log_level(b2.LogLevel.INFO)
28 print(
"Usage: python3 caf_multiple_collections.py <data directory 1> <data directory 2>")
43 input_files_1 = [os.path.join(os.path.abspath(data_dir_1),
'*.root')]
44 input_files_2 = [os.path.join(os.path.abspath(data_dir_2),
'*.root')]
51 col_test_1 = b2.register_module(
'CaTest')
52 col_test_1.set_name(
'Test')
53 col_test_1.param(
'granularity',
'all')
54 col_test_1.param(
'spread', 1)
56 col_test_2 = b2.register_module(
'CaTest')
57 col_test_2.set_name(
'Test')
58 col_test_2.param(
'granularity',
'all')
59 col_test_2.param(
'spread', 20)
65 rec_path_1 = b2.create_path()
66 rec_path_1.add_module(
'Gearbox')
67 rec_path_1.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'EKLM'])
71 rec_path_2 = b2.create_path()
72 rec_path_2.add_module(
'Gearbox')
73 rec_path_2.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'CDC',
'BeamPipe',
'EKLM'])
79 from ROOT
import Belle2
80 from ROOT.Belle2
import TestCalibrationAlgorithm
81 alg_test = TestCalibrationAlgorithm()
84 alg_test.setPrefix(
'Test')
94 collection_1 =
Collection(collector=col_test_1,
95 input_files=input_files_1,
96 pre_collector_path=rec_path_1,
97 max_files_per_collector_job=1
109 collection_2 =
Collection(collector=col_test_2,
110 input_files=input_files_2,
111 pre_collector_path=rec_path_2,
112 max_files_per_collector_job=1
122 cal_test.add_collection(name=
'collection_1', collection=collection_1)
123 cal_test.add_collection(name=
'collection_2', collection=collection_2)
124 cal_test.algorithms = alg_test
145 cal_fw.add_calibration(cal_test)
146 cal_fw.backend = backends.Local(max_processes=4)
148 print(
"End of CAF processing.")
151if __name__ ==
"__main__":