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