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