16 from caf
import backends
17 from caf.framework
import CAF
18 from basf2
import B2ERROR
19 from top_calibration
import BS13d_calibration_cdst
23 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
25 data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
26 skim_dir =
'skim/hlt_bhabha/cdst/sub00'
27 main_output_dir =
'top_calibration'
30 new_cdst_format =
False
37 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
39 experiment = int(argvs[1])
40 run_first = int(argvs[2])
41 run_last = int(argvs[3])
45 expNo =
'e' +
'{:0=4d}'.format(experiment)
46 for run
in range(run_first, run_last + 1):
47 runNo =
'r' +
'{:0=5d}'.format(run)
48 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
49 files = glob.glob(filename)
51 for i
in range(min(len(files), maxFiles)):
52 inputFiles.append(files[i])
56 if len(inputFiles) == 0:
57 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
58 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
59 ' (skim_dir=' + skim_dir +
')')
63 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
64 output_dir = f
"{main_output_dir}/BS13d-bhabha-{expNo}-{run_range}"
67 cal = BS13d_calibration_cdst(inputFiles, time_offset, globalTags, localDBs, new_cdst_format)
68 cal.backend_args = {
"queue":
"s"}
72 cal_fw.add_calibration(cal)
73 cal_fw.output_dir = output_dir