3 """ECL timing calibration that performs the crate calibrations, one for each physics run."""
5 from prompt
import CalibrationSettings
6 from reconstruction
import prepare_cdst_analysis
19 settings = CalibrationSettings(name=
"ECL crate time calibrations",
20 expert_username=
"ehill",
22 input_data_formats=[
"cdst"],
23 input_data_names=[
"hlt_bhabha"],
39 def get_calibrations(input_data, **kwargs):
42 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
43 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
44 assigning to calibration.files_to_iov
46 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
47 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
48 release explicitly if you want to.
50 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
51 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
54 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
62 file_to_iov_physics = input_data[
"hlt_bhabha"]
67 max_files_per_run = 26
74 reduced_file_to_iov_physics = filter_by_max_files_per_run(file_to_iov_physics, max_files_per_run)
75 input_files_physics = list(reduced_file_to_iov_physics.keys())
76 basf2.B2INFO(f
"Total number of files actually used as input = {len(input_files_physics)}")
80 from basf2
import register_module, create_path
81 from ROOT
import Belle2
82 from caf.framework
import Collection
86 root_input = register_module(
'RootInput')
87 rec_path_bhabha = create_path()
88 rec_path_bhabha.add_module(root_input)
89 if 'Gearbox' not in rec_path_bhabha:
90 rec_path_bhabha.add_module(
'Gearbox')
91 if 'Geometry' not in rec_path_bhabha:
92 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
94 prepare_cdst_analysis(rec_path_bhabha)
96 col_bhabha = register_module(
'ECLBhabhaTCollector')
97 col_bhabha.param(
'timeAbsMax', 250)
98 col_bhabha.param(
'minCrystal', 1)
99 col_bhabha.param(
'maxCrystal', 8736)
100 col_bhabha.param(
'saveTree',
False)
103 input_files=input_files_physics,
104 pre_collector_path=rec_path_bhabha,
117 eclTAlg.debugOutput =
True
118 eclTAlg.meanCleanRebinFactor = 3
119 eclTAlg.meanCleanCutMinFactor = 0.3
120 eclTAlg.debugFilenameBase =
"eclBhabhaTAlgorithm"
125 from caf.framework
import Calibration
127 cal_test =
Calibration(
"ECLcrateTimeCalibration_physics")
128 cal_test.add_collection(name=
"bhabha", collection=eclTCol)
129 cal_test.algorithms = [eclTAlg]
132 from caf.strategies
import SimpleRunByRun
140 cal_test.strategies = SimpleRunByRun