10 from ROOT.Belle2
import TestCalibrationAlgorithm
12 from caf.framework
import Calibration, CAF, Collection
13 from caf
import backends
15 b2.set_log_level(b2.LogLevel.INFO)
23 print(
"Usage: python3 caf_multiple_collections.py <data directory 1> <data directory 2>")
38 input_files_1 = [os.path.join(os.path.abspath(data_dir_1),
'*.root')]
39 input_files_2 = [os.path.join(os.path.abspath(data_dir_2),
'*.root')]
46 col_test_1 = b2.register_module(
'CaTest')
47 col_test_1.set_name(
'Test')
48 col_test_1.param(
'granularity',
'all')
49 col_test_1.param(
'spread', 1)
51 col_test_2 = b2.register_module(
'CaTest')
52 col_test_2.set_name(
'Test')
53 col_test_2.param(
'granularity',
'all')
54 col_test_2.param(
'spread', 20)
60 rec_path_1 = b2.create_path()
61 rec_path_1.add_module(
'Gearbox')
62 rec_path_1.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'EKLM'])
66 rec_path_2 = b2.create_path()
67 rec_path_2.add_module(
'Gearbox')
68 rec_path_2.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'CDC',
'BeamPipe',
'EKLM'])
74 alg_test = TestCalibrationAlgorithm()
77 alg_test.setPrefix(
'Test')
87 collection_1 =
Collection(collector=col_test_1,
88 input_files=input_files_1,
89 pre_collector_path=rec_path_1,
90 max_files_per_collector_job=1
102 collection_2 =
Collection(collector=col_test_2,
103 input_files=input_files_2,
104 pre_collector_path=rec_path_2,
105 max_files_per_collector_job=1
115 cal_test.add_collection(name=
'collection_1', collection=collection_1)
116 cal_test.add_collection(name=
'collection_2', collection=collection_2)
117 cal_test.algorithms = alg_test
138 cal_fw.add_calibration(cal_test)
141 print(
"End of CAF processing.")
144 if __name__ ==
"__main__":