9 """Find expected energies for ee5x5 single crystal energy calibration.
10 Requires Bhabha mc in mdst format, plus ECLCalDigits"""
24 from prompt
import CalibrationSettings
28 settings = CalibrationSettings(
29 name=
"ecl_ee_expected",
30 expert_username=
"hearty",
32 input_data_formats=[
"mdst"],
33 input_data_names=[
"bhabha_mc"],
35 expert_config={
"ee5x5_min_entries": 100})
41 def get_calibrations(input_data, **kwargs):
43 from ROOT
import Belle2
44 from caf.utils
import IoV
45 from caf.framework
import Calibration
51 file_to_iov_bhabha = input_data[
"bhabha_mc"]
52 input_files_bhabha = list(file_to_iov_bhabha.keys())
56 expert_config = kwargs.get(
"expert_config")
57 ee5x5minEntries = expert_config[
"ee5x5_min_entries"]
58 algo_ee5x5.setMinEntries(ee5x5minEntries)
59 algo_ee5x5.setPayloadName(
"ECLExpee5x5E")
60 algo_ee5x5.setStoreConst(
True)
63 eclee5x5_collector = basf2.register_module(
"eclee5x5Collector")
64 eclee5x5_collector.param(
"thetaLabMinDeg", 17.)
65 eclee5x5_collector.param(
"thetaLabMaxDeg", 150.)
66 eclee5x5_collector.param(
"minE0", 0.45)
67 eclee5x5_collector.param(
"minE1", 0.40)
68 eclee5x5_collector.param(
"maxdThetaSum", 2.)
69 eclee5x5_collector.param(
"dPhiScale", 1.)
70 eclee5x5_collector.param(
"maxTime", 10.)
71 eclee5x5_collector.param(
"useCalDigits",
True)
72 eclee5x5_collector.param(
"requireL1",
False)
73 eclee5x5_collector.param(
"granularity",
"all")
75 collector=eclee5x5_collector,
76 algorithms=[algo_ee5x5],
77 input_files=input_files_bhabha
79 cal_ecl_ee5x5.backend_args = {
"request_memory":
"4 GB"}
82 ee5x5_pre_path = basf2.create_path()
83 cal_ecl_ee5x5.pre_collector_path = ee5x5_pre_path
87 requested_iov = kwargs.get(
"requested_iov",
None)
88 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
89 for algorithm
in cal_ecl_ee5x5.algorithms:
90 algorithm.params = {
"apply_iov": output_iov}
94 return [cal_ecl_ee5x5]
Calibrate ecl crystals using Bhabha events.