12 Calibration of KLM strip efficiency. It provides calibration constants for the KLMSripEfficiency
17 from prompt
import CalibrationSettings, INPUT_DATA_FILTERS
28 settings = CalibrationSettings(
29 name=
'KLM strip efficiency',
30 expert_username=
'depietro',
32 input_data_formats=[
'cdst'],
33 input_data_names=[
'hlt_mumu'],
35 'hlt_mumu': [INPUT_DATA_FILTERS[
'Run Type'][
'physics'],
36 INPUT_DATA_FILTERS[
'Data Tag'][
'mumu_tight_or_highm_calib'],
37 INPUT_DATA_FILTERS[
'Data Quality Tag'][
'Good Or Recoverable']]
54 def get_calibrations(input_data, **kwargs):
57 input_data (dict): Should contain every name from the 'input_data_names' variable as a key.
58 Each value is a dictionary with {"/path/to/file_e1_r5.root": IoV(1,5,1,5), ...}. Useful for
59 assigning to calibration.files_to_iov
61 **kwargs: Configuration options to be sent in. Since this may change we use kwargs as a way to help prevent
62 backwards compatibility problems. But you could use the correct arguments in b2caf-prompt-run for this
63 release explicitly if you want to.
65 Currently only kwargs["requested_iov"] is used. This is the output IoV range that your payloads should
66 correspond to. Generally your highest ExpRun payload should be open ended e.g. IoV(3,4,-1,-1)
69 list(caf.framework.Calibration): All of the calibration objects we want to assign to the CAF process
75 file_to_iov_cdst = input_data[
'hlt_mumu']
93 input_files_cdst = sorted(list(file_to_iov_cdst.keys()))
94 basf2.B2INFO(f
'Total number of \'hlt_mumu\' files actually used as input = {len(input_files_cdst)}')
96 if not input_files_cdst:
97 raise Exception(
'No valid input files found!')
101 requested_iov = kwargs[
'requested_iov']
103 from caf.utils
import IoV
105 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
110 from ROOT.Belle2
import KLMStripEfficiencyAlgorithm
112 alg = KLMStripEfficiencyAlgorithm()
117 from caf.framework
import Calibration, Collection
124 from klm_calibration_utils
import get_strip_efficiency_pre_collector_path
127 muon_list_name =
'klmStripEfficiency'
128 coll_cdst = get_collector(input_data_name=
'hlt_mumu',
129 muon_list_name=muon_list_name)
130 rec_path_cdst = get_strip_efficiency_pre_collector_path(muon_list_name=muon_list_name)
132 collection_cdst =
Collection(collector=coll_cdst,
133 input_files=input_files_cdst,
134 pre_collector_path=rec_path_cdst)
136 cal_klm.add_collection(name=
'cdst', collection=collection_cdst)
141 cal_klm.algorithms = [alg]
143 from klm_strip_efficiency
import KLMStripEfficiency
145 for algorithm
in cal_klm.algorithms:
146 algorithm.strategy = KLMStripEfficiency
147 algorithm.params = {
'iov_coverage': output_iov}
155 def get_collector(input_data_name, muon_list_name):
157 Return the correct KLMStripEfficiencyCollector module setup for each data type.
158 Placed here so it can be different for prompt compared to standard.
161 if input_data_name ==
'hlt_mumu':
162 return basf2.register_module(
'KLMStripEfficiencyCollector',
163 MuonListName=f
'mu+:{muon_list_name}',
164 MinimalMatchingDigits=14,
165 MinimalMatchingDigitsOuterLayers=4,
166 MinimalMomentumNoOuterLayers=4.0)
167 raise Exception(
"Unknown input data name used when setting up collector")