Belle II Software  release-05-01-25
caf_ecl_edge.py
1 # -*- coding: utf-8 -*-
2 
3 """ECL calibration to specify edges of each crystal."""
4 
5 from prompt import CalibrationSettings
6 
7 # --------------------------------------------------------------
8 # ..Tell the automated script some required details
9 settings = CalibrationSettings(name="ecl_edge",
10  expert_username="hearty",
11  description=__doc__,
12  input_data_formats=["mdst"],
13  input_data_names=["hlt_mumu_2trk"],
14  depends_on=[])
15 
16 # --------------------------------------------------------------
17 # ..The calibration functions
18 
19 
20 def get_calibrations(input_data, **kwargs):
21  import basf2
22  from ROOT import Belle2
23  from caf.utils import IoV
24  from caf.framework import Calibration
25 
26  # --------------------------------------------------------------
27  # ..Input data
28  file_to_iov_mu_mu = input_data["hlt_mumu_2trk"]
29  input_files_mu_mu = list(file_to_iov_mu_mu.keys())
30 
31  # ..Algorithm
32  algo_edge = Belle2.ECL.eclEdgeAlgorithm()
33 
34  # ..The calibration
35  ecledge_collector = basf2.register_module("eclEdgeCollector")
36  cal_ecl_edge = Calibration(name="ecl_edge", collector=ecledge_collector, algorithms=algo_edge, input_files=input_files_mu_mu)
37 
38  # ..pre_path to include geometry
39  ecl_edge_pre_path = basf2.create_path()
40  ecl_edge_pre_path.add_module("Gearbox")
41  ecl_edge_pre_path.add_module("Geometry")
42  cal_ecl_edge.pre_collector_path = ecl_edge_pre_path
43 
44  # --------------------------------------------------------------
45  # ..Force the output iovs to be open
46  requested_iov = kwargs.get("requested_iov", None)
47  output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
48  for algorithm in cal_ecl_edge.algorithms:
49  algorithm.params = {"apply_iov": output_iov}
50 
51  # --------------------------------------------------------------
52  # ..Return the calibrations
53  return [cal_ecl_edge]
Belle2::ECL::eclEdgeAlgorithm
..Obtain payloads specifying the location of the edges of each ECL crystal
Definition: eclEdgeAlgorithm.h:38
Calibration
Definition: Calibration.py:1