20from caf.framework
import CAF, Calibration, CentralDatabase
21from caf
import backends
22from caf
import strategies
27b2.set_log_level(b2.LogLevel.INFO)
33b2.set_log_level(b2.LogLevel.INFO)
36def SVDOccupancyCalibrations(files, tags):
38 from ROOT
import Belle2
39 from ROOT.Belle2
import SVDOccupancyCalibrationsAlgorithm
42 path = b2.create_path()
46 path.add_module(
'Progress')
48 path.add_module(
'RootInput', branchNames=input_branches)
50 path.add_module(
"Gearbox")
51 path.add_module(
"Geometry", useDB=
True)
59 raw.add_unpackers(path, components=[
'SVD'])
61 'SVDZeroSuppressionEmulator',
63 ShaperDigits=
'SVDShaperDigits',
64 ShaperDigitsIN=
'SVDShaperDigitsZS5',
67 collector = b2.register_module(
'SVDOccupancyCalibrationsCollector')
69 collector.param(
"SVDShaperDigitsName",
"SVDShaperDigitsZS5")
70 algorithm = SVDOccupancyCalibrationsAlgorithm(
"SVDOccupancyCAF")
76 pre_collector_path=path,
77 database_chain=[CentralDatabase(tag)
for tag
in tags],
79 max_files_per_collector_job=1,
83 calibration.strategies = strategies.SequentialRunByRun
88if __name__ ==
"__main__":
90 input_files = [os.path.abspath(file)
for file
in [
91 "/group/belle2/dataprod/Data/Raw/e0008/r01309/sub00/physics.0008.01309.HLT5.f00098.root"]]
96 if not len(input_files):
97 print(
"You have to specify some input file(s)\n"
98 "using the standard basf2 command line option - i")
99 print(
"See: basf2 -h")
102 svdOccupCAF = SVDOccupancyCalibrations(input_files,
103 [
'giulia_CDCEDepToADCConversions_rel4_patch',
104 'data_reprocessing_prompt_rel4_patch'])
108 cal_fw.add_calibration(svdOccupCAF)
110 cal_fw.backend = backends.LSF()
113 if multiprocessing.cpu_count() < 10:
114 cal_fw.backend = backends.Local(8)