11 """ECL timing validations. Does both the bhabha self-consistency check and the hadronic event selection validation."""
13 from prompt
import CalibrationSettings
14 from reconstruction
import prepare_user_cdst_analysis
28 settings = CalibrationSettings(
29 name=
"ECL time validations - bhabha and hadronic selections",
30 expert_username=
"ehill",
32 input_data_formats=[
"cdst"],
33 input_data_names=[
"bhabha_all_calib",
"hadron_calib"],
66 def get_calibrations(input_data, **kwargs):
69 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
70 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
71 assigning to calibration.files_to_iov
73 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
74 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
75 release explicitly if you want to.
77 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
78 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
81 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
89 file_to_iov_bhabha = input_data[
"bhabha_all_calib"]
90 file_to_iov_hadron = input_data[
"hadron_calib"]
92 max_events_per_run = 3000
99 reduced_file_to_iov_bhabha = filter_by_max_events_per_run(file_to_iov_bhabha, max_events_per_run)
100 input_files_bhabha = list(reduced_file_to_iov_bhabha.keys())
101 basf2.B2INFO(f
"Total number of bhabha files actually used as input = {len(input_files_bhabha)}")
103 reduced_file_to_iov_hadron = filter_by_max_events_per_run(file_to_iov_hadron, max_events_per_run)
104 input_files_hadron = list(reduced_file_to_iov_hadron.keys())
105 basf2.B2INFO(f
"Total number of hadron files actually used as input = {len(input_files_hadron)}")
108 from basf2
import register_module, create_path
109 from ROOT
import Belle2
110 from caf.framework
import Collection
114 root_input = register_module(
'RootInput')
115 rec_path_bhabha = create_path()
116 rec_path_bhabha.add_module(root_input)
117 if 'Gearbox' not in rec_path_bhabha:
118 rec_path_bhabha.add_module(
'Gearbox')
119 if 'Geometry' not in rec_path_bhabha:
120 rec_path_bhabha.add_module(
'Geometry', useDB=
True)
122 prepare_user_cdst_analysis(rec_path_bhabha)
124 col_bhabha = register_module(
'eclBhabhaTimeCalibrationValidationCollector')
125 col_bhabha.param(
'timeAbsMax', 70)
126 col_bhabha.param(
'saveTree',
False)
129 input_files=input_files_bhabha,
130 pre_collector_path=rec_path_bhabha)
142 eclValTAlgBhabha.meanCleanRebinFactor = 3
143 eclValTAlgBhabha.meanCleanCutMinFactor = 0.4
144 eclValTAlgBhabha.debugFilenameBase =
"eclBhabhaTValidationAlgorithm"
149 from caf.framework
import Calibration
151 valid_cal_bhabha =
Calibration(
"ECLcrystalTimeCalValidation_bhabhaPhysics")
152 valid_cal_bhabha.add_collection(name=
"bhabha", collection=eclValTCol)
153 valid_cal_bhabha.algorithms = [eclValTAlgBhabha]
156 from caf.strategies
import SingleIOV
162 valid_cal_bhabha.strategies = SingleIOV
166 root_input = register_module(
'RootInput')
167 rec_path_hadron = create_path()
168 rec_path_hadron.add_module(root_input)
169 if 'Gearbox' not in rec_path_hadron:
170 rec_path_hadron.add_module(
'Gearbox')
171 if 'Geometry' not in rec_path_hadron:
172 rec_path_hadron.add_module(
'Geometry', useDB=
True)
174 prepare_user_cdst_analysis(rec_path_hadron)
176 col_hadron = register_module(
'eclHadronTimeCalibrationValidationCollector')
177 col_hadron.param(
'timeAbsMax', 70)
178 col_hadron.param(
'saveTree',
False)
181 input_files=input_files_hadron,
182 pre_collector_path=rec_path_hadron)
194 eclValTAlgHadronic.meanCleanRebinFactor = 3
195 eclValTAlgHadronic.meanCleanCutMinFactor = 0.4
196 eclValTAlgHadronic.debugFilenameBase =
"eclHadronTValidationAlgorithm"
201 from caf.framework
import Calibration
203 valid_cal_hadron =
Calibration(
"ECLcrystalTimeCalValidation_hadronPhysics")
204 valid_cal_hadron.add_collection(name=
"hadron", collection=eclValTCol)
205 valid_cal_hadron.algorithms = [eclValTAlgHadronic]
208 from caf.strategies
import SingleIOV
214 valid_cal_hadron.strategies = SingleIOV
220 return [valid_cal_bhabha, valid_cal_hadron]
Validate the ecl timing calibrations using a hadronic event selection.