15from caf.framework
import Calibration
16from prompt
import CalibrationSettings
17from caf
import strategies
18from caf.utils
import IoV
22b2.set_log_level(b2.LogLevel.INFO)
24now = datetime.datetime.now()
26settings = CalibrationSettings(name=
"SVD3SampleCoGTimeCalibrationPrompt",
27 expert_username=
"gdujany",
29 input_data_formats=[
"cdst"],
30 input_data_names=[
"hlt_hadron"],
37def get_calibrations(input_data, **kwargs):
39 from ROOT
import Belle2
40 from ROOT.Belle2
import SVD3SampleCoGTimeCalibrationAlgorithm
43 path = b2.create_path()
45 path.add_module(
"Gearbox")
46 path.add_module(
"Geometry", useDB=
True)
54 for moda
in path.modules():
55 if moda.name() ==
'SVDCoGTimeEstimator':
56 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
57 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
58 moda.param(
"CalibrationWithEventT0",
False)
59 if moda.name() ==
'SVDSimpleClusterizer':
60 moda.param(
"Clusters",
'SVDClustersFromTracks')
61 moda.param(
"RecoDigits",
'SVDRecoDigitsFromTracks')
62 moda.param(
"ShaperDigits",
'SVDShaperDigitsFromTracks')
63 moda.param(
"timeAlgorithm", 1)
64 if moda.name() ==
'SVDSpacePointCreator':
65 moda.param(
"SVDClusters",
'SVDClustersFromTracks')
67 path = b2.remove_module(path,
'SVDMissingAPVsClusterCreator')
69 file_to_iov_physics = input_data[
"hlt_hadron"]
76 reduced_file_to_iov_physics = filter_by_max_files_per_run(file_to_iov_physics, max_files_per_run, min_events_per_file=1)
78 good_input_files = list(reduced_file_to_iov_physics.keys())
79 b2.B2INFO(f
"Total number of files actually used as input = {len(good_input_files)}")
81 exps = [i.exp_low
for i
in reduced_file_to_iov_physics.values()]
82 runs = sorted([i.run_low
for i
in reduced_file_to_iov_physics.values()])
88 if not len(good_input_files):
89 print(
"No good input files found! Check that the input files have entries != 0!")
92 uniqueID =
"SVD3SampleCoGTimeCalibrations_Test_" + str(now.isoformat()) +
"_INFO:_3rdOrderPol_TBindep_Exp" + \
93 str(expNum) +
"_runsFrom" + str(firstRun) +
"to" + str(lastRun)
100 requested_iov = kwargs.get(
"requested_iov",
None)
101 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
104 collector = b2.register_module(
'SVDTimeCalibrationCollector')
105 collector.param(
"SVDClustersFromTracksName",
"SVDClustersFromTracks")
106 collector.param(
"SVDEventInfoName",
"SVDEventInfo")
107 collector.param(
"EventT0Name",
"EventT0")
108 collector.param(
"granularity",
"run")
111 algorithm = SVD3SampleCoGTimeCalibrationAlgorithm(uniqueID)
112 algorithm.setMinEntries(10000)
117 algorithms=algorithm,
118 input_files=good_input_files,
119 pre_collector_path=path,
125 calibration.strategies = strategies.SequentialBoundaries
127 for algorithm
in calibration.algorithms:
128 algorithm.params = {
"iov_coverage": output_iov}
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)
def add_svd_unpacker(path)