9"""ECL cluster crystal energy calibration using single photon MCrd."""
11from prompt
import CalibrationSettings, INPUT_DATA_FILTERS
15settings = CalibrationSettings(
16 name=
"ecl_cluster_energy",
17 expert_username=
"hearty",
19 input_data_formats=[
"mdst"],
20 input_data_names=[
"single_gamma_mc"],
21 input_data_filters={
"single_gamma_mc": [INPUT_DATA_FILTERS[
"Data Tag"][
"single_gamma_mc"]]},
28 expert_config={
"number_energies": 8,
29 "forward_energies": [0.030, 0.050, 0.100, 0.200, 0.483, 1.166, 2.816, 6.800],
30 "barrel_energies": [0.030, 0.050, 0.100, 0.200, 0.458, 1.049, 2.402, 5.500],
31 "backward_energies": [0.030, 0.050, 0.100, 0.200, 0.428, 0.917, 1.962, 4.200],
32 "digitArrayName":
"ECLTrimmedDigits",
33 "showerArrayName":
"ECLTrimmedShowers",
34 "nGroupPerThetaID": 8,
35 "lowEnergyThreshold": 0.}
42def get_calibrations(input_data, **kwargs):
44 from ROOT
import Belle2
45 from caf.utils
import IoV
46 from caf.framework
import Calibration
50 file_to_iov = input_data[
"single_gamma_mc"]
51 input_files_single_gamma = list(file_to_iov.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)
80 nGroupPerThetaID = expert_config[
"nGroupPerThetaID"]
81 ecl_nOptimal_collector.param(
"nGroupPerThetaID", nGroupPerThetaID)
89 collector=ecl_nOptimal_collector,
90 algorithms=algo_nOptimal,
91 input_files=input_files_single_gamma)
94 ecl_nOptimal_pre_path = basf2.create_path()
95 cal_ecl_nOptimal.pre_collector_path = ecl_nOptimal_pre_path
101 ecl_leakage_collector = basf2.register_module(
"eclLeakageCollector")
102 ecl_leakage_collector.param(
"granularity",
"all")
103 ecl_leakage_collector.param(
"position_bins", 29)
106 ecl_leakage_collector.param(
"number_energies", number_energies)
107 ecl_leakage_collector.param(
"energies_forward", forward_energies)
108 ecl_leakage_collector.param(
"energies_barrel", barrel_energies)
109 ecl_leakage_collector.param(
"energies_backward", backward_energies)
110 ecl_leakage_collector.param(
"showerArrayName", showerArrayName)
114 lowEnergyThreshold = expert_config[
"lowEnergyThreshold"]
115 algo_leakage.setLowEnergyThreshold(lowEnergyThreshold)
120 collector=ecl_leakage_collector,
121 algorithms=algo_leakage,
122 input_files=input_files_single_gamma)
125 cal_ecl_leakage.depends_on(cal_ecl_nOptimal)
128 ecl_leakage_pre_path = basf2.create_path()
129 cal_ecl_leakage.pre_collector_path = ecl_leakage_pre_path
133 requested_iov = kwargs.get(
"requested_iov",
None)
134 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
135 for algorithm
in cal_ecl_nOptimal.algorithms:
136 algorithm.params = {
"apply_iov": output_iov}
137 for algorithm
in cal_ecl_leakage.algorithms:
138 algorithm.params = {
"apply_iov": output_iov}
142 return [cal_ecl_nOptimal, cal_ecl_leakage]
Calculate ECL energy leakage corrections.
Algorithm that works with eclNOptimalCollector to find the number of crystals to be summed to get the...