16 from caf
import backends
17 from caf.framework
import CAF
18 from basf2
import B2ERROR
19 from top_calibration
import BS13d_calibration_local
23 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
25 data_dir =
'/ghi/fs01/belle2/bdata/group/detector/TOP/2019-*/data_sroot_global/'
26 main_output_dir =
'top_calibration'
35 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
37 experiment = int(argvs[1])
38 run_first = int(argvs[2])
39 run_last = int(argvs[3])
43 expNo =
'e' +
'{:0=4d}'.format(experiment)
44 for run
in range(run_first, run_last + 1):
45 expRun =
'{:0=4d}'.format(experiment) +
'.' +
'{:0=5d}'.format(run)
46 filename = f
"{data_dir}/top.{expRun}.*.sroot"
47 files = glob.glob(filename)
49 for i
in range(min(len(files), maxFiles)):
50 inputFiles.append(files[i])
54 if len(inputFiles) == 0:
55 B2ERROR(
'No sroot files found in ' + data_dir +
' for exp=' + str(experiment) +
56 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last))
60 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
61 output_dir = f
"{main_output_dir}/BS13d-local-{expNo}-{run_range}"
64 cal = BS13d_calibration_local(inputFiles, look_back, globalTags, localDBs)
65 cal.backend_args = {
"queue":
"s"}
69 cal_fw.add_calibration(cal)
70 cal_fw.output_dir = output_dir