11 """ECL timing validation with an hadronic event selection."""
13 from prompt
import CalibrationSettings
14 from reconstruction
import prepare_user_cdst_analysis
15 from caf.utils
import IoV
29 settings = CalibrationSettings(
30 name=
"ECL time validations - hadronic",
31 expert_username=
"ehill",
33 input_data_formats=[
"cdst"],
34 input_data_names=[
"hadron_calib"],
59 def get_calibrations(input_data, **kwargs):
62 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
63 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
64 assigning to calibration.files_to_iov
66 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
67 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
68 release explicitly if you want to.
70 Currently only kwargs["output_iov"] is used. This is the output IoV range that your payloads should
71 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
74 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
82 file_to_iov_physics = input_data[
"hadron_calib"]
84 max_events_per_run = 3000
91 reduced_file_to_iov_physics = filter_by_max_events_per_run(file_to_iov_physics, max_events_per_run)
92 input_files_physics = list(reduced_file_to_iov_physics.keys())
93 basf2.B2INFO(f
"Total number of files actually used as input = {len(input_files_physics)}")
97 from basf2
import register_module, create_path
99 from ROOT
import Belle2
100 from ROOT.Belle2
import TestCalibrationAlgorithm
101 from caf.framework
import Collection
105 root_input = register_module(
'RootInput')
106 rec_path_hadron = create_path()
107 rec_path_hadron.add_module(root_input)
108 if 'Gearbox' not in rec_path_hadron:
109 rec_path_hadron.add_module(
'Gearbox')
110 if 'Geometry' not in rec_path_hadron:
111 rec_path_hadron.add_module(
'Geometry', useDB=
True)
113 prepare_user_cdst_analysis(rec_path_hadron)
115 col_hadron = register_module(
'eclHadronTimeCalibrationValidationCollector')
116 col_hadron.param(
'timeAbsMax', 70)
117 col_hadron.param(
'saveTree',
False)
120 input_files=input_files_physics,
121 pre_collector_path=rec_path_hadron)
133 eclValTAlgHadronic.meanCleanRebinFactor = 3
134 eclValTAlgHadronic.meanCleanCutMinFactor = 0.4
135 eclValTAlgHadronic.debugFilenameBase =
"eclHadronTValidationAlgorithm"
140 from caf.framework
import Calibration
142 valid_cal_hadron =
Calibration(
"ECLcrystalTimeCalValidation_hadronPhysics")
143 valid_cal_hadron.add_collection(name=
"hadron", collection=eclValTCol)
144 valid_cal_hadron.algorithms = [eclValTAlgHadronic]
147 from caf.strategies
import SingleIOV
153 valid_cal_hadron.strategies = SingleIOV
159 return [valid_cal_hadron]
Validate the ecl timing calibrations using a hadronic event selection.