9 """ECL calibration to calculate photon energy leakage corrections."""
11 from prompt
import CalibrationSettings, INPUT_DATA_FILTERS
16 settings = CalibrationSettings(name=
"ecl_leakage",
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"]
27 expert_config={
"number_energies": 8,
28 "forward_energies": [0.030, 0.050, 0.100, 0.200, 0.483, 1.166, 2.816, 6.800],
29 "barrel_energies": [0.030, 0.050, 0.100, 0.200, 0.458, 1.049, 2.402, 5.500],
30 "backward_energies": [0.030, 0.050, 0.100, 0.200, 0.428, 0.917, 1.962, 4.200],
31 "lowEnergyThreshold": 0.,
32 "showerArrayName":
"ECLTrimmedShowers"
41 def get_calibrations(input_data, **kwargs):
43 from ROOT
import Belle2
44 from caf.utils
import IoV
45 from caf.framework
import Calibration
49 file_to_iov_leakage = input_data[
"single_gamma_mc"]
50 input_files_leakage = list(file_to_iov_leakage.keys())
53 ecl_leakage_collector = basf2.register_module(
"eclLeakageCollector")
54 ecl_leakage_collector.param(
"granularity",
"all")
55 ecl_leakage_collector.param(
"position_bins", 29)
58 expert_config = kwargs.get(
"expert_config")
59 number_energies = expert_config[
"number_energies"]
60 ecl_leakage_collector.param(
"number_energies", number_energies)
62 forward_energies = expert_config[
"forward_energies"]
63 ecl_leakage_collector.param(
"energies_forward", forward_energies)
65 barrel_energies = expert_config[
"barrel_energies"]
66 ecl_leakage_collector.param(
"energies_barrel", barrel_energies)
68 backward_energies = expert_config[
"backward_energies"]
69 ecl_leakage_collector.param(
"energies_backward", backward_energies)
71 showerArrayName = expert_config[
"showerArrayName"]
72 ecl_leakage_collector.param(
"showerArrayName", showerArrayName)
76 lowEnergyThreshold = expert_config[
"lowEnergyThreshold"]
77 algo_leakage.setLowEnergyThreshold(lowEnergyThreshold)
82 collector=ecl_leakage_collector,
83 algorithms=algo_leakage,
84 input_files=input_files_leakage)
87 ecl_leakage_pre_path = basf2.create_path()
88 cal_ecl_leakage.pre_collector_path = ecl_leakage_pre_path
92 requested_iov = kwargs.get(
"requested_iov",
None)
93 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
94 for algorithm
in cal_ecl_leakage.algorithms:
95 algorithm.params = {
"apply_iov": output_iov}
99 return [cal_ecl_leakage]
Calculate ECL energy leakage corrections.