Belle II Software  release-05-02-19
caf_ecl_edge.py
1 # -*- coding: utf-8 -*-
2 
3 """ECL calibration to specify edges of each crystal."""
4 
5 from prompt import CalibrationSettings, input_data_filters
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=["cdst"],
13  input_data_names=["mumutight_calib"],
14  input_data_filters={"mumutight_calib": [input_data_filters["Data Tag"]["mumutight_calib"],
15  input_data_filters["Data Quality Tag"]["Good"]]},
16  depends_on=[])
17 
18 # --------------------------------------------------------------
19 # ..The calibration functions
20 
21 
22 def get_calibrations(input_data, **kwargs):
23  import basf2
24  from ROOT import Belle2
25  from caf.utils import IoV
26  from caf.framework import Calibration
27 
28  # --------------------------------------------------------------
29  # ..Input data
30  file_to_iov_mu_mu = input_data["mumutight_calib"]
31  input_files_mu_mu = list(file_to_iov_mu_mu.keys())
32 
33  # ..Algorithm
34  algo_edge = Belle2.ECL.eclEdgeAlgorithm()
35 
36  # ..The calibration
37  ecledge_collector = basf2.register_module("eclEdgeCollector")
38  cal_ecl_edge = Calibration(name="ecl_edge", collector=ecledge_collector, algorithms=algo_edge,
39  input_files=input_files_mu_mu[:1], max_collector_jobs=1)
40 
41  # ..pre_path to include geometry
42  ecl_edge_pre_path = basf2.create_path()
43  ecl_edge_pre_path.add_module("Gearbox")
44  ecl_edge_pre_path.add_module("Geometry")
45  cal_ecl_edge.pre_collector_path = ecl_edge_pre_path
46 
47  # --------------------------------------------------------------
48  # ..Force the output iovs to be open
49  requested_iov = kwargs.get("requested_iov", None)
50  output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
51  for algorithm in cal_ecl_edge.algorithms:
52  algorithm.params = {"apply_iov": output_iov}
53 
54  # --------------------------------------------------------------
55  # ..Return the calibrations
56  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