18 import multiprocessing
20 from ROOT.Belle2
import SVDOccupancyCalibrationsAlgorithm
22 from caf.framework
import CAF, Calibration, CentralDatabase
23 from caf
import backends
24 from caf
import strategies
29 b2.set_log_level(b2.LogLevel.INFO)
35 b2.set_log_level(b2.LogLevel.INFO)
38 def SVDOccupancyCalibrations(files, tags):
41 path = b2.create_path()
45 path.add_module(
'Progress')
47 path.add_module(
'RootInput', branchNames=input_branches)
49 path.add_module(
"Gearbox")
50 path.add_module(
"Geometry", useDB=
True)
58 raw.add_unpackers(path, components=[
'SVD'])
60 'SVDZeroSuppressionEmulator',
62 ShaperDigits=
'SVDShaperDigits',
63 ShaperDigitsIN=
'SVDShaperDigitsZS5',
66 collector = b2.register_module(
'SVDOccupancyCalibrationsCollector')
68 collector.param(
"SVDShaperDigitsName",
"SVDShaperDigitsZS5")
69 algorithm = SVDOccupancyCalibrationsAlgorithm(
"SVDOccupancyCAF")
75 pre_collector_path=path,
76 database_chain=[CentralDatabase(tag)
for tag
in tags],
78 max_files_per_collector_job=1,
82 calibration.strategies = strategies.SequentialRunByRun
87 if __name__ ==
"__main__":
89 input_files = [os.path.abspath(file)
for file
in [
90 "/group/belle2/dataprod/Data/Raw/e0008/r01309/sub00/physics.0008.01309.HLT5.f00098.root"]]
95 if not len(input_files):
96 print(
"You have to specify some input file(s)\n"
97 "using the standard basf2 command line option - i")
98 print(
"See: basf2 -h")
101 svdOccupCAF = SVDOccupancyCalibrations(input_files,
102 [
'giulia_CDCEDepToADCConversions_rel4_patch',
103 'data_reprocessing_prompt_rel4_patch'])
107 cal_fw.add_calibration(svdOccupCAF)
109 cal_fw.backend = backends.LSF()
112 if multiprocessing.cpu_count() < 10:
113 cal_fw.backend = backends.Local(8)