11"""ECL Autocovariance."""
13from prompt
import CalibrationSettings, INPUT_DATA_FILTERS
14from caf
import strategies
18settings = CalibrationSettings(
19 name=
"ecl_autocovariance",
20 expert_username=
"longos",
22 input_data_formats=[
"raw"],
23 input_data_names=[
"delayedbhabha_calib"],
25 "delayedbhabha_calib": [
26 INPUT_DATA_FILTERS[
"Data Tag"][
"delayedbhabha_calib"],
27 INPUT_DATA_FILTERS[
"Data Quality Tag"][
"Good Or Recoverable"],
28 INPUT_DATA_FILTERS[
"Run Type"][
"physics"],
29 INPUT_DATA_FILTERS[
"Magnet"][
"On"]]},
32 "C1_lowestEnergyFraction": 0.75,
33 "C1_TotalCountsThreshold": 10000
41def 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_delayed_Bhabha = input_data[
"delayedbhabha_calib"]
52 input_files = list(file_to_iov_delayed_Bhabha.keys())
56 expert_config = kwargs.get(
"expert_config")
57 algo_C1.setLowestEnergyFraction(expert_config[
"C1_lowestEnergyFraction"])
58 algo_C1.setTotalCountsThreshold(expert_config[
"C1_TotalCountsThreshold"])
61 collector_C1 = basf2.register_module(
"eclAutocovarianceCalibrationC1Collector")
64 collector=collector_C1,
66 input_files=input_files, max_files_per_collector_job=4)
67 cal_ecl_Auto_C1.strategies = strategies.SequentialRunByRun
70 delayed_Bhabha_pre_path = basf2.create_path()
71 delayed_Bhabha_pre_path.add_module(
"RootInput", branchNames=[
"EventMetaData",
"RawECLs"])
72 delayed_Bhabha_pre_path.add_module(
'ECLUnpacker')
74 cal_ecl_Auto_C1.pre_collector_path = delayed_Bhabha_pre_path
80 collector_C3 = basf2.register_module(
"eclAutocovarianceCalibrationC3Collector")
83 collector=collector_C3,
85 input_files=input_files, max_files_per_collector_job=4)
86 cal_ecl_Auto_C3.strategies = strategies.SequentialRunByRun
88 cal_ecl_Auto_C3.pre_collector_path = delayed_Bhabha_pre_path
90 cal_ecl_Auto_C3.depends_on(cal_ecl_Auto_C1)
96 collector_C4 = basf2.register_module(
"eclAutocovarianceCalibrationC4Collector")
99 collector=collector_C4,
100 algorithms=[algo_C4],
101 input_files=input_files, max_files_per_collector_job=4)
102 cal_ecl_Auto_C4.strategies = strategies.SequentialRunByRun
104 cal_ecl_Auto_C4.pre_collector_path = delayed_Bhabha_pre_path
106 cal_ecl_Auto_C4.depends_on(cal_ecl_Auto_C3)
110 requested_iov = kwargs.get(
"requested_iov",
None)
111 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
112 for algorithm
in cal_ecl_Auto_C1.algorithms:
113 algorithm.params = {
"apply_iov": output_iov}
114 for algorithm
in cal_ecl_Auto_C3.algorithms:
115 algorithm.params = {
"apply_iov": output_iov}
116 for algorithm
in cal_ecl_Auto_C4.algorithms:
117 algorithm.params = {
"apply_iov": output_iov}
121 return [cal_ecl_Auto_C1, cal_ecl_Auto_C3, cal_ecl_Auto_C4]
Calibrate covariance matrix for crystals using delayed Bhabha events.
Calibrate covariance matrix for crystals using delayed Bhabha events.
Calibrate covariance matrix for crystals using delayed Bhabha events.