21 from caf
import backends
22 from caf.framework
import CAF
23 from basf2
import B2ERROR
24 from top_calibration
import BS13d_calibration_cdst
28 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
30 data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
31 skim_dir =
'skim/hlt_bhabha/cdst/sub00'
32 main_output_dir =
'top_calibration'
35 new_cdst_format =
False
42 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
44 experiment = int(argvs[1])
45 run_first = int(argvs[2])
46 run_last = int(argvs[3])
50 expNo =
'e' +
'{:0=4d}'.format(experiment)
51 for run
in range(run_first, run_last + 1):
52 runNo =
'r' +
'{:0=5d}'.format(run)
53 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
54 files = glob.glob(filename)
56 for i
in range(min(len(files), maxFiles)):
57 inputFiles.append(files[i])
61 if len(inputFiles) == 0:
62 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
63 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
64 ' (skim_dir=' + skim_dir +
')')
68 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
69 output_dir = f
"{main_output_dir}/BS13d-bhabha-{expNo}-{run_range}"
72 cal = BS13d_calibration_cdst(inputFiles, time_offset, globalTags, localDBs, new_cdst_format)
73 cal.backend_args = {
"queue":
"s"}
77 cal_fw.add_calibration(cal)
78 cal_fw.output_dir = output_dir
79 cal_fw.backend = backends.LSF()