11 """Plot the crate time jumps"""
13 from prompt
import CalibrationSettings
14 from reconstruction
import prepare_cdst_analysis
15 from caf.utils
import IoV
30 settings = CalibrationSettings(name=
"ECL crystal time calibrations",
31 expert_username=
"ehill",
33 input_data_formats=[
"cdst",
"mdst"],
34 input_data_names=[
"bhabha_all_calib"],
35 input_data_filters={
"bhabha_all_calib": [
"bhabha_all_calib"]},
52 def get_calibrations(input_data, **kwargs):
55 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
56 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
57 assigning to calibration.files_to_iov
59 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
60 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
61 release explicitly if you want to.
63 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
64 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
67 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
75 file_to_iov_physics = input_data[
"bhabha_all_calib"]
81 max_events_per_run = 1
89 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
90 input_files_physics = list(reduced_file_to_iov_physics.keys())
94 from basf2
import register_module, create_path
96 from ROOT
import Belle2
97 from ROOT.Belle2
import TestCalibrationAlgorithm
98 from caf.framework
import Collection
104 root_input = register_module(
'RootInput', entrySequences=[
'0:{}'.format(1)])
106 rec_path_bhabha = create_path()
107 rec_path_bhabha.add_module(root_input)
108 if 'Gearbox' not in rec_path_bhabha:
109 rec_path_bhabha.add_module(
'Gearbox')
110 if 'Geometry' not in rec_path_bhabha:
111 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
113 prepare_cdst_analysis(rec_path_bhabha)
115 col_bhabha = register_module(
'eclTimeShiftsPlottingCollector')
118 input_files=input_files_physics,
119 pre_collector_path=rec_path_bhabha,
126 from caf.framework
import Calibration
129 tShifts_alg.debugFilenameBase =
"eclTimeShiftsAlgorithm"
145 tShifts_alg.crysCrateShift_min = -30
146 tShifts_alg.crysCrateShift_max = 30
155 cal_ecl_timeShifts =
Calibration(name=
"ecl_t_shifts", algorithms=[tShifts_alg],
156 input_files=input_files_physics)
157 cal_ecl_timeShifts.add_collection(name=
"bhabha", collection=eclTCol)
158 cal_ecl_timeShifts.save_payloads =
False
162 return [cal_ecl_timeShifts]
Calibrate ecl crystals using previously created payloads.