21 from caf
import backends
22 from caf.framework
import CAF
23 from basf2
import B2ERROR
24 from top_calibration
import BS13d_calibration_local
28 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
30 data_dir =
'/ghi/fs01/belle2/bdata/group/detector/TOP/2019-*/data_sroot_global/'
31 main_output_dir =
'top_calibration'
40 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
42 experiment = int(argvs[1])
43 run_first = int(argvs[2])
44 run_last = int(argvs[3])
48 expNo =
'e' +
'{:0=4d}'.format(experiment)
49 for run
in range(run_first, run_last + 1):
50 expRun =
'{:0=4d}'.format(experiment) +
'.' +
'{:0=5d}'.format(run)
51 filename = f
"{data_dir}/top.{expRun}.*.sroot"
52 files = glob.glob(filename)
54 for i
in range(min(len(files), maxFiles)):
55 inputFiles.append(files[i])
59 if len(inputFiles) == 0:
60 B2ERROR(
'No sroot files found in ' + data_dir +
' for exp=' + str(experiment) +
61 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last))
65 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
66 output_dir = f
"{main_output_dir}/BS13d-local-{expNo}-{run_range}"
69 cal = BS13d_calibration_local(inputFiles, look_back, globalTags, localDBs)
70 cal.backend_args = {
"queue":
"s"}
74 cal_fw.add_calibration(cal)
75 cal_fw.output_dir = output_dir
76 cal_fw.backend = backends.LSF()