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