9 """ECL calibration to calculate nOptimal number of crystals for cluster energy."""
11 from prompt
import CalibrationSettings, INPUT_DATA_FILTERS
16 settings = CalibrationSettings(name=
"ecl_nOptimal",
17 expert_username=
"hearty",
19 input_data_formats=[
"mdst"],
20 input_data_names=[
"single_gamma_mc"],
23 INPUT_DATA_FILTERS[
"Data Tag"][
"single_gamma_mc"]
32 expert_config={
"number_energies": 8,
33 "forward_energies": [0.030, 0.050, 0.100, 0.200, 0.483, 1.166, 2.816, 6.800],
34 "barrel_energies": [0.030, 0.050, 0.100, 0.200, 0.458, 1.049, 2.402, 5.500],
35 "backward_energies": [0.030, 0.050, 0.100, 0.200, 0.428, 0.917, 1.962, 4.200],
36 "digitArrayName":
"ECLTrimmedDigits",
37 "showerArrayName":
"ECLTrimmedShowers"
45 def get_calibrations(input_data, **kwargs):
47 from ROOT
import Belle2
48 from caf.utils
import IoV
49 from caf.framework
import Calibration
53 file_to_iov_nOptimal = input_data[
"single_gamma_mc"]
54 input_files_nOptimal = list(file_to_iov_nOptimal.keys())
57 ecl_nOptimal_collector = basf2.register_module(
"eclNOptimalCollector")
58 ecl_nOptimal_collector.param(
"granularity",
"all")
61 expert_config = kwargs.get(
"expert_config")
62 number_energies = expert_config[
"number_energies"]
63 ecl_nOptimal_collector.param(
"numberEnergies", number_energies)
65 forward_energies = expert_config[
"forward_energies"]
66 ecl_nOptimal_collector.param(
"energiesForward", forward_energies)
68 barrel_energies = expert_config[
"barrel_energies"]
69 ecl_nOptimal_collector.param(
"energiesBarrel", barrel_energies)
71 backward_energies = expert_config[
"backward_energies"]
72 ecl_nOptimal_collector.param(
"energiesBackward", backward_energies)
74 digitArrayName = expert_config[
"digitArrayName"]
75 ecl_nOptimal_collector.param(
"digitArrayName", digitArrayName)
77 showerArrayName = expert_config[
"showerArrayName"]
78 ecl_nOptimal_collector.param(
"showerArrayName", showerArrayName)
86 collector=ecl_nOptimal_collector,
87 algorithms=algo_nOptimal,
88 input_files=input_files_nOptimal)
91 ecl_nOptimal_pre_path = basf2.create_path()
92 cal_ecl_nOptimal.pre_collector_path = ecl_nOptimal_pre_path
96 requested_iov = kwargs.get(
"requested_iov",
None)
97 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
98 for algorithm
in cal_ecl_nOptimal.algorithms:
99 algorithm.params = {
"apply_iov": output_iov}
103 return [cal_ecl_nOptimal]
Algorithm that works with eclNOptimalCollector to find the number of crystals to be summed to get the...