9"""Plot the crate time jumps"""
11from prompt
import CalibrationSettings
12from reconstruction
import prepare_cdst_analysis
26settings = CalibrationSettings(name=
"ECL crystal time calibrations",
27 expert_username=
"ehill",
29 input_data_formats=[
"cdst",
"mdst"],
30 input_data_names=[
"bhabha_all_calib"],
31 input_data_filters={
"bhabha_all_calib": [
"bhabha_all_calib"]},
48def get_calibrations(input_data, **kwargs):
51 input_data (dict): Should contain every name from the
'input_data_names' variable
as a key.
52 Each value
is a dictionary
with {
"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful
for
53 assigning to calibration.files_to_iov
55 **kwargs: Configuration options to be sent
in. Since this may change we use kwargs
as a way to help prevent
56 backwards compatibility problems. But you could use the correct arguments
in b2caf-prompt-run
for this
57 release explicitly
if you want to.
59 Currently only kwargs[
"output_iov"]
is used. This
is the output IoV range that your payloads should
60 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
63 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
70 file_to_iov_physics = input_data[
"bhabha_all_calib"]
76 max_events_per_run = 1
84 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
85 input_files_physics = list(reduced_file_to_iov_physics.keys())
88 from basf2
import register_module, create_path
89 from ROOT
import Belle2
90 from caf.framework
import Collection
96 root_input = register_module(
'RootInput', entrySequences=[f
'0:{1}'])
98 rec_path_bhabha = create_path()
99 rec_path_bhabha.add_module(root_input)
100 if 'Gearbox' not in rec_path_bhabha:
101 rec_path_bhabha.add_module(
'Gearbox')
102 if 'Geometry' not in rec_path_bhabha:
103 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
105 prepare_cdst_analysis(rec_path_bhabha)
107 col_bhabha = register_module(
'eclTimeShiftsPlottingCollector')
110 input_files=input_files_physics,
111 pre_collector_path=rec_path_bhabha,
118 from caf.framework
import Calibration
121 tShifts_alg.debugFilenameBase =
"eclTimeShiftsAlgorithm"
137 tShifts_alg.crysCrateShift_min = -30
138 tShifts_alg.crysCrateShift_max = 30
147 cal_ecl_timeShifts =
Calibration(name=
"ecl_t_shifts", algorithms=[tShifts_alg],
148 input_files=input_files_physics)
149 cal_ecl_timeShifts.add_collection(name=
"bhabha", collection=eclTCol)
150 cal_ecl_timeShifts.save_payloads =
False
154 return [cal_ecl_timeShifts]
Calibrate ecl crystals using previously created payloads.