9"""ECL timing self-consistency check (not orthogonal events so not a great validation) with an bhabha event selection."""
11from prompt
import CalibrationSettings
12from reconstruction
import prepare_user_cdst_analysis
26settings = CalibrationSettings(
27 name=
"ECL time validations - bhabha",
28 expert_username=
"ehill",
30 input_data_formats=[
"cdst"],
31 input_data_names=[
"bhabha_all_calib"],
56def get_calibrations(input_data, **kwargs):
59 input_data (dict): Should contain every name from the
'input_data_names' variable
as a key.
60 Each value
is a dictionary
with {
"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful
for
61 assigning to calibration.files_to_iov
63 **kwargs: Configuration options to be sent
in. Since this may change we use kwargs
as a way to help prevent
64 backwards compatibility problems. But you could use the correct arguments
in b2caf-prompt-run
for this
65 release explicitly
if you want to.
67 Currently only kwargs[
"output_iov"]
is used. This
is the output IoV range that your payloads should
68 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
71 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
79 file_to_iov_physics = input_data[
"bhabha_all_calib"]
81 max_events_per_run = 3000
88 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
89 input_files_physics = list(reduced_file_to_iov_physics.keys())
90 basf2.B2INFO(f
"Total number of files actually used as input = {len(input_files_physics)}")
93 from basf2
import register_module, create_path
94 from ROOT
import Belle2
95 from caf.framework
import Collection
99 root_input = register_module(
'RootInput')
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_user_cdst_analysis(rec_path_bhabha)
109 col_bhabha = register_module(
'eclBhabhaTimeCalibrationValidationCollector')
110 col_bhabha.param(
'timeAbsMax', 70)
111 col_bhabha.param(
'saveTree',
False)
114 input_files=input_files_physics,
115 pre_collector_path=rec_path_bhabha)
127 eclValTAlgBhabha.meanCleanRebinFactor = 3
128 eclValTAlgBhabha.meanCleanCutMinFactor = 0.4
129 eclValTAlgBhabha.debugFilenameBase =
"eclBhabhaTValidationAlgorithm"
134 from caf.framework
import Calibration
136 valid_cal_bhabha =
Calibration(
"ECLcrystalTimeCalValidation_bhabhaPhysics")
137 valid_cal_bhabha.add_collection(name=
"bhabha", collection=eclValTCol)
138 valid_cal_bhabha.algorithms = [eclValTAlgBhabha]
141 from caf.strategies
import SingleIOV
147 valid_cal_bhabha.strategies = SingleIOV
153 return [valid_cal_bhabha]
Validate the ecl timing calibrations using a hadronic event selection.