11 """ECL timing self-consistency check (not orthogonal events so not a great validation) with an bhabha event selection."""
13 from prompt
import CalibrationSettings
14 from reconstruction
import prepare_user_cdst_analysis
28 settings = CalibrationSettings(
29 name=
"ECL time validations - bhabha",
30 expert_username=
"ehill",
32 input_data_formats=[
"cdst"],
33 input_data_names=[
"bhabha_all_calib"],
58 def 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_all_calib"]
83 max_events_per_run = 3000
90 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
91 input_files_physics = list(reduced_file_to_iov_physics.keys())
92 basf2.B2INFO(f
"Total number of files actually used as input = {len(input_files_physics)}")
95 from basf2
import register_module, create_path
96 from ROOT
import Belle2
97 from caf.framework
import Collection
101 root_input = register_module(
'RootInput')
102 rec_path_bhabha = create_path()
103 rec_path_bhabha.add_module(root_input)
104 if 'Gearbox' not in rec_path_bhabha:
105 rec_path_bhabha.add_module(
'Gearbox')
106 if 'Geometry' not in rec_path_bhabha:
107 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
109 prepare_user_cdst_analysis(rec_path_bhabha)
111 col_bhabha = register_module(
'eclBhabhaTimeCalibrationValidationCollector')
112 col_bhabha.param(
'timeAbsMax', 70)
113 col_bhabha.param(
'saveTree',
False)
116 input_files=input_files_physics,
117 pre_collector_path=rec_path_bhabha)
129 eclValTAlgBhabha.meanCleanRebinFactor = 3
130 eclValTAlgBhabha.meanCleanCutMinFactor = 0.4
131 eclValTAlgBhabha.debugFilenameBase =
"eclBhabhaTValidationAlgorithm"
136 from caf.framework
import Calibration
138 valid_cal_bhabha =
Calibration(
"ECLcrystalTimeCalValidation_bhabhaPhysics")
139 valid_cal_bhabha.add_collection(name=
"bhabha", collection=eclValTCol)
140 valid_cal_bhabha.algorithms = [eclValTAlgBhabha]
143 from caf.strategies
import SingleIOV
149 valid_cal_bhabha.strategies = SingleIOV
155 return [valid_cal_bhabha]
Validate the ecl timing calibrations using a hadronic event selection.