21 from caf
import backends
22 from caf.framework
import CAF
23 from basf2
import B2ERROR
24 from top_calibration
import pulseHeight_calibration_laser
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'
41 print(
"usage: basf2", argvs[0],
"experiment run_1 run_2 ... run_n")
43 experiment = int(argvs[1])
44 run_numbers = sorted([int(r)
for r
in argvs[2:]])
45 run_first = run_numbers[0]
46 run_last = run_numbers[-1]
50 expNo =
'e' +
'{:0=4d}'.format(experiment)
51 for run
in run_numbers:
52 expRun =
'{:0=4d}'.format(experiment) +
'.' +
'{:0=5d}'.format(run)
53 filename = f
"{data_dir}/top.{expRun}.*.sroot"
54 inputFiles += glob.glob(filename)
56 if len(inputFiles) == 0:
57 runs =
"".join([str(r) +
"," for r
in run_numbers])[:-1]
58 B2ERROR(f
'No sroot files found in {data_dir} for exp={str(experiment)} runs={runs}')
62 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
63 output_dir = f
"{main_output_dir}/pulseHeight-laser-{expNo}-{run_range}"
66 cal = pulseHeight_calibration_laser(inputFiles, t_min, t_max, look_back,
68 cal.backend_args = {
"queue":
"s"}
72 cal_fw.add_calibration(cal)
73 cal_fw.output_dir = output_dir
74 cal_fw.backend = backends.LSF()