14from caf.framework
import Calibration
15from prompt
import CalibrationSettings
16from caf
import strategies
17from caf.utils
import IoV
21b2.set_log_level(b2.LogLevel.INFO)
23now = datetime.datetime.now()
25settings = CalibrationSettings(name=
"SVD3SampleELSTimeCalibrationPrompt",
26 expert_username=
"gdujany",
28 input_data_formats=[
"cdst"],
29 input_data_names=[
"hlt_hadron"],
35def get_calibrations(input_data, **kwargs):
37 from ROOT
import Belle2
38 from ROOT.Belle2
import SVD3SampleELSTimeCalibrationAlgorithm
41 path = b2.create_path()
43 path.add_module(
"Gearbox")
44 path.add_module(
"Geometry", useDB=
True)
52 for moda
in path.modules():
53 if moda.name() ==
'SVDCoGTimeEstimator':
54 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
55 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
56 moda.param(
"CalibrationWithEventT0",
False)
57 if moda.name() ==
'SVDSimpleClusterizer':
58 moda.param(
"Clusters",
'SVDClustersFromTracks')
59 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
60 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
61 moda.param(
"timeAlgorithm", 2)
62 if moda.name() ==
'SVDSpacePointCreator':
63 moda.param(
"SVDClusters",
'SVDClustersFromTracks')
65 path = b2.remove_module(path,
'SVDMissingAPVsClusterCreator')
67 file_to_iov_physics = input_data[
"hlt_hadron"]
74 reduced_file_to_iov_physics = filter_by_max_files_per_run(file_to_iov_physics, max_files_per_run, min_events_per_file=1)
76 good_input_files = list(reduced_file_to_iov_physics.keys())
77 b2.B2INFO(f
"Total number of files actually used as input = {len(good_input_files)}")
79 exps = [i.exp_low
for i
in reduced_file_to_iov_physics.values()]
80 runs = sorted([i.run_low
for i
in reduced_file_to_iov_physics.values()])
86 if not len(good_input_files):
87 print(
"No good input files found! Check that the input files have entries != 0!")
90 uniqueID =
"SVD3SampleELSTimeCalibrations_Test_" + str(now.isoformat()) +
"_INFO:_1stOrderPolAndInv_TBindep_Exp" + \
91 str(expNum) +
"_runsFrom" + str(firstRun) +
"to" + str(lastRun)
98 requested_iov = kwargs.get(
"requested_iov",
None)
99 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
102 collector = b2.register_module(
'SVDTimeCalibrationCollector')
103 collector.param(
"SVDClustersFromTracksName",
"SVDClustersFromTracks")
104 collector.param(
"SVDEventInfoName",
"SVDEventInfo")
105 collector.param(
"EventT0Name",
"EventT0")
106 collector.param(
"granularity",
"run")
109 algorithm = SVD3SampleELSTimeCalibrationAlgorithm(uniqueID)
110 algorithm.setMinEntries(10000)
115 algorithms=algorithm,
116 input_files=good_input_files,
117 pre_collector_path=path,
123 calibration.strategies = strategies.SequentialBoundaries
125 for algorithm
in calibration.algorithms:
126 algorithm.params = {
"iov_coverage": output_iov}
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)
def add_svd_unpacker(path)