11 """Plot the crate time jumps"""
13 from prompt
import CalibrationSettings
14 from reconstruction
import prepare_cdst_analysis
28 settings = CalibrationSettings(name=
"ECL crystal time calibrations",
29 expert_username=
"ehill",
31 input_data_formats=[
"cdst",
"mdst"],
32 input_data_names=[
"bhabha_all_calib"],
33 input_data_filters={
"bhabha_all_calib": [
"bhabha_all_calib"]},
50 def get_calibrations(input_data, **kwargs):
53 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
54 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
55 assigning to calibration.files_to_iov
57 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
58 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
59 release explicitly if you want to.
61 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
62 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
65 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
72 file_to_iov_physics = input_data[
"bhabha_all_calib"]
78 max_events_per_run = 1
86 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
87 input_files_physics = list(reduced_file_to_iov_physics.keys())
90 from basf2
import register_module, create_path
91 from ROOT
import Belle2
92 from caf.framework
import Collection
98 root_input = register_module(
'RootInput', entrySequences=[
'0:{}'.format(1)])
100 rec_path_bhabha = create_path()
101 rec_path_bhabha.add_module(root_input)
102 if 'Gearbox' not in rec_path_bhabha:
103 rec_path_bhabha.add_module(
'Gearbox')
104 if 'Geometry' not in rec_path_bhabha:
105 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
107 prepare_cdst_analysis(rec_path_bhabha)
109 col_bhabha = register_module(
'eclTimeShiftsPlottingCollector')
112 input_files=input_files_physics,
113 pre_collector_path=rec_path_bhabha,
120 from caf.framework
import Calibration
123 tShifts_alg.debugFilenameBase =
"eclTimeShiftsAlgorithm"
139 tShifts_alg.crysCrateShift_min = -30
140 tShifts_alg.crysCrateShift_max = 30
149 cal_ecl_timeShifts =
Calibration(name=
"ecl_t_shifts", algorithms=[tShifts_alg],
150 input_files=input_files_physics)
151 cal_ecl_timeShifts.add_collection(name=
"bhabha", collection=eclTCol)
152 cal_ecl_timeShifts.save_payloads =
False
156 return [cal_ecl_timeShifts]
Calibrate ecl crystals using previously created payloads.