9"""ECL timing calibration that performs the crate calibrations, one for each physics run."""
11from prompt
import CalibrationSettings
12from reconstruction
import prepare_cdst_analysis
24settings = CalibrationSettings(
25 name=
"ECL crate time calibrations",
26 expert_username=
"ehill",
28 input_data_formats=[
"cdst"],
29 input_data_names=[
"bhabha_combined_calib"],
58def get_calibrations(input_data, **kwargs):
61 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
62 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
63 assigning to calibration.files_to_iov
65 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
66 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
67 release explicitly if you want to.
69 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
70 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
73 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
81 file_to_iov_physics = input_data[
"bhabha_combined_calib"]
86 max_files_per_run = 26
93 reduced_file_to_iov_physics = filter_by_max_files_per_run(
94 file_to_iov_physics, max_files_per_run
96 input_files_physics = list(reduced_file_to_iov_physics.keys())
98 f
"Total number of files actually used as input = {len(input_files_physics)}"
102 from basf2
import register_module, create_path
103 from ROOT
import Belle2
104 from caf.framework
import Collection
108 root_input = register_module(
"RootInput")
109 rec_path_bhabha = create_path()
110 rec_path_bhabha.add_module(root_input)
111 if "Gearbox" not in rec_path_bhabha:
112 rec_path_bhabha.add_module(
"Gearbox")
113 if "Geometry" not in rec_path_bhabha:
114 rec_path_bhabha.add_module(
"Geometry", useDB=
True)
116 prepare_cdst_analysis(rec_path_bhabha)
119 t0BiasCorrection = -0.9
122 col_bhabha = register_module(
"ECLBhabhaTCollector")
123 col_bhabha.param(
"timeAbsMax", 250)
124 col_bhabha.param(
"minCrystal", 1)
125 col_bhabha.param(
"maxCrystal", 8736)
126 col_bhabha.param(
"saveTree",
False)
127 col_bhabha.param(
"hadronEventT0_TO_bhabhaEventT0_correction", t0BiasCorrection)
130 collector=col_bhabha,
131 input_files=input_files_physics,
132 pre_collector_path=rec_path_bhabha,
145 eclTAlg.debugOutput =
True
146 eclTAlg.meanCleanRebinFactor = 3
147 eclTAlg.meanCleanCutMinFactor = 0.3
148 eclTAlg.debugFilenameBase =
"eclBhabhaTAlgorithm"
153 from caf.framework
import Calibration
155 cal_test = Calibration(
"ECLcrateTimeCalibration_physics")
156 cal_test.add_collection(name=
"bhabha", collection=eclTCol)
157 cal_test.algorithms = [eclTAlg]
160 from caf.strategies
import SimpleRunByRun
168 cal_test.strategies = SimpleRunByRun
Calibrate ecl crystals using bhabha events.